From efdfa3d4d9f52eaf7409badd7de3761f019f26eb Mon Sep 17 00:00:00 2001 From: SooChan Lim Date: Tue, 3 Nov 2020 11:27:50 +0900 Subject: [PATCH] Revert "e_client: use e_client_cdata_get instead of using ec->comp_data." This reverts commit 7f6b3211a4fd1b6b9ea2d76ae0264fdba3156f4a. Change-Id: I9cc60c45d2d11b9bbd57942672dd3ea7ac7656ba --- src/bin/e_client.c | 75 +- src/bin/e_comp_object.c | 39 +- src/bin/e_comp_screen.c | 4 +- src/bin/e_comp_wl.c | 870 +++++++++------------- src/bin/e_comp_wl_capture.c | 6 +- src/bin/e_comp_wl_data.c | 17 +- src/bin/e_comp_wl_input.c | 40 +- src/bin/e_comp_wl_rsm.c | 178 ++--- src/bin/e_comp_wl_shell.c | 163 ++-- src/bin/e_comp_wl_subsurface.c | 517 +++++-------- src/bin/e_comp_wl_viewport.c | 272 +++---- src/bin/e_desk.c | 8 +- src/bin/e_desk_group.c | 4 +- src/bin/e_devicemgr_wl.c | 6 +- src/bin/e_eom.c | 32 +- src/bin/e_explicit_sync.c | 5 +- src/bin/e_hints.c | 8 +- src/bin/e_hwc_planes.c | 2 +- src/bin/e_hwc_window.c | 13 +- src/bin/e_hwc_window_queue.c | 7 +- src/bin/e_hwc_windows.c | 20 +- src/bin/e_info_server.c | 220 +++--- src/bin/e_keyrouter.c | 9 +- src/bin/e_keyrouter_events.c | 7 +- src/bin/e_keyrouter_wl.c | 19 +- src/bin/e_output.c | 12 +- src/bin/e_pixmap.c | 63 +- src/bin/e_plane.c | 5 +- src/bin/e_plane_renderer.c | 15 +- src/bin/e_pointer.c | 7 +- src/bin/e_policy.c | 18 +- src/bin/e_policy_conformant.c | 7 +- src/bin/e_policy_visibility.c | 43 +- src/bin/e_policy_wl.c | 168 ++--- src/bin/e_presentation_time.c | 5 +- src/bin/e_process.c | 8 +- src/bin/e_slot.c | 4 +- src/bin/e_xdg_shell_v6.c | 62 +- src/bin/services/e_service_cbhm.c | 9 +- src/bin/services/e_service_launcher.c | 16 +- src/bin/services/e_service_volume.c | 11 +- src/bin/video/e_client_video.c | 15 +- src/bin/video/e_comp_wl_video.c | 6 +- src/bin/video/e_comp_wl_video_buffer.c | 3 +- src/bin/video/iface/e_video_hwc.c | 76 +- src/bin/video/iface/e_video_hwc_planes.c | 8 +- src/bin/video/iface/e_video_hwc_windows.c | 4 +- 47 files changed, 1186 insertions(+), 1920 deletions(-) diff --git a/src/bin/e_client.c b/src/bin/e_client.c index f0e57c13a2..32066e6c4c 100644 --- a/src/bin/e_client.c +++ b/src/bin/e_client.c @@ -2258,7 +2258,6 @@ static void _e_client_cb_evas_restack(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { E_Client *ec = data; - E_Comp_Wl_Client_Data *child_cdata = NULL; if (e_object_is_del(data)) return; if (ec->layer_block) return; @@ -2273,8 +2272,7 @@ _e_client_cb_evas_restack(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA /* Don't stack vkbd if parent is splitted */ if (child->vkbd.vkbd && ec->layout.splited) continue; - child_cdata = e_client_cdata_get(child); - if (child_cdata && !child_cdata->mapped) + if (child->comp_data && !child->comp_data->mapped) { ELOGF("COMP", "STACK CHANGE CHILD. BUT not mapped. skip. child(ec:%p, win:0x%08zx)", ec, child, e_client_util_win_get(child)); continue; @@ -2504,7 +2502,7 @@ _e_client_aux_hint_eval(E_Client *ec) { if (!ec) return; - E_Comp_Wl_Client_Data *cdata = e_client_cdata_get(ec); + E_Comp_Wl_Client_Data *cdata = (E_Comp_Wl_Client_Data*)ec->comp_data; Eina_List *l, *ll; E_Comp_Wl_Aux_Hint *hint; @@ -3119,7 +3117,7 @@ _e_client_type_get(E_Client *ec) static void _e_client_transform_sub_apply(E_Client *ec, E_Client *epc, double zoom) { - E_Comp_Wl_Client_Data *cdata = e_client_cdata_get(ec); + E_Comp_Wl_Client_Data *cdata = (E_Comp_Wl_Client_Data*)ec->comp_data; E_Comp_Wl_Subsurf_Data *sdata = cdata->sub.data; E_Client *subc; Eina_List *l; @@ -3338,7 +3336,7 @@ _e_client_visibility_zone_calculate(E_Zone *zone) if (ec->visibility.skip) continue; if (ec->is_cursor) continue; /* if ec is subsurface, skip this */ - cdata = e_client_cdata_get(ec); + cdata = (E_Comp_Wl_Client_Data *)ec->comp_data; if (cdata && cdata->sub.data) continue; if ((!ec->first_mapped) && (e_comp_object_content_type_get(ec->frame) == E_COMP_OBJECT_CONTENT_TYPE_INT_IMAGE)) continue; @@ -3737,17 +3735,15 @@ _e_client_transform_core_check_change(E_Client *ec) int w = 0; int h = 0; Eina_Bool check = EINA_FALSE; - E_Comp_Wl_Client_Data *cdata = NULL; if (!ec) return EINA_FALSE; if (ec->frame) evas_object_geometry_get(ec->frame, 0, 0, &w, &h); - cdata = e_client_cdata_get(ec); if ((ec->transform_core.transform_list) && - (cdata && cdata->sub.below_obj)) + (ec->comp_data && ec->comp_data->sub.below_obj)) { - const Evas_Map *map_ = evas_object_map_get(cdata->sub.below_obj); + const Evas_Map *map_ = evas_object_map_get(ec->comp_data->sub.below_obj); if (!map_) check = EINA_TRUE; } @@ -3806,8 +3802,10 @@ _e_client_transform_core_check_change(E_Client *ec) } // check parent matrix change - if (cdata) + if (ec->comp_data) { + E_Comp_Wl_Client_Data *cdata = (E_Comp_Wl_Client_Data*)ec->comp_data; + if (cdata->sub.data) { E_Client *parent = cdata->sub.data->parent; @@ -3971,9 +3969,9 @@ _e_client_transform_core_sub_update(E_Client *ec, E_Util_Transform_Rect_Vertex * E_Comp_Wl_Client_Data *cdata; if (!ec) return; + if (!ec->comp_data) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; + cdata = (E_Comp_Wl_Client_Data*)ec->comp_data; if (cdata->sub.below_obj) _e_client_transform_core_vertices_apply(ec, cdata->sub.below_obj, vertices, NULL); @@ -3991,9 +3989,9 @@ _e_client_transform_core_sub_update_with_zoom(E_Client *ec, E_Util_Transform_Rec E_Comp_Wl_Client_Data *cdata; if (!ec) return; + if (!ec->comp_data) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; + cdata = (E_Comp_Wl_Client_Data*)ec->comp_data; if (cdata->sub.below_obj) _e_client_transform_core_vertices_apply_with_zoom(ec, cdata->sub.below_obj, vertices, NULL, zoomx, zoomy, cx, cy); @@ -4147,8 +4145,7 @@ e_client_idler_before(void) // ignored client but needing eval (aux hint) such as remote surfaces if (ec->changed) { - E_Comp_Wl_Client_Data *cdata = e_client_cdata_get(ec); - if (cdata && cdata->first_commit) + if (ec->comp_data && ec->comp_data->first_commit) _e_client_aux_hint_eval(ec); } continue; @@ -6108,8 +6105,6 @@ e_client_iconify(E_Client *ec) E_OBJECT_CHECK(ec); E_OBJECT_TYPE_CHECK(ec, E_CLIENT_TYPE); - E_Comp_Wl_Client_Data *cdata = e_client_cdata_get(ec); - ELOGF("TZVIS", "ICONIFY |iconic:%d |argb:%d |not_raise:%d |by_client:%d", ec, ec->iconic, ec->argb, (unsigned int)ec->exp_iconify.not_raise, ec->exp_iconify.by_client); @@ -6118,7 +6113,7 @@ e_client_iconify(E_Client *ec) if (ec->shading || ec->iconic) return; if (ec->exp_iconify.skip_iconify && !ec->exp_iconify.by_client) return; if (ec->exp_iconify.skip_by_remote) return; - if (!cdata || !cdata->mapped) + if (!ec->comp_data || !ec->comp_data->mapped) { if (!ec->exp_iconify.by_client) { @@ -6169,12 +6164,10 @@ e_client_uniconify(E_Client *ec) E_OBJECT_CHECK(ec); E_OBJECT_TYPE_CHECK(ec, E_CLIENT_TYPE); - E_Comp_Wl_Client_Data *cdata = e_client_cdata_get(ec); - ELOGF("TZVIS", "UNICONIFY|iconic:%d |argb:%d |not_raise:%d |by_client:%d |mapped:%d", ec, ec->iconic, ec->argb, (unsigned int)ec->exp_iconify.not_raise, ec->exp_iconify.by_client, - cdata ? cdata->mapped : 0); + ec->comp_data ? ec->comp_data->mapped : 0); if (!ec->zone) return; if (ec->shading || (!ec->iconic)) return; @@ -6213,7 +6206,7 @@ e_client_uniconify(E_Client *ec) if (ec->pixmap && e_pixmap_usable_get(ec->pixmap)) { - if (cdata && cdata->mapped) + if (ec->comp_data && ec->comp_data->mapped) { ELOGF("TZVIS", "UNICONIFY|object show", ec); evas_object_show(ec->frame); @@ -7075,7 +7068,7 @@ E_API void e_client_transform_apply(E_Client *ec, double angle, double zoom, int cx, int cy) { Evas_Map *map; - E_Comp_Wl_Client_Data *cdata = e_client_cdata_get(ec); + E_Comp_Wl_Client_Data *cdata = (E_Comp_Wl_Client_Data*)ec->comp_data; E_Client *subc; Eina_List *l; @@ -7145,7 +7138,7 @@ e_client_transform_apply(E_Client *ec, double angle, double zoom, int cx, int cy E_API void e_client_transform_clear(E_Client *ec) { - E_Comp_Wl_Client_Data *cdata = e_client_cdata_get(ec); + E_Comp_Wl_Client_Data *cdata = (E_Comp_Wl_Client_Data*)ec->comp_data; E_Client *subc; Eina_List *l; @@ -7670,7 +7663,6 @@ E_API Eina_Bool e_client_base_output_resolution_update(E_Client *ec) { E_Appinfo *eai = NULL; - E_Comp_Wl_Client_Data *cdata = NULL; int configured_width, configured_height; int width, height; @@ -7679,14 +7671,12 @@ e_client_base_output_resolution_update(E_Client *ec) if (!e_config->configured_output_resolution.use) return EINA_TRUE; if (ec->base_output_resolution.use) return EINA_TRUE; - cdata = e_client_cdata_get(ec); - /* Check whether it's subsurface or not * The resolution of subsurface will follow the resolution of its toplevel surface. * Transform for subsurface will be applied when toplevel surface does by * implementation of e_client_transform_core. */ - if (cdata->sub.data) return EINA_FALSE; + if (ec->comp_data->sub.data) return EINA_FALSE; configured_width = e_config->configured_output_resolution.w; configured_height = e_config->configured_output_resolution.h; @@ -8165,8 +8155,6 @@ e_client_lower(E_Client *ec) E_API void e_client_stack_above(E_Client *ec, E_Client *above) { - E_Comp_Wl_Client_Data *above_cdata = NULL; - if (!ec) return; if (!ec->frame) return; if (!above) return; @@ -8200,21 +8188,16 @@ e_client_stack_above(E_Client *ec, E_Client *above) evas_object_stack_above(ec->frame, above->frame); - above_cdata = e_client_cdata_get(above); - if (!above_cdata) return; - /* Since calling evas_object_stack_above() messes up the stacking order of * sub-surface of above, it should be updated. */ - if ((above_cdata->sub.list) && - (eina_list_count(above_cdata->sub.list) > 0)) + if ((above->comp_data->sub.list) && + (eina_list_count(above->comp_data->sub.list) > 0)) e_comp_wl_subsurface_stack_update(above); } E_API void e_client_stack_below(E_Client *ec, E_Client *below) { - E_Comp_Wl_Client_Data *below_cdata = NULL; - if (!ec) return; if (!ec->frame) return; if (!below) return; @@ -8248,13 +8231,10 @@ e_client_stack_below(E_Client *ec, E_Client *below) evas_object_stack_below(ec->frame, below->frame); - below_cdata = e_client_cdata_get(below); - if (!below_cdata) return; - /* Since calling evas_object_stack_below() messes up the stacking order of * sub-surface of below, it should be updated. */ - if ((below_cdata->sub.below_list) && - (eina_list_count(below_cdata->sub.below_list) > 0)) + if ((below->comp_data->sub.below_list) && + (eina_list_count(below->comp_data->sub.below_list) > 0)) e_comp_wl_subsurface_stack_update(below); } @@ -8296,12 +8276,11 @@ _e_client_surface_tree_foreach_helper(E_Client *ec, E_Client_Surface_Tree_Foreac E_Client *subc; Eina_List *l, *ll; Eina_Bool res = EINA_TRUE; - E_Comp_Wl_Client_Data *cdata = e_client_cdata_get(ec); - if ((e_object_is_del(E_OBJECT(ec))) || (!cdata)) + if ((e_object_is_del(E_OBJECT(ec))) || (!ec->comp_data)) return res; - EINA_LIST_FOREACH_SAFE(cdata->sub.below_list, l, ll, subc) + EINA_LIST_FOREACH_SAFE(ec->comp_data->sub.below_list, l, ll, subc) { res = _e_client_surface_tree_foreach_helper(subc, func, data); if (!res) @@ -8313,7 +8292,7 @@ _e_client_surface_tree_foreach_helper(E_Client *ec, E_Client_Surface_Tree_Foreac res = func(data, ec); if (res) { - EINA_LIST_FOREACH_SAFE(cdata->sub.list, l, ll, subc) + EINA_LIST_FOREACH_SAFE(ec->comp_data->sub.list, l, ll, subc) { res = _e_client_surface_tree_foreach_helper(subc, func, diff --git a/src/bin/e_comp_object.c b/src/bin/e_comp_object.c index abc9ad9a35..a943cc1c58 100644 --- a/src/bin/e_comp_object.c +++ b/src/bin/e_comp_object.c @@ -646,26 +646,23 @@ static void _e_comp_object_map_transform_pos(E_Client *ec, int sx, int sy, int *dx, int *dy) { E_Comp_Wl_Buffer_Viewport *vp; - E_Comp_Wl_Client_Data *cdata = NULL; int transform; int bw, bh, tx, ty; - cdata = e_client_cdata_get(ec); - - if (!ec || !cdata || e_object_is_del(E_OBJECT(ec))) + if (!ec || !ec->comp_data || e_object_is_del(E_OBJECT(ec))) { *dx = sx; *dy = sy; return; } - vp = &cdata->scaler.buffer_viewport; + vp = &ec->comp_data->scaler.buffer_viewport; transform = e_comp_wl_output_buffer_transform_get(ec); e_pixmap_size_get(ec->pixmap, &bw, &bh); /* for subsurface, it should be swap 90 and 270 */ - if (cdata->sub.data) + if (ec->comp_data->sub.data) switch (transform) { case WL_OUTPUT_TRANSFORM_90: transform = WL_OUTPUT_TRANSFORM_270; break; @@ -1750,8 +1747,6 @@ static void _e_comp_intercept_layer_set(void *data, Evas_Object *obj, int layer) { E_Comp_Object *cw = data; - E_Comp_Wl_Client_Data *cdata = NULL; - E_Comp_Wl_Client_Data *child_cdata = NULL; unsigned int l = e_comp_canvas_layer_map(layer); int oldraise; @@ -1772,15 +1767,14 @@ _e_comp_intercept_layer_set(void *data, Evas_Object *obj, int layer) e_comp_render_queue(); } ec = e_client_above_get(cw->ec); - cdata = e_client_cdata_get(ec); /* skip subsurface: stacking subsurface is handled by e_comp_wl */ - while ((ec) && (cdata) && (cdata->sub.data)) + while ((ec) && (ec->comp_data) && (ec->comp_data->sub.data)) ec = e_client_above_get(ec); if (ec && (evas_object_layer_get(ec->frame) != evas_object_layer_get(obj))) { ec = e_client_below_get(cw->ec); /* skip subsurface: stacking subsurface is handled by e_comp_wl */ - while ((ec) && (cdata) && (cdata->sub.data)) + while ((ec) && (ec->comp_data) && (ec->comp_data->sub.data)) ec = e_client_below_get(ec); if (ec && (evas_object_layer_get(ec->frame) == evas_object_layer_get(cw->smart_obj))) { @@ -1829,8 +1823,7 @@ layer_set: e_config->transient.raise = 1; EINA_LIST_FREE(list, child) { - child_cdata = e_client_cdata_get(child); - if (child_cdata && !child_cdata->mapped) + if (child->comp_data && !child->comp_data->mapped) { ELOGF("COMP", "LAYER_SET CHILD. BUT not mapped. skip. child(ec:%p, win:0x%08zx)", cw->ec, child, e_client_util_win_get(child)); continue; @@ -6079,27 +6072,22 @@ e_comp_object_map_update(Evas_Object *obj) { API_ENTRY; E_Client *ec = cw->ec; - E_Comp_Wl_Client_Data *cdata = NULL; Evas_Map *map; int x1, y1, x2, y2, x, y, bw, bh, tw, th; char buffer[128]; char *p = buffer; int l, remain = sizeof buffer; - if (!ec) return; - if (!e_object_is_del(E_OBJECT(ec))) return; - - cdata = e_client_cdata_get(ec); - if (!cdata) return; + if (!ec || !ec->comp_data || e_object_is_del(E_OBJECT(ec))) return; /* if buffer had been flushed, buffer could be NULL. Then map will be applied * when new buffer is attached. */ - if (!cdata->buffer_ref.buffer) return; + if (!ec->comp_data->buffer_ref.buffer) return; if ((!cw->redirected) || (!e_comp_wl_output_buffer_transform_get(ec) && - cdata->scaler.buffer_viewport.buffer.scale == 1)) + ec->comp_data->scaler.buffer_viewport.buffer.scale == 1)) { if (evas_object_map_enable_get(cw->effect_obj)) { @@ -6204,9 +6192,8 @@ e_comp_object_image_filter_set(Evas_Object *obj, E_Comp_Image_Filter filter) API_ENTRY EINA_FALSE; EINA_SAFETY_ON_NULL_RETURN_VAL(cw->ec, EINA_FALSE); - if (!cw->ec) return EINA_FALSE; - if (e_object_is_del(E_OBJECT(cw->ec))) return EINA_FALSE; - if (!e_client_cdata_get(cw->ec)) return EINA_FALSE; + if ((!cw->ec) || (!cw->ec->comp_data) || (e_object_is_del(E_OBJECT(cw->ec)))) + return EINA_FALSE; switch (filter) { @@ -6236,8 +6223,8 @@ e_comp_object_image_filter_get(Evas_Object *obj) API_ENTRY E_COMP_IMAGE_FILTER_NONE; EINA_SAFETY_ON_NULL_RETURN_VAL(cw->ec, E_COMP_IMAGE_FILTER_NONE); - if (e_object_is_del(E_OBJECT(cw->ec))) return E_COMP_IMAGE_FILTER_NONE; - if (!e_client_cdata_get(cw->ec)) return E_COMP_IMAGE_FILTER_NONE; + if ((!cw->ec->comp_data) || (e_object_is_del(E_OBJECT(cw->ec)))) + return E_COMP_IMAGE_FILTER_NONE; return cw->image_filter; } diff --git a/src/bin/e_comp_screen.c b/src/bin/e_comp_screen.c index 2c161796ab..78ec7cac54 100644 --- a/src/bin/e_comp_screen.c +++ b/src/bin/e_comp_screen.c @@ -1358,7 +1358,6 @@ E_API void e_comp_screen_rotation_ignore_output_transform_send(E_Client *ec, Eina_Bool ignore) { E_Comp_Screen_Tzsr *tzsr = _tz_surface_rotation_find(ec); - E_Comp_Wl_Client_Data *cdata = NULL; if (!tzsr) return; @@ -1381,8 +1380,7 @@ e_comp_screen_rotation_ignore_output_transform_send(E_Client *ec, Eina_Bool igno ELOGF("TRANSFORM", "|tzsr(%p) ignore_output_transform(%d)", ec, tzsr, ignore); - cdata = e_client_cdata_get(ec); - tizen_screen_rotation_send_ignore_output_transform(tzsr->resource, cdata->surface, ignore); + tizen_screen_rotation_send_ignore_output_transform(tzsr->resource, ec->comp_data->surface, ignore); } EINTERN Eina_Bool diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c index a9aa5e4f26..0eb939e26b 100644 --- a/src/bin/e_comp_wl.c +++ b/src/bin/e_comp_wl.c @@ -205,7 +205,6 @@ _e_comp_wl_intercept_hook_call(E_Comp_Wl_Intercept_Hook_Point hookpoint, E_Clien static void _e_comp_wl_configure_send(E_Client *ec, Eina_Bool edges, Eina_Bool send_size) { - E_Comp_Wl_Client_Data *cdata = NULL; int w, h; if (send_size) @@ -218,8 +217,7 @@ _e_comp_wl_configure_send(E_Client *ec, Eina_Bool edges, Eina_Bool send_size) else w = h = 0; - cdata = e_client_cdata_get(ec); - cdata->shell.configure_send(cdata->shell.surface, + ec->comp_data->shell.configure_send(ec->comp_data->shell.surface, edges * e_comp_wl->resize.edges, w, h); } @@ -260,21 +258,19 @@ _e_comp_wl_cb_prepare(void *data EINA_UNUSED, Ecore_Fd_Handler *hdlr EINA_UNUSED E_API enum wl_output_transform e_comp_wl_output_buffer_transform_get(E_Client *ec) { - E_Comp_Wl_Client_Data *cdata = NULL; E_Comp_Wl_Buffer_Viewport *vp; E_Comp_Wl_Buffer *buffer; enum wl_output_transform transform, rotation; if (!ec) return WL_OUTPUT_TRANSFORM_NORMAL; if (e_object_is_del(E_OBJECT(ec))) return WL_OUTPUT_TRANSFORM_NORMAL; - cdata = e_client_cdata_get(ec); - if (!cdata) return WL_OUTPUT_TRANSFORM_NORMAL; + if (!ec->comp_data) return WL_OUTPUT_TRANSFORM_NORMAL; - vp = &cdata->scaler.buffer_viewport; - if (cdata->sub.data) + vp = &ec->comp_data->scaler.buffer_viewport; + if (ec->comp_data->sub.data) return vp->buffer.transform; - buffer = cdata->buffer_ref.buffer; + buffer = ec->comp_data->buffer_ref.buffer; if (!buffer || (buffer->type != E_COMP_WL_BUFFER_TYPE_NATIVE && buffer->type != E_COMP_WL_BUFFER_TYPE_TBM)) @@ -298,21 +294,19 @@ e_comp_wl_output_buffer_transform_get(E_Client *ec) EINTERN enum wl_output_transform e_comp_wl_output_pending_buffer_transform_get(E_Client *ec) { - E_Comp_Wl_Client_Data *cdata = NULL; E_Comp_Wl_Buffer_Viewport *vp; E_Comp_Wl_Buffer *buffer; enum wl_output_transform transform, rotation; if (!ec) return WL_OUTPUT_TRANSFORM_NORMAL; if (e_object_is_del(E_OBJECT(ec))) return WL_OUTPUT_TRANSFORM_NORMAL; - cdata = e_client_cdata_get(ec); - if (!cdata) return WL_OUTPUT_TRANSFORM_NORMAL; + if (!ec->comp_data) return WL_OUTPUT_TRANSFORM_NORMAL; - vp = &cdata->pending.buffer_viewport; - if (cdata->sub.data) + vp = &ec->comp_data->pending.buffer_viewport; + if (ec->comp_data->sub.data) return vp->buffer.transform; - buffer = cdata->pending.buffer; + buffer = ec->comp_data->pending.buffer; if (!buffer || (buffer->type != E_COMP_WL_BUFFER_TYPE_NATIVE && buffer->type != E_COMP_WL_BUFFER_TYPE_TBM)) @@ -336,21 +330,15 @@ e_comp_wl_output_pending_buffer_transform_get(E_Client *ec) E_API void e_comp_wl_map_size_cal_from_buffer(E_Client *ec) { - E_Comp_Wl_Client_Data *cdata = NULL; - E_Comp_Wl_Buffer_Viewport *vp = NULL; + E_Comp_Wl_Buffer_Viewport *vp = &ec->comp_data->scaler.buffer_viewport; E_Comp_Wl_Buffer *buffer; int32_t width, height; - if (!ec) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; - vp = &cdata->scaler.buffer_viewport; - buffer = e_pixmap_resource_get(ec->pixmap); if (!buffer) { - cdata->width_from_buffer = 0; - cdata->height_from_buffer = 0; + ec->comp_data->width_from_buffer = 0; + ec->comp_data->height_from_buffer = 0; return; } @@ -369,31 +357,25 @@ e_comp_wl_map_size_cal_from_buffer(E_Client *ec) break; } - cdata->width_from_buffer = width; - cdata->height_from_buffer = height; + ec->comp_data->width_from_buffer = width; + ec->comp_data->height_from_buffer = height; } E_API void e_comp_wl_map_size_cal_from_viewport(E_Client *ec) { - E_Comp_Wl_Client_Data *cdata = NULL; - E_Comp_Wl_Buffer_Viewport *vp = NULL; + E_Comp_Wl_Buffer_Viewport *vp = &ec->comp_data->scaler.buffer_viewport; int32_t width, height; - if (!ec) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; - vp = &cdata->scaler.buffer_viewport; - - width = cdata->width_from_buffer; - height = cdata->height_from_buffer; + width = ec->comp_data->width_from_buffer; + height = ec->comp_data->height_from_buffer; if (width == 0 && height == 0) return; if (width != 0 && vp->surface.width != -1) { - cdata->width_from_viewport = vp->surface.width; - cdata->height_from_viewport = vp->surface.height; + ec->comp_data->width_from_viewport = vp->surface.width; + ec->comp_data->height_from_viewport = vp->surface.height; return; } @@ -401,33 +383,30 @@ e_comp_wl_map_size_cal_from_viewport(E_Client *ec) { int32_t w = wl_fixed_to_int(wl_fixed_from_int(1) - 1 + vp->buffer.src_width); int32_t h = wl_fixed_to_int(wl_fixed_from_int(1) - 1 + vp->buffer.src_height); - cdata->width_from_viewport = w ?: 1; - cdata->height_from_viewport = h ?: 1; + ec->comp_data->width_from_viewport = w ?: 1; + ec->comp_data->height_from_viewport = h ?: 1; return; } - cdata->width_from_viewport = width; - cdata->height_from_viewport = height; + ec->comp_data->width_from_viewport = width; + ec->comp_data->height_from_viewport = height; } E_API E_Client* e_comp_wl_topmost_parent_get(E_Client *ec) { E_Client *parent = NULL; - E_Comp_Wl_Client_Data *cdata = e_client_cdata_get(ec); - E_Comp_Wl_Client_Data *parent_cdata = NULL; - if (!cdata || !cdata->sub.data) + if (!ec->comp_data || !ec->comp_data->sub.data) return ec; - parent = cdata->sub.data->parent; + parent = ec->comp_data->sub.data->parent; while (parent) { - parent_cdata = e_client_cdata_get(parent); - if (!parent_cdata || !parent_cdata->sub.data) + if (!parent->comp_data || !parent->comp_data->sub.data) return parent; - parent = parent_cdata->sub.data->parent; + parent = parent->comp_data->sub.data->parent; } return ec; @@ -442,17 +421,15 @@ e_comp_wl_map_apply(E_Client *ec) int x1, y1, x2, y2, x, y; int dx, dy; - if (!ec) return; - if (e_object_is_del(E_OBJECT(ec))) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; + if (!ec || !ec->comp_data || e_object_is_del(E_OBJECT(ec))) return; e_comp_object_map_update(ec->frame); - vp = &cdata->scaler.buffer_viewport; + vp = &ec->comp_data->scaler.buffer_viewport; if (vp->buffer.src_width == wl_fixed_from_int(-1)) return; - sdata = cdata->sub.data; + cdata = ec->comp_data; + sdata = ec->comp_data->sub.data; if (sdata) { dx = sdata->position.x; @@ -467,11 +444,10 @@ e_comp_wl_map_apply(E_Client *ec) if (sdata->remote_surface.offscreen_parent) { E_Client *offscreen_parent = sdata->remote_surface.offscreen_parent; - E_Comp_Wl_Client_Data *off_screen_parent_cdata = e_client_cdata_get(offscreen_parent); Eina_Rectangle *rect; Eina_List *l; - EINA_LIST_FOREACH(off_screen_parent_cdata->remote_surface.regions, l, rect) + EINA_LIST_FOREACH(offscreen_parent->comp_data->remote_surface.regions, l, rect) { /* TODO: If there are one more regions, it means that provider's offscreen * is displayed by one more remote_surfaces. Have to consider it later. At @@ -500,8 +476,8 @@ e_comp_wl_map_apply(E_Client *ec) } e_util_transform_viewport_set(cdata->viewport_transform, dx, dy, - cdata->width_from_viewport, - cdata->height_from_viewport); + ec->comp_data->width_from_viewport, + ec->comp_data->height_from_viewport); x1 = wl_fixed_to_int(vp->buffer.src_x); y1 = wl_fixed_to_int(vp->buffer.src_y); @@ -514,8 +490,8 @@ e_comp_wl_map_apply(E_Client *ec) e_util_transform_texcoord_set(cdata->viewport_transform, 3, x1, y2); ELOGF("TRANSFORM", "viewport map: point(%d,%d %dx%d) uv(%d,%d %d,%d %d,%d %d,%d)", - ec, ec->x, ec->y, cdata->width_from_viewport, - cdata->height_from_viewport, x1, y1, x2, y1, x2, y2, x1, y2); + ec, ec->x, ec->y, ec->comp_data->width_from_viewport, + ec->comp_data->height_from_viewport, x1, y1, x2, y1, x2, y2, x1, y2); e_client_transform_core_update(ec); } @@ -564,21 +540,18 @@ static void _e_comp_wl_evas_cb_show(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED) { E_Client *ec, *tmp; - E_Comp_Wl_Client_Data *cdata = NULL; Eina_List *l; E_Client *topmost; if (!(ec = data)) return; if (e_object_is_del(data)) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; if (!ec->override) e_hints_window_visible_set(ec); - if ((!ec->override) && (!ec->re_manage) && (!cdata->reparented) && - (!cdata->need_reparent)) + if ((!ec->override) && (!ec->re_manage) && (!ec->comp_data->reparented) && + (!ec->comp_data->need_reparent)) { - cdata->need_reparent = EINA_TRUE; + ec->comp_data->need_reparent = EINA_TRUE; ec->visible = EINA_TRUE; } if (!e_client_util_ignored_get(ec)) @@ -587,7 +560,7 @@ _e_comp_wl_evas_cb_show(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EIN EC_CHANGED(ec); } - if (!cdata->need_reparent) + if (!ec->comp_data->need_reparent) { if ((ec->hidden) || (ec->iconic)) { @@ -602,43 +575,40 @@ _e_comp_wl_evas_cb_show(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EIN evas_object_show(tmp->frame); topmost = e_comp_wl_topmost_parent_get(ec); - if (topmost == ec && (cdata->sub.list || cdata->sub.below_list)) + if (topmost == ec && (ec->comp_data->sub.list || ec->comp_data->sub.below_list)) e_comp_wl_subsurface_show(ec); - if (cdata->sub.below_obj) - evas_object_show(cdata->sub.below_obj); + if (ec->comp_data->sub.below_obj) + evas_object_show(ec->comp_data->sub.below_obj); } static void _e_comp_wl_evas_cb_hide(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED) { E_Client *ec, *tmp; - E_Comp_Wl_Client_Data *cdata = NULL; Eina_List *l; E_Client *topmost; if (!(ec = data)) return; if (e_object_is_del(E_OBJECT(ec))) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; /* Uncommonly some clients's final buffer can be skipped if the client * requests unmap of its surface right after wl_surface@commit. * So if this client evas object is hidden state and client is already * unmmapped, we can consider to clear pixmap image here mandatorily. */ - if (!cdata->mapped) + if (!ec->comp_data->mapped) e_pixmap_image_clear(ec->pixmap, 1); EINA_LIST_FOREACH(ec->e.state.video_child, l, tmp) evas_object_hide(tmp->frame); topmost = e_comp_wl_topmost_parent_get(ec); - if (topmost == ec && (cdata->sub.list || cdata->sub.below_list)) + if (topmost == ec && (ec->comp_data->sub.list || ec->comp_data->sub.below_list)) e_comp_wl_subsurface_hide(ec); - if (cdata->sub.below_obj) - evas_object_hide(cdata->sub.below_obj); + if (ec->comp_data->sub.below_obj) + evas_object_hide(ec->comp_data->sub.below_obj); } static void @@ -646,48 +616,44 @@ _e_comp_wl_evas_cb_move(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_U { E_Client *ec; E_Client *subc; - E_Comp_Wl_Client_Data *cdata = NULL; - E_Comp_Wl_Client_Data *subc_cdata = NULL; Eina_List *l; int x, y; if (!(ec = data)) return; if (e_object_is_del(E_OBJECT(ec))) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; - EINA_LIST_FOREACH(cdata->sub.list, l, subc) + EINA_LIST_FOREACH(ec->comp_data->sub.list, l, subc) { - subc_cdata = e_client_cdata_get(subc); - if (!subc_cdata || !subc_cdata->sub.data) continue; - x = ec->x + subc_cdata->sub.data->position.x; - y = ec->y + subc_cdata->sub.data->position.y; + if (!subc->comp_data || !subc->comp_data->sub.data) continue; + x = ec->x + subc->comp_data->sub.data->position.x; + y = ec->y + subc->comp_data->sub.data->position.y; evas_object_move(subc->frame, x, y); - if (subc_cdata->scaler.viewport) + if (subc->comp_data->scaler.viewport) { - if (subc_cdata->viewport_transform) + E_Comp_Wl_Client_Data *cdata = subc->comp_data; + if (cdata->viewport_transform) e_comp_wl_map_apply(subc); } } - EINA_LIST_FOREACH(cdata->sub.below_list, l, subc) + EINA_LIST_FOREACH(ec->comp_data->sub.below_list, l, subc) { - subc_cdata = e_client_cdata_get(subc); - if (!subc_cdata || !subc_cdata->sub.data) continue; - x = ec->x + subc_cdata->sub.data->position.x; - y = ec->y + subc_cdata->sub.data->position.y; + if (!subc->comp_data || !subc->comp_data->sub.data) continue; + x = ec->x + subc->comp_data->sub.data->position.x; + y = ec->y + subc->comp_data->sub.data->position.y; evas_object_move(subc->frame, x, y); - if (subc_cdata->scaler.viewport) + if (subc->comp_data->scaler.viewport) { - if (subc_cdata->viewport_transform) + E_Comp_Wl_Client_Data *cdata = subc->comp_data; + if (cdata->viewport_transform) e_comp_wl_map_apply(subc); } } - if (cdata->sub.below_obj) - evas_object_move(cdata->sub.below_obj, ec->x, ec->y); + if (ec->comp_data->sub.below_obj) + evas_object_move(ec->comp_data->sub.below_obj, ec->x, ec->y); } static void @@ -697,15 +663,13 @@ _e_comp_wl_send_touch_cancel(E_Client *ec) struct wl_resource *res; struct wl_client *wc; E_Comp_Config *comp_conf = NULL; - E_Comp_Wl_Client_Data *cdata = NULL; if (!ec) return; if (e_object_is_del(E_OBJECT(ec))) return; - cdata = e_client_cdata_get(ec); - if (!cdata|| !cdata->surface) return; + if (!ec->comp_data || !ec->comp_data->surface) return; if ((ec->ignored) && (!ec->remote_surface.provider)) return; - wc = wl_resource_get_client(cdata->surface); + wc = wl_resource_get_client(ec->comp_data->surface); comp_conf = e_comp_config_get(); @@ -772,15 +736,14 @@ _e_comp_wl_device_last_device_set(Ecore_Device_Class dev_class, E_Devicemgr_Inpu static E_Devicemgr_Input_Device * _e_comp_wl_device_client_last_device_get(E_Client *ec, Ecore_Device_Class dev_class) { - E_Comp_Wl_Client_Data *cdata = e_client_cdata_get(ec); switch (dev_class) { case ECORE_DEVICE_CLASS_MOUSE: - return cdata->last_device_ptr; + return ec->comp_data->last_device_ptr; case ECORE_DEVICE_CLASS_KEYBOARD: - return cdata->last_device_kbd; + return ec->comp_data->last_device_kbd; case ECORE_DEVICE_CLASS_TOUCH: - return cdata->last_device_touch; + return ec->comp_data->last_device_touch; default: return NULL;; } @@ -790,17 +753,16 @@ _e_comp_wl_device_client_last_device_get(E_Client *ec, Ecore_Device_Class dev_cl static void _e_comp_wl_device_client_last_device_set(E_Client *ec, Ecore_Device_Class dev_class, E_Devicemgr_Input_Device *device) { - E_Comp_Wl_Client_Data *cdata = e_client_cdata_get(ec); switch (dev_class) { case ECORE_DEVICE_CLASS_MOUSE: - cdata->last_device_ptr = device; + ec->comp_data->last_device_ptr = device; break; case ECORE_DEVICE_CLASS_KEYBOARD: - cdata->last_device_kbd = device; + ec->comp_data->last_device_kbd = device; break; case ECORE_DEVICE_CLASS_TOUCH: - cdata->last_device_touch = device; + ec->comp_data->last_device_touch = device; break; default: break; @@ -817,7 +779,6 @@ _e_comp_wl_device_send_event_device(E_Client *ec, Evas_Device *dev, uint32_t tim struct wl_client *wc; uint32_t serial; Eina_List *l, *ll; - E_Comp_Wl_Client_Data *cdata = NULL; EINA_SAFETY_ON_NULL_RETURN(dev); @@ -826,8 +787,7 @@ _e_comp_wl_device_send_event_device(E_Client *ec, Evas_Device *dev, uint32_t tim return; if (e_object_is_del(E_OBJECT(ec))) return; if ((ec->ignored) && (!ec->remote_surface.provider)) return; - cdata = e_client_cdata_get(ec); - if (!cdata || !cdata->surface) return; + if (!ec->comp_data || !ec->comp_data->surface) return; dev_class = (Ecore_Device_Class)evas_device_class_get(dev); dev_name = evas_device_description_get(dev); @@ -835,7 +795,7 @@ _e_comp_wl_device_send_event_device(E_Client *ec, Evas_Device *dev, uint32_t tim ec_last_device = _e_comp_wl_device_client_last_device_get(ec, dev_class); serial = wl_display_next_serial(e_comp_wl->wl.disp); - wc = wl_resource_get_client(cdata->surface); + wc = wl_resource_get_client(ec->comp_data->surface); EINA_LIST_FOREACH(e_devicemgr->device_list, l, input_dev) { if (!eina_streq(input_dev->identifier, dev_name) || (input_dev->clas != dev_class)) continue; @@ -861,10 +821,8 @@ _e_comp_wl_device_send_last_event_device(E_Client *ec, Ecore_Device_Class dev_cl struct wl_client *wc; uint32_t serial; Eina_List *l; - E_Comp_Wl_Client_Data *cdata = NULL; - cdata = e_client_cdata_get(ec); - if (!cdata || !cdata->surface) return; + if (!ec->comp_data || !ec->comp_data->surface) return; last_device = _e_comp_wl_device_last_device_get(dev_class); if (!last_device) return; @@ -872,7 +830,7 @@ _e_comp_wl_device_send_last_event_device(E_Client *ec, Ecore_Device_Class dev_cl _e_comp_wl_device_client_last_device_set(ec, dev_class, last_device); serial = wl_display_next_serial(e_comp_wl->wl.disp); - wc = wl_resource_get_client(cdata->surface); + wc = wl_resource_get_client(ec->comp_data->surface); EINA_LIST_FOREACH(last_device->resources, l, dev_res) { if (wl_resource_get_client(dev_res) != wc) continue; @@ -914,15 +872,13 @@ _e_comp_wl_cursor_reload(E_Client *ec) Eina_List *l; uint32_t serial; int cx, cy, px, py; - E_Comp_Wl_Client_Data *cdata = NULL; if (e_comp->pointer->o_ptr && (!evas_object_visible_get(e_comp->pointer->o_ptr))) e_pointer_object_set(e_comp->pointer, NULL, 0, 0); if (!ec) return; if (e_object_is_del(E_OBJECT(ec))) return; - cdata = e_client_cdata_get(ec); - if (!cdata || !cdata->surface) return; + if (!ec->comp_data || !ec->comp_data->surface) return; px = wl_fixed_to_int(e_comp_wl->ptr.x); py = wl_fixed_to_int(e_comp_wl->ptr.y); @@ -938,13 +894,13 @@ _e_comp_wl_cursor_reload(E_Client *ec) cx = px - ec->client.x; cy = py - ec->client.y; - wc = wl_resource_get_client(cdata->surface); + wc = wl_resource_get_client(ec->comp_data->surface); serial = wl_display_next_serial(e_comp_wl->wl.disp); EINA_LIST_FOREACH(e_comp_wl->ptr.resources, l, res) { if (!e_comp_wl_input_pointer_check(res)) continue; if (wl_resource_get_client(res) != wc) continue; - wl_pointer_send_enter(res, serial, cdata->surface, + wl_pointer_send_enter(res, serial, ec->comp_data->surface, wl_fixed_from_int(cx), wl_fixed_from_int(cy)); ec->pointer_enter_sent = EINA_TRUE; } @@ -968,15 +924,13 @@ _e_comp_wl_device_send_axis(const char *dev_name, Evas_Device_Class dev_class, E struct wl_client *wc; Eina_List *l, *ll; wl_fixed_t f_value; - E_Comp_Wl_Client_Data *cdata = NULL; if (!ec) return; if (e_object_is_del(E_OBJECT(ec))) return; - cdata = e_client_cdata_get(ec); - if (!cdata || !cdata->surface) return; + if (!ec->comp_data || !ec->comp_data->surface) return; f_value = wl_fixed_from_double(value); - wc = wl_resource_get_client(cdata->surface); + wc = wl_resource_get_client(ec->comp_data->surface); EINA_LIST_FOREACH(e_devicemgr->device_list, l, input_dev) { @@ -1084,13 +1038,12 @@ _e_comp_wl_evas_cb_mouse_in(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj struct wl_client *wc; Eina_List *l; uint32_t serial; - E_Comp_Wl_Client_Data *cdata = NULL; ev = event; if (!(ec = data)) return; if (e_object_is_del(E_OBJECT(ec))) return; - cdata = e_client_cdata_get(ec); - if (!cdata || !cdata->surface) return; + + if (!ec->comp_data || !ec->comp_data->surface) return; e_comp_wl->ptr.ec = ec; if (e_comp_wl->drag) @@ -1106,7 +1059,7 @@ _e_comp_wl_evas_cb_mouse_in(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj } if (!eina_list_count(e_comp_wl->ptr.resources)) return; - wc = wl_resource_get_client(cdata->surface); + wc = wl_resource_get_client(ec->comp_data->surface); serial = wl_display_next_serial(e_comp_wl->wl.disp); EINA_LIST_FOREACH(e_comp_wl->ptr.resources, l, res) { @@ -1115,7 +1068,7 @@ _e_comp_wl_evas_cb_mouse_in(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj _e_comp_wl_device_send_last_event_device(ec, ECORE_DEVICE_CLASS_MOUSE, ev->timestamp); - wl_pointer_send_enter(res, serial, cdata->surface, + wl_pointer_send_enter(res, serial, ec->comp_data->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; @@ -1126,7 +1079,6 @@ static void _e_comp_wl_evas_cb_mouse_out(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event) { E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; Evas_Event_Mouse_Out *ev; struct wl_resource *res; struct wl_client *wc; @@ -1157,8 +1109,8 @@ _e_comp_wl_evas_cb_mouse_out(void *data, Evas *evas EINA_UNUSED, Evas_Object *ob if (e_comp_wl->ptr.ec == ec) e_comp_wl->ptr.ec = NULL; if (e_object_is_del(E_OBJECT(ec))) return; - cdata = e_client_cdata_get(ec); - if (!cdata || !cdata->surface) return; + + if (!ec->comp_data || !ec->comp_data->surface) return; if (e_comp_wl->drag) { @@ -1174,7 +1126,7 @@ _e_comp_wl_evas_cb_mouse_out(void *data, Evas *evas EINA_UNUSED, Evas_Object *ob if (!eina_list_count(e_comp_wl->ptr.resources)) return; - wc = wl_resource_get_client(cdata->surface); + wc = wl_resource_get_client(ec->comp_data->surface); serial = wl_display_next_serial(e_comp_wl->wl.disp); EINA_LIST_FOREACH(e_comp_wl->ptr.resources, l, res) { @@ -1184,7 +1136,7 @@ _e_comp_wl_evas_cb_mouse_out(void *data, Evas *evas EINA_UNUSED, Evas_Object *ob _e_comp_wl_device_send_last_event_device(ec, ECORE_DEVICE_CLASS_MOUSE, ev->timestamp); - wl_pointer_send_leave(res, serial, cdata->surface); + wl_pointer_send_leave(res, serial, ec->comp_data->surface); } ec->pointer_enter_sent = EINA_FALSE; } @@ -1198,14 +1150,12 @@ _e_comp_wl_send_touch(E_Client *ec, int idx, int canvas_x, int canvas_y, uint32_ wl_fixed_t x, y; uint32_t serial; E_Comp_Config *comp_conf = NULL; - E_Comp_Wl_Client_Data *cdata = NULL; if (!ec) return; if (e_object_is_del(E_OBJECT(ec))) return; - cdata = e_client_cdata_get(ec); - if (!cdata || !cdata->surface) return; + if (!ec->comp_data || !ec->comp_data->surface) return; - wc = wl_resource_get_client(cdata->surface); + wc = wl_resource_get_client(ec->comp_data->surface); serial = wl_display_next_serial(e_comp_wl->wl.disp); if (pressed) @@ -1226,7 +1176,7 @@ _e_comp_wl_send_touch(E_Client *ec, int idx, int canvas_x, int canvas_y, uint32_ if (comp_conf && comp_conf->input_log_enable) ELOGF("Touch", "Down (id: %d, time: %d, x:%d, y:%d, name:%20s)", ec, idx, timestamp, canvas_x - ec->client.x, canvas_y - ec->client.y, e_client_util_name_get(ec)); - wl_touch_send_down(res, serial, timestamp, cdata->surface, idx, x, y); //id 0 for the 1st finger + wl_touch_send_down(res, serial, timestamp, ec->comp_data->surface, idx, x, y); //id 0 for the 1st finger } else { @@ -1246,14 +1196,12 @@ _e_comp_wl_send_touch_move(E_Client *ec, int idx, int canvas_x, int canvas_y, ui struct wl_client *wc; struct wl_resource *res; wl_fixed_t x, y; - E_Comp_Wl_Client_Data *cdata = NULL; if (!ec) return; if (e_object_is_del(E_OBJECT(ec))) return; - cdata = e_client_cdata_get(ec); - if (!cdata || !cdata->surface) return; + if (!ec->comp_data || !ec->comp_data->surface) return; - wc = wl_resource_get_client(cdata->surface); + wc = wl_resource_get_client(ec->comp_data->surface); x = wl_fixed_from_int(canvas_x - ec->client.x); y = wl_fixed_from_int(canvas_y - ec->client.y); @@ -1272,14 +1220,12 @@ _e_comp_wl_send_mouse_move(E_Client *ec, int x, int y, unsigned int timestamp) struct wl_resource *res; struct wl_client *wc; Eina_List *l; - E_Comp_Wl_Client_Data *cdata = NULL; if (!ec) return; if (e_object_is_del(E_OBJECT(ec))) return; - cdata = e_client_cdata_get(ec); - if (!cdata || !cdata->surface) return; + if (!ec->comp_data || !ec->comp_data->surface) return; - wc = wl_resource_get_client(cdata->surface); + wc = wl_resource_get_client(ec->comp_data->surface); EINA_LIST_FOREACH(e_comp_wl->ptr.resources, l, res) { if (!e_comp_wl_input_pointer_check(res)) continue; @@ -1318,7 +1264,6 @@ static void _e_comp_wl_evas_cb_mouse_move(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event) { E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; Evas_Event_Mouse_Move *ev; Evas_Device *dev = NULL; const char *dev_name; @@ -1332,8 +1277,7 @@ _e_comp_wl_evas_cb_mouse_move(void *data, Evas *evas EINA_UNUSED, Evas_Object *o if (ec->cur_mouse_action) return; if (e_object_is_del(E_OBJECT(ec))) return; if ((ec->ignored) && (!ec->remote_surface.provider)) return; - cdata = e_client_cdata_get(ec); - if (!cdata || !cdata->surface) return; + if (!ec->comp_data || !ec->comp_data->surface) return; if ((!need_send_motion) && (!need_send_released) && (ec->visibility.obscured == E_VISIBILITY_FULLY_OBSCURED)) return; @@ -1378,12 +1322,9 @@ _e_comp_wl_evas_cb_mouse_move(void *data, Evas *evas EINA_UNUSED, Evas_Object *o 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_Client_Data *cdata = NULL; - if (ec->cur_mouse_action || e_comp_wl->drag) return; if (e_object_is_del(E_OBJECT(ec))) return; - cdata = e_client_cdata_get(ec); - if (!cdata || !cdata->surface) return; + if (!ec->comp_data || !ec->comp_data->surface) return; if ((ec->ignored) && (!ec->remote_surface.provider)) return; e_comp_wl->ptr.button = BTN_LEFT; @@ -1510,7 +1451,6 @@ finish: static void _e_comp_wl_mouse_wheel_send(E_Client *ec, int direction, int z, int timestamp) { - E_Comp_Wl_Client_Data *cdata = NULL; struct wl_resource *res; struct wl_client *wc; Eina_List *l; @@ -1528,10 +1468,9 @@ _e_comp_wl_mouse_wheel_send(E_Client *ec, int direction, int z, int timestamp) if (!ec) return; if (e_object_is_del(E_OBJECT(ec))) return; - cdata = e_client_cdata_get(ec); - if (!cdata || !cdata->surface) return; + if (!ec->comp_data || !ec->comp_data->surface) return; - wc = wl_resource_get_client(cdata->surface); + wc = wl_resource_get_client(ec->comp_data->surface); EINA_LIST_FOREACH(e_comp_wl->ptr.resources, l, res) { if (!e_comp_wl_input_pointer_check(res)) continue; @@ -1544,7 +1483,6 @@ static void _e_comp_wl_evas_cb_mouse_wheel(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event) { E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; Evas_Event_Mouse_Wheel *ev; ev = event; @@ -1553,8 +1491,7 @@ _e_comp_wl_evas_cb_mouse_wheel(void *data, Evas *evas EINA_UNUSED, Evas_Object * if (e_object_is_del(E_OBJECT(ec))) return; if ((ec->ignored) && (!ec->remote_surface.provider)) return; - cdata = e_client_cdata_get(ec); - if (!cdata || !cdata->surface) return; + if (!ec->comp_data || !ec->comp_data->surface) return; if (!eina_list_count(e_comp_wl->ptr.resources)) return; @@ -1568,7 +1505,6 @@ static void _e_comp_wl_evas_cb_multi_down(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj, void *event) { E_Client *ec = data; - E_Comp_Wl_Client_Data *cdata = NULL; Evas_Event_Multi_Down *ev = event; Evas_Device *dev = NULL; const char *dev_name; @@ -1577,8 +1513,7 @@ _e_comp_wl_evas_cb_multi_down(void *data, Evas *evas EINA_UNUSED, Evas_Object *o if (!ec) return; if (e_object_is_del(E_OBJECT(ec))) return; - cdata = e_client_cdata_get(ec); - if (!cdata || !cdata->surface) return; + if (!ec->comp_data || !ec->comp_data->surface) return; /* Do not deliver emulated single touch events to client */ if (ev->device == 0) return; @@ -1606,7 +1541,6 @@ static void _e_comp_wl_evas_cb_multi_up(void *data, Evas *evas, Evas_Object *obj EINA_UNUSED, void *event) { E_Client *ec = data; - E_Comp_Wl_Client_Data *cdata = NULL; Evas_Event_Multi_Up *ev = event; Evas_Device *dev = NULL; const char *dev_name; @@ -1616,8 +1550,7 @@ _e_comp_wl_evas_cb_multi_up(void *data, Evas *evas, Evas_Object *obj EINA_UNUSED if (!ec) return; if (e_object_is_del(E_OBJECT(ec))) return; - cdata = e_client_cdata_get(ec); - if (!cdata || !cdata->surface) return; + if (!ec->comp_data || !ec->comp_data->surface) return; /* Do not deliver emulated single touch events to client */ if (ev->device == 0) return; @@ -1650,7 +1583,6 @@ static void _e_comp_wl_evas_cb_multi_move(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event) { E_Client *ec = data; - E_Comp_Wl_Client_Data *cdata = NULL; Evas_Event_Multi_Move *ev = event; Evas_Device *dev = NULL; const char *dev_name; @@ -1658,8 +1590,7 @@ _e_comp_wl_evas_cb_multi_move(void *data, Evas *evas EINA_UNUSED, Evas_Object *o if (!ec) return; if (e_object_is_del(E_OBJECT(ec))) return; - cdata = e_client_cdata_get(ec); - if (!cdata || !cdata->surface) return; + if (!ec->comp_data || !ec->comp_data->surface) return; /* Do not deliver emulated single touch events to client */ if (ev->device == 0) return; @@ -1749,7 +1680,6 @@ _e_comp_wl_client_priority_normal(E_Client *ec) static Eina_Bool _e_comp_wl_evas_cb_focus_in_timer(E_Client *ec) { - E_Comp_Wl_Client_Data *cdata = NULL; uint32_t serial; E_Comp_Wl_Key_Data *k; struct wl_resource *res; @@ -1758,10 +1688,9 @@ _e_comp_wl_evas_cb_focus_in_timer(E_Client *ec) if (!ec) return EINA_FALSE; if (e_object_is_del(E_OBJECT(ec))) return EINA_FALSE; - cdata = e_client_cdata_get(ec); - if (!cdata) return EINA_FALSE; + if (!ec->comp_data) return EINA_FALSE; - cdata->on_focus_timer = NULL; + ec->comp_data->on_focus_timer = NULL; if (!e_comp_wl->kbd.focused) return EINA_FALSE; serial = wl_display_next_serial(e_comp_wl->wl.disp); @@ -1787,15 +1716,12 @@ EINTERN void e_comp_wl_feed_focus_in(E_Client *ec) { E_Client *focused; - E_Comp_Wl_Client_Data *cdata = NULL; struct wl_resource *res; struct wl_client *wc; Eina_List *l; if (!ec) return; if (e_object_is_del(E_OBJECT(ec))) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; if (ec->iconic) return; /* block spurious focus events */ @@ -1805,7 +1731,7 @@ e_comp_wl_feed_focus_in(E_Client *ec) /* raise client priority */ _e_comp_wl_client_priority_raise(ec); - wc = wl_resource_get_client(cdata->surface); + wc = wl_resource_get_client(ec->comp_data->surface); EINA_LIST_FOREACH(e_comp_wl->kbd.resources, l, res) { @@ -1817,10 +1743,10 @@ e_comp_wl_feed_focus_in(E_Client *ec) } if (!e_comp_wl->kbd.focused) return; - e_comp_wl->kbd.focus = cdata->surface; + e_comp_wl->kbd.focus = ec->comp_data->surface; e_comp_wl_input_keyboard_enter_send(ec); e_comp_wl_data_device_keyboard_focus_set(); - cdata->on_focus_timer = + ec->comp_data->on_focus_timer = 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; @@ -1840,7 +1766,6 @@ static void _e_comp_wl_evas_cb_focus_out(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED) { E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; struct wl_resource *res; uint32_t serial; E_Comp_Wl_Key_Data *k; @@ -1849,10 +1774,9 @@ _e_comp_wl_evas_cb_focus_out(void *data, Evas *evas EINA_UNUSED, Evas_Object *ob if (!(ec = data)) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; + if (!ec->comp_data) return; - E_FREE_FUNC(cdata->on_focus_timer, ecore_timer_del); + E_FREE_FUNC(ec->comp_data->on_focus_timer, ecore_timer_del); /* lower client priority */ if (!e_object_is_del(data)) @@ -1863,7 +1787,7 @@ _e_comp_wl_evas_cb_focus_out(void *data, Evas *evas EINA_UNUSED, Evas_Object *ob wl_array_for_each(k, &e_comp_wl->kbd.keys) e_comp_wl_input_keyboard_state_update(k->key, EINA_FALSE); - if (!cdata->surface) return; + if (!ec->comp_data->surface) return; if (!eina_list_count(e_comp_wl->kbd.resources)) return; @@ -1879,7 +1803,7 @@ _e_comp_wl_evas_cb_focus_out(void *data, Evas *evas EINA_UNUSED, Evas_Object *ob wl_keyboard_send_key(res, serial, t, k->key, WL_KEYBOARD_KEY_STATE_RELEASED); } - wl_keyboard_send_leave(res, serial, cdata->surface); + wl_keyboard_send_leave(res, serial, ec->comp_data->surface); e_comp_wl->kbd.focused = eina_list_remove_list(e_comp_wl->kbd.focused, l); } @@ -1889,13 +1813,11 @@ static void _e_comp_wl_evas_cb_resize(void *data, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED) { E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; if (!(ec = data)) return; + if ((ec->shading) || (ec->shaded)) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; - if (!cdata->shell.configure_send) return; + 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)) @@ -1941,47 +1863,38 @@ _e_comp_wl_evas_cb_resize(void *data, Evas_Object *obj EINA_UNUSED, void *event } x = E_CLAMP(x, 1, x); y = E_CLAMP(y, 1, y); - cdata->shell.configure_send(cdata->shell.surface, + ec->comp_data->shell.configure_send(ec->comp_data->shell.surface, e_comp_wl->resize.edges, x, y); } else if ((!ec->fullscreen) && (!ec->maximized) && - (!cdata->maximize_pre)) + (!ec->comp_data->maximize_pre)) _e_comp_wl_configure_send(ec, 1, 1); - if (cdata->sub.below_obj) - evas_object_resize(cdata->sub.below_obj, ec->w, ec->h); + if (ec->comp_data->sub.below_obj) + evas_object_resize(ec->comp_data->sub.below_obj, ec->w, ec->h); } static void _e_comp_wl_evas_cb_state_update(void *data, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED) { E_Client *ec = data; - E_Comp_Wl_Client_Data *cdata = NULL; if (e_object_is_del(E_OBJECT(ec))) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; /* check for wayland pixmap */ - if (cdata->shell.configure_send) + if (ec->comp_data->shell.configure_send) _e_comp_wl_configure_send(ec, 0, 0); - cdata->maximize_pre = 0; + ec->comp_data->maximize_pre = 0; } static void _e_comp_wl_evas_cb_maximize_pre(void *data, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED) { E_Client *ec = data; - E_Comp_Wl_Client_Data *cdata = NULL; - if (!ec) return; - if (e_object_is_del(E_OBJECT(ec))) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; - - cdata->maximize_pre = 1; + ec->comp_data->maximize_pre = 1; } static void @@ -2004,17 +1917,14 @@ _e_comp_wl_evas_cb_delete_request(void *data, Evas_Object *obj EINA_UNUSED, void static void _e_comp_wl_evas_cb_kill_request(void *data, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED) { - E_Client *ec = data; - E_Comp_Wl_Client_Data *cdata = NULL; + E_Client *ec; - if (!ec) return; + if (!(ec = data)) return; e_comp_ignore_win_del(E_PIXMAP_TYPE_WL, e_pixmap_window_get(ec->pixmap)); - - cdata = e_client_cdata_get(ec); - if (cdata) + if (ec->comp_data) { - if (cdata->reparented) + if (ec->comp_data->reparented) e_client_comp_hidden_set(ec, EINA_TRUE); } @@ -2028,16 +1938,14 @@ _e_comp_wl_evas_cb_kill_request(void *data, Evas_Object *obj EINA_UNUSED, void * static void _e_comp_wl_evas_cb_ping(void *data, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED) { - E_Client *ec = data; - E_Comp_Wl_Client_Data *cdata = NULL; + E_Client *ec; - if (!ec) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; - if (!cdata->shell.ping) return; - if (!cdata->shell.surface) return; + if (!(ec = data)) return; + if (!(ec->comp_data)) return; + if (!(ec->comp_data->shell.ping)) return; + if (!(ec->comp_data->shell.surface)) return; - cdata->shell.ping(cdata->shell.surface); + ec->comp_data->shell.ping(ec->comp_data->shell.surface); } static void @@ -2132,12 +2040,8 @@ _e_comp_wl_buffer_damage_set(E_Comp_Wl_Buffer *buffer, Eina_List *buffer_damages static void _e_comp_wl_client_evas_init(E_Client *ec) { - E_Comp_Wl_Client_Data *cdata = NULL; - - if (!ec) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; - if (cdata->evas_init) return; + if (!ec || !ec->comp_data) return; + if (ec->comp_data->evas_init) return; /* Workaround: * Updating stack order of subsurface has to be done for safety, because @@ -2187,7 +2091,7 @@ _e_comp_wl_client_evas_init(E_Client *ec) evas_object_smart_callback_add(ec->frame, "ping", _e_comp_wl_evas_cb_ping, ec); evas_object_smart_callback_add(ec->frame, "color_set", _e_comp_wl_evas_cb_color_set, ec); - cdata->evas_init = EINA_TRUE; + ec->comp_data->evas_init = EINA_TRUE; } static Eina_Bool @@ -2243,7 +2147,6 @@ static Eina_Bool _e_comp_wl_cb_comp_object_add(void *data EINA_UNUSED, int type EINA_UNUSED, E_Event_Comp_Object *ev) { E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; /* try to get the client from the object */ if (!(ec = e_comp_object_client_get(ev->comp_object))) @@ -2257,8 +2160,7 @@ _e_comp_wl_cb_comp_object_add(void *data EINA_UNUSED, int type EINA_UNUSED, E_Ev return ECORE_CALLBACK_RENEW; /* if we have not setup evas callbacks for this client, do it */ - cdata = e_client_cdata_get(ec); - if (!cdata->evas_init) _e_comp_wl_client_evas_init(ec); + if (!ec->comp_data->evas_init) _e_comp_wl_client_evas_init(ec); return ECORE_CALLBACK_RENEW; } @@ -2271,11 +2173,10 @@ _e_comp_wl_cb_mouse_move(void *d EINA_UNUSED, int t EINA_UNUSED, Ecore_Event_Mou if (e_comp_wl->selection.target && e_comp_wl->drag) { - E_Comp_Wl_Client_Data *selection_target_cdata = e_client_cdata_get(e_comp_wl->selection.target); struct wl_resource *res; int x, y; - res = e_comp_wl_data_find_for_client(wl_resource_get_client(selection_target_cdata->surface)); + res = e_comp_wl_data_find_for_client(wl_resource_get_client(e_comp_wl->selection.target->comp_data->surface)); EINA_SAFETY_ON_NULL_RETURN_VAL(res, ECORE_CALLBACK_RENEW); x = ev->x - e_comp_wl->selection.target->client.x; @@ -2310,17 +2211,15 @@ static Eina_Bool _e_comp_wl_cb_client_rot_change_begin(void *d EINA_UNUSED, int t EINA_UNUSED, E_Event_Client_Rotation_Change_Begin *ev) { E_Client *ec = ev->ec; - E_Comp_Wl_Client_Data *cdata = NULL; E_Comp_Wl_Buffer_Viewport *vp; if (!ec) return ECORE_CALLBACK_PASS_ON; if (e_object_is_del(E_OBJECT(ec))) return ECORE_CALLBACK_PASS_ON; - cdata = e_client_cdata_get(ec); - if (!cdata) return ECORE_CALLBACK_PASS_ON; - if (cdata->sub.data) return ECORE_CALLBACK_PASS_ON; + if (!ec->comp_data) return ECORE_CALLBACK_PASS_ON; + if (ec->comp_data->sub.data) return ECORE_CALLBACK_PASS_ON; if (ec->e.state.rot.ang.next < 0) return ECORE_CALLBACK_PASS_ON; - vp = &cdata->scaler.buffer_viewport; + vp = &ec->comp_data->scaler.buffer_viewport; vp->wait_for_transform_change = ((360 + ec->e.state.rot.ang.next - ec->e.state.rot.ang.curr) % 360) / 90; DBG("ec(%p) wait_for_transform_change(%d)", ec, vp->wait_for_transform_change); @@ -2332,16 +2231,14 @@ static Eina_Bool _e_comp_wl_cb_client_rot_change_cancel(void *d EINA_UNUSED, int t EINA_UNUSED, E_Event_Client_Rotation_Change_Cancel *ev) { E_Client *ec = ev->ec; - E_Comp_Wl_Client_Data *cdata = NULL; E_Comp_Wl_Buffer_Viewport *vp; if (!ec) return ECORE_CALLBACK_PASS_ON; if (e_object_is_del(E_OBJECT(ec))) return ECORE_CALLBACK_PASS_ON; - cdata = e_client_cdata_get(ec); - if (!cdata) return ECORE_CALLBACK_PASS_ON; - if (cdata->sub.data) return ECORE_CALLBACK_PASS_ON; + if (!ec->comp_data) return ECORE_CALLBACK_PASS_ON; + if (ec->comp_data->sub.data) return ECORE_CALLBACK_PASS_ON; - vp = &cdata->scaler.buffer_viewport; + vp = &ec->comp_data->scaler.buffer_viewport; vp->wait_for_transform_change = 0; DBG("ec(%p) wait_for_transform_change(%d) reset", ec, vp->wait_for_transform_change); @@ -2368,7 +2265,6 @@ _e_comp_wl_cb_client_rot_change_end(void *d EINA_UNUSED, int t EINA_UNUSED, E_Ev static void _e_comp_wl_surface_state_size_update(E_Client *ec, E_Comp_Wl_Surface_State *state) { - E_Comp_Wl_Client_Data *cdata = NULL; int prev_w, prev_h; Eina_Rectangle *window; @@ -2384,8 +2280,7 @@ _e_comp_wl_surface_state_size_update(E_Client *ec, E_Comp_Wl_Surface_State *stat } if (e_comp_object_frame_exists(ec->frame)) return; - cdata = e_client_cdata_get(ec); - window = &cdata->shell.window; + window = &ec->comp_data->shell.window; if ((!ec->borderless) && /* FIXME temporarily added this check code * to prevent updating E_Client's size by frame */ (window->x || window->y || window->w || window->h)) @@ -2484,13 +2379,12 @@ _e_comp_wl_surface_state_commit(E_Client *ec, E_Comp_Wl_Surface_State *state) E_Comp_Wl_Buffer *buffer; struct wl_resource *cb; Eina_List *l, *ll; - E_Comp_Wl_Client_Data *cdata = e_client_cdata_get(ec); - E_Comp_Wl_Buffer_Viewport *vp = &cdata->scaler.buffer_viewport; + E_Comp_Wl_Buffer_Viewport *vp = &ec->comp_data->scaler.buffer_viewport; if (ec->ignored) { if ((ec->internal) || - (cdata->shell.surface && state->new_attach)) + (ec->comp_data->shell.surface && state->new_attach)) { EC_CHANGED(ec); ec->new_client = 1; @@ -2529,7 +2423,7 @@ _e_comp_wl_surface_state_commit(E_Client *ec, E_Comp_Wl_Surface_State *state) } } - cdata->scaler.buffer_viewport = state->buffer_viewport; + ec->comp_data->scaler.buffer_viewport = state->buffer_viewport; if (state->new_attach) { @@ -2538,8 +2432,8 @@ _e_comp_wl_surface_state_commit(E_Client *ec, E_Comp_Wl_Surface_State *state) } /* emit a apply_viewport signal when the information of viewport and buffer is ready */ - wl_signal_emit(&cdata->apply_viewport_signal, - &cdata->surface); + wl_signal_emit(&ec->comp_data->apply_viewport_signal, + &ec->comp_data->surface); _e_comp_wl_surface_state_buffer_set(state, NULL); @@ -2595,10 +2489,10 @@ _e_comp_wl_surface_state_commit(E_Client *ec, E_Comp_Wl_Surface_State *state) if (!e_pixmap_usable_get(ec->pixmap)) { /* unmap ec */ - if (cdata->mapped) + if (ec->comp_data->mapped) { - if ((cdata->shell.surface) && - (cdata->shell.unmap)) + if ((ec->comp_data->shell.surface) && + (ec->comp_data->shell.unmap)) { ELOGF("COMP", "Try to unmap. Call shell.unmap.", ec); if (ec->show_pending.count > 0) @@ -2614,37 +2508,37 @@ _e_comp_wl_surface_state_commit(E_Client *ec, E_Comp_Wl_Surface_State *state) } ec->show_pending.running = EINA_FALSE; } - cdata->shell.unmap(cdata->shell.surface); + ec->comp_data->shell.unmap(ec->comp_data->shell.surface); } else if ((ec->internal) || - (cdata->sub.data) || + (ec->comp_data->sub.data) || (ec == e_comp_wl->drag_client)) { ELOGF("COMP", "Try to unmap. Hide window. internal:%d, sub:%p, drag:%d", - ec, ec->internal, cdata->sub.data, (ec == e_comp_wl->drag_client)); + ec, ec->internal, ec->comp_data->sub.data, (ec == e_comp_wl->drag_client)); ec->visible = EINA_FALSE; evas_object_hide(ec->frame); - cdata->mapped = 0; + ec->comp_data->mapped = 0; } } - if ((cdata->sub.below_obj) && - (evas_object_visible_get(cdata->sub.below_obj))) + if ((ec->comp_data->sub.below_obj) && + (evas_object_visible_get(ec->comp_data->sub.below_obj))) { - evas_object_hide(cdata->sub.below_obj); + evas_object_hide(ec->comp_data->sub.below_obj); } } else { /* map ec */ - if (!cdata->mapped) + if (!ec->comp_data->mapped) { - if ((cdata->shell.surface) && - (cdata->shell.map) && + if ((ec->comp_data->shell.surface) && + (ec->comp_data->shell.map) && (!ec->ignored)) { ELOGF("COMP", "Try to map. Call shell.map.", ec); - cdata->shell.map(cdata->shell.surface); + ec->comp_data->shell.map(ec->comp_data->shell.surface); } else if ((ec->internal) || (e_comp_wl_subsurface_can_show(ec)) || @@ -2655,23 +2549,23 @@ _e_comp_wl_surface_state_commit(E_Client *ec, E_Comp_Wl_Surface_State *state) ec->visible = EINA_TRUE; ec->ignored = 0; evas_object_show(ec->frame); - cdata->mapped = 1; + ec->comp_data->mapped = 1; } } - if ((cdata->sub.below_obj) && - (!evas_object_visible_get(cdata->sub.below_obj)) && + if ((ec->comp_data->sub.below_obj) && + (!evas_object_visible_get(ec->comp_data->sub.below_obj)) && (evas_object_visible_get(ec->frame))) { - evas_object_show(cdata->sub.below_obj); + evas_object_show(ec->comp_data->sub.below_obj); } } if ((state->new_attach) || (state->buffer_viewport.changed)) { - if ((cdata->shell.surface) && - (cdata->shell.configure)) + if ((ec->comp_data->shell.surface) && + (ec->comp_data->shell.configure)) { e_comp_wl_commit_sync_configure(ec); } @@ -2704,7 +2598,7 @@ _e_comp_wl_surface_state_commit(E_Client *ec, E_Comp_Wl_Surface_State *state) } } - if (cdata->scaler.buffer_viewport.changed) + if (ec->comp_data->scaler.buffer_viewport.changed) { if (e_comp_wl->touch.pressed && !e_policy_client_is_keyboard_sub(ec)) e_comp_wl_touch_cancel(); @@ -2720,19 +2614,20 @@ _e_comp_wl_surface_state_commit(E_Client *ec, E_Comp_Wl_Surface_State *state) state->sy = 0; state->new_attach = EINA_FALSE; - EINA_LIST_FOREACH_SAFE(cdata->frames, l, ll, cb) + EINA_LIST_FOREACH_SAFE(ec->comp_data->frames, l, ll, cb) { wl_callback_send_done(cb, (unsigned int)(ecore_loop_time_get() * 1000)); wl_resource_destroy(cb); } - /* insert state frame callbacks into cdata->frames + /* insert state frame callbacks into comp_data->frames * NB: This clears state->frames list */ - cdata->frames = eina_list_merge(cdata->frames, state->frames); + ec->comp_data->frames = eina_list_merge(ec->comp_data->frames, + state->frames); state->frames = NULL; - e_presentation_time_container_feedback_discard(&cdata->presentation_container); - e_presentation_time_container_feedback_merge(&cdata->presentation_container, + e_presentation_time_container_feedback_discard(&ec->comp_data->presentation_container); + e_presentation_time_container_feedback_merge(&ec->comp_data->presentation_container, &state->presentation_container); buffer = e_pixmap_resource_get(ec->pixmap); @@ -2743,14 +2638,14 @@ _e_comp_wl_surface_state_commit(E_Client *ec, E_Comp_Wl_Surface_State *state) /* FIXME: workaround for bad wayland egl driver which doesn't send damage request */ if (!eina_list_count(state->damages) && !eina_list_count(state->buffer_damages)) { - if ((cdata->buffer_ref.buffer) && - ((cdata->buffer_ref.buffer->type == E_COMP_WL_BUFFER_TYPE_NATIVE) || - (cdata->buffer_ref.buffer->type == E_COMP_WL_BUFFER_TYPE_TBM))) + if ((ec->comp_data->buffer_ref.buffer) && + ((ec->comp_data->buffer_ref.buffer->type == E_COMP_WL_BUFFER_TYPE_NATIVE) || + (ec->comp_data->buffer_ref.buffer->type == E_COMP_WL_BUFFER_TYPE_TBM))) { e_comp_object_damage(ec->frame, 0, 0, - cdata->buffer_ref.buffer->w, - cdata->buffer_ref.buffer->h); + ec->comp_data->buffer_ref.buffer->w, + ec->comp_data->buffer_ref.buffer->h); } } else @@ -2859,7 +2754,7 @@ _e_comp_wl_surface_state_commit(E_Client *ec, E_Comp_Wl_Surface_State *state) e_comp_wl_subsurface_check_below_bg_rectangle(ec); - if ((cdata->video_client) && + if ((ec->comp_data->video_client) && ((buffer) && (buffer->type == E_COMP_WL_BUFFER_TYPE_VIDEO)) && (e_comp->wl_comp_data->available_hw_accel.underlay)) @@ -2888,13 +2783,10 @@ static void _e_comp_wl_surface_cb_attach(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, struct wl_resource *buffer_resource, int32_t sx, int32_t sy) { E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; E_Comp_Wl_Buffer *buffer = NULL; if (!(ec = wl_resource_get_user_data(resource))) return; if (e_object_is_del(E_OBJECT(ec))) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; if (buffer_resource) { @@ -2906,10 +2798,10 @@ _e_comp_wl_surface_cb_attach(struct wl_client *client EINA_UNUSED, struct wl_res } } - if (!cdata->mapped) + if (!ec->comp_data->mapped) { - if (cdata->shell.surface && - !ec->internal && !cdata->sub.data && !ec->remote_surface.provider) + if (ec->comp_data->shell.surface && + !ec->internal && !ec->comp_data->sub.data && !ec->remote_surface.provider) { ELOGF("COMP", "Current unmapped. ATTACH buffer:%p", ec, buffer); } @@ -2917,42 +2809,39 @@ _e_comp_wl_surface_cb_attach(struct wl_client *client EINA_UNUSED, struct wl_res if (!buffer) { - if (cdata->mapped) + if (ec->comp_data->mapped) { /* will be unmapped. so run capture */ e_comp_wl_remote_surface_image_save(ec); } } - _e_comp_wl_surface_state_buffer_set(&cdata->pending, buffer); + _e_comp_wl_surface_state_buffer_set(&ec->comp_data->pending, buffer); - cdata->pending.sx = sx; - cdata->pending.sy = sy; - cdata->pending.new_attach = EINA_TRUE; + ec->comp_data->pending.sx = sx; + ec->comp_data->pending.sy = sy; + ec->comp_data->pending.new_attach = EINA_TRUE; } static void _e_comp_wl_surface_cb_damage(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, int32_t x, int32_t y, int32_t w, int32_t h) { E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; Eina_Rectangle *dmg = NULL; if (!(ec = wl_resource_get_user_data(resource))) return; if (e_object_is_del(E_OBJECT(ec))) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; if (!(dmg = eina_rectangle_new(x, y, w, h))) return; - cdata->pending.damages = eina_list_append(cdata->pending.damages, dmg); + ec->comp_data->pending.damages = + eina_list_append(ec->comp_data->pending.damages, dmg); } static void _e_comp_wl_frame_cb_destroy(struct wl_resource *resource) { E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; E_Comp_Wl_Subsurf_Data *sdata; if (!(ec = wl_resource_get_user_data(resource))) return; @@ -2961,16 +2850,21 @@ _e_comp_wl_frame_cb_destroy(struct wl_resource *resource) if (!e_object_delay_del_ref_get(E_OBJECT(ec))) return; } - cdata = e_client_cdata_get(ec); - if (!cdata) return; + if (!ec->comp_data) return; - if (cdata->frames) - cdata->frames = eina_list_remove(cdata->frames, resource); + if (ec->comp_data->frames) + { + ec->comp_data->frames = + eina_list_remove(ec->comp_data->frames, resource); + } - if (cdata->pending.frames) - cdata->pending.frames = eina_list_remove(cdata->pending.frames, resource); + if (ec->comp_data->pending.frames) + { + ec->comp_data->pending.frames = + eina_list_remove(ec->comp_data->pending.frames, resource); + } - sdata = cdata->sub.data; + sdata = ec->comp_data->sub.data; if ((sdata) && (sdata->cached.frames)) { sdata->cached.frames = @@ -2982,13 +2876,10 @@ static void _e_comp_wl_surface_cb_frame(struct wl_client *client, struct wl_resource *resource, uint32_t callback) { E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; struct wl_resource *res; if (!(ec = wl_resource_get_user_data(resource))) return; if (e_object_is_del(E_OBJECT(ec))) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; /* create frame callback */ if (!(res = @@ -3000,22 +2891,20 @@ _e_comp_wl_surface_cb_frame(struct wl_client *client, struct wl_resource *resour wl_resource_set_implementation(res, NULL, ec, _e_comp_wl_frame_cb_destroy); - cdata->pending.frames = eina_list_prepend(cdata->pending.frames, res); + ec->comp_data->pending.frames = + eina_list_prepend(ec->comp_data->pending.frames, res); } static void _e_comp_wl_surface_cb_opaque_region_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, struct wl_resource *region_resource) { E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; if (!(ec = wl_resource_get_user_data(resource))) return; if (e_object_is_del(E_OBJECT(ec))) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; - if (cdata->pending.opaque) - eina_tiler_clear(cdata->pending.opaque); + if (ec->comp_data->pending.opaque) + eina_tiler_clear(ec->comp_data->pending.opaque); if (region_resource) { Eina_Tiler *tmp; @@ -3023,9 +2912,9 @@ _e_comp_wl_surface_cb_opaque_region_set(struct wl_client *client EINA_UNUSED, st if (!(tmp = wl_resource_get_user_data(region_resource))) return; - eina_tiler_union(cdata->pending.opaque, tmp); + eina_tiler_union(ec->comp_data->pending.opaque, tmp); - if (!eina_tiler_empty(cdata->pending.opaque)) + if (!eina_tiler_empty(ec->comp_data->pending.opaque)) { if (ec->argb) { @@ -3052,15 +2941,12 @@ static void _e_comp_wl_surface_cb_input_region_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, struct wl_resource *region_resource) { E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; if (!(ec = wl_resource_get_user_data(resource))) return; if (e_object_is_del(E_OBJECT(ec))) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; - if (cdata->pending.input) - eina_tiler_clear(cdata->pending.input); + if (ec->comp_data->pending.input) + eina_tiler_clear(ec->comp_data->pending.input); if (region_resource) { Eina_Tiler *tmp; @@ -3075,11 +2961,11 @@ _e_comp_wl_surface_cb_input_region_set(struct wl_client *client EINA_UNUSED, str e_comp_object_input_area_set(ec->frame, -1, -1, 1, 1); } else - eina_tiler_union(cdata->pending.input, tmp); + eina_tiler_union(ec->comp_data->pending.input, tmp); } else { - eina_tiler_rect_add(cdata->pending.input, + eina_tiler_rect_add(ec->comp_data->pending.input, &(Eina_Rectangle){0, 0, ec->client.w, ec->client.h}); } } @@ -3088,22 +2974,19 @@ static void _e_comp_wl_surface_cb_commit(struct wl_client *client EINA_UNUSED, struct wl_resource *resource) { E_Client *ec, *subc; - E_Comp_Wl_Client_Data *cdata = NULL; Eina_List *l; E_Comp_Config *comp_conf = NULL; if (!(ec = wl_resource_get_user_data(resource))) return; if (e_object_is_del(E_OBJECT(ec))) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; - if (!cdata->first_commit) - cdata->first_commit = EINA_TRUE; + if (!ec->comp_data->first_commit) + ec->comp_data->first_commit = EINA_TRUE; - if (!cdata->mapped) + if (!ec->comp_data->mapped) { - if (cdata->shell.surface && cdata->pending.new_attach && - !ec->internal && !cdata->sub.data && !ec->remote_surface.provider) + if (ec->comp_data->shell.surface && ec->comp_data->pending.new_attach && + !ec->internal && !ec->comp_data->sub.data && !ec->remote_surface.provider) { ELOGF("COMP", "Current unmapped. COMMIT. pixmap_usable:%d", ec, e_pixmap_usable_get(ec->pixmap)); @@ -3122,13 +3005,13 @@ _e_comp_wl_surface_cb_commit(struct wl_client *client EINA_UNUSED, struct wl_res e_comp_wl_surface_commit(ec); - EINA_LIST_FOREACH(cdata->sub.list, l, subc) + EINA_LIST_FOREACH(ec->comp_data->sub.list, l, subc) { if (ec != subc) e_comp_wl_subsurface_parent_commit(subc, EINA_FALSE); } - EINA_LIST_FOREACH(cdata->sub.below_list, l, subc) + EINA_LIST_FOREACH(ec->comp_data->sub.below_list, l, subc) { if (ec != subc) e_comp_wl_subsurface_parent_commit(subc, EINA_FALSE); @@ -3139,12 +3022,9 @@ static void _e_comp_wl_surface_cb_buffer_transform_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, int32_t transform) { E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; if (!(ec = wl_resource_get_user_data(resource))) return; if (e_object_is_del(E_OBJECT(ec))) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; if (transform < 0 || transform > WL_OUTPUT_TRANSFORM_FLIPPED_270) { @@ -3155,20 +3035,17 @@ _e_comp_wl_surface_cb_buffer_transform_set(struct wl_client *client EINA_UNUSED, return; } - cdata->pending.buffer_viewport.buffer.transform = transform; - cdata->pending.buffer_viewport.changed = 1; + ec->comp_data->pending.buffer_viewport.buffer.transform = transform; + ec->comp_data->pending.buffer_viewport.changed = 1; } static void _e_comp_wl_surface_cb_buffer_scale_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, int32_t scale) { E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; if (!(ec = wl_resource_get_user_data(resource))) return; if (e_object_is_del(E_OBJECT(ec))) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; if (scale < 1) { @@ -3179,25 +3056,23 @@ _e_comp_wl_surface_cb_buffer_scale_set(struct wl_client *client EINA_UNUSED, str return; } - cdata->pending.buffer_viewport.buffer.scale = scale; - cdata->pending.buffer_viewport.changed = 1; + ec->comp_data->pending.buffer_viewport.buffer.scale = scale; + ec->comp_data->pending.buffer_viewport.changed = 1; } static void _e_comp_wl_surface_cb_damage_buffer(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, int32_t x, int32_t y, int32_t w, int32_t h) { E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; Eina_Rectangle *dmg = NULL; if (!(ec = wl_resource_get_user_data(resource))) return; if (e_object_is_del(E_OBJECT(ec))) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; if (!(dmg = eina_rectangle_new(x, y, w, h))) return; - cdata->pending.buffer_damages = eina_list_append(cdata->pending.buffer_damages, dmg); + ec->comp_data->pending.buffer_damages = + eina_list_append(ec->comp_data->pending.buffer_damages, dmg); } static const struct wl_surface_interface _e_surface_interface = @@ -3233,27 +3108,24 @@ static void _e_comp_wl_surface_destroy(struct wl_resource *resource) { E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; struct wl_resource *res; Eina_List *l, *ll; if (!(ec = wl_resource_get_user_data(resource))) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; if (ec == e_client_focused_get()) { EINA_LIST_FOREACH_SAFE(e_comp_wl->kbd.focused, l, ll, res) { if (wl_resource_get_client(res) == - wl_resource_get_client(cdata->surface)) + wl_resource_get_client(ec->comp_data->surface)) e_comp_wl->kbd.focused = eina_list_remove_list(e_comp_wl->kbd.focused, l); } } - cdata->surface = NULL; - cdata->wl_surface = NULL; + ec->comp_data->surface = NULL; + ec->comp_data->wl_surface = NULL; e_pixmap_win_id_del(ec->pixmap); _e_comp_wl_surface_render_stop(ec); @@ -3331,7 +3203,6 @@ _e_comp_wl_compositor_cb_surface_create(struct wl_client *client, struct wl_reso } if (ec) { - E_Comp_Wl_Client_Data *cdata = e_client_cdata_get(ec); if (!ec->netwm.pid) ec->netwm.pid = pid; if (ec->new_client) @@ -3339,7 +3210,7 @@ _e_comp_wl_compositor_cb_surface_create(struct wl_client *client, struct wl_reso ec->new_client = 0; if ((!ec->client.w) && (ec->client.h)) ec->client.w = ec->client.h = 1; - cdata->surface = res; + ec->comp_data->surface = res; ec->icccm.accepts_focus = 1; } @@ -3626,7 +3497,6 @@ static void _e_comp_wl_client_cb_new(void *data EINA_UNUSED, E_Client *ec) { Ecore_Window win; - E_Comp_Wl_Client_Data *cdata = NULL; /* make sure this is a wayland client */ if (e_pixmap_type_get(ec->pixmap) != E_PIXMAP_TYPE_WL) return; @@ -3645,18 +3515,17 @@ _e_comp_wl_client_cb_new(void *data EINA_UNUSED, E_Client *ec) return; } - if (!(cdata = E_NEW(E_Comp_Wl_Client_Data, 1))) + if (!(ec->comp_data = E_NEW(E_Comp_Client_Data, 1))) { ERR("Could not allocate new client data structure"); TRACE_DS_END(); return; } - ec->comp_data = cdata; - wl_signal_init(&cdata->destroy_signal); - wl_signal_init(&cdata->apply_viewport_signal); + wl_signal_init(&ec->comp_data->destroy_signal); + wl_signal_init(&ec->comp_data->apply_viewport_signal); - _e_comp_wl_surface_state_init(&cdata->pending, ec->w, ec->h); + _e_comp_wl_surface_state_init(&ec->comp_data->pending, ec->w, ec->h); /* set initial client properties */ ec->argb = EINA_FALSE; @@ -3671,23 +3540,23 @@ _e_comp_wl_client_cb_new(void *data EINA_UNUSED, E_Client *ec) ec->icccm.delete_request = EINA_TRUE; /* set initial client data properties */ - cdata->mapped = EINA_FALSE; - cdata->first_damage = ec->internal; + ec->comp_data->mapped = EINA_FALSE; + ec->comp_data->first_damage = ec->internal; - cdata->need_reparent = !ec->internal; + ec->comp_data->need_reparent = !ec->internal; /* set initial value of scaler */ - cdata->scaler.buffer_viewport.buffer.transform = WL_OUTPUT_TRANSFORM_NORMAL; - cdata->scaler.buffer_viewport.buffer.scale = 1; - cdata->scaler.buffer_viewport.buffer.src_width = wl_fixed_from_int(-1); - cdata->scaler.buffer_viewport.surface.width = -1; + ec->comp_data->scaler.buffer_viewport.buffer.transform = WL_OUTPUT_TRANSFORM_NORMAL; + ec->comp_data->scaler.buffer_viewport.buffer.scale = 1; + ec->comp_data->scaler.buffer_viewport.buffer.src_width = wl_fixed_from_int(-1); + ec->comp_data->scaler.buffer_viewport.surface.width = -1; - e_presentation_time_container_init(&cdata->presentation_container); + e_presentation_time_container_init(&ec->comp_data->presentation_container); - E_Comp_Wl_Client_Data *p_cdata = e_pixmap_cdata_get(ec->pixmap); + E_Comp_Client_Data *p_cdata = e_pixmap_cdata_get(ec->pixmap); EINA_SAFETY_ON_NULL_GOTO(p_cdata, end); - e_pixmap_cdata_set(ec->pixmap, cdata); + e_pixmap_cdata_set(ec->pixmap, ec->comp_data); end: TRACE_DS_END(); @@ -3696,7 +3565,7 @@ end: static void _e_comp_wl_client_cb_del(void *data EINA_UNUSED, E_Client *ec) { - E_Comp_Wl_Client_Data *cdata = NULL; + /* Eina_Rectangle *dmg; */ struct wl_resource *cb; /* make sure this is a wayland client */ @@ -3704,19 +3573,18 @@ _e_comp_wl_client_cb_del(void *data EINA_UNUSED, E_Client *ec) TRACE_DS_BEGIN(COMP_WL:CLIENT DEL CB); - cdata = e_client_cdata_get(ec); - if ((!ec->already_unparented) && (cdata->reparented)) + if ((!ec->already_unparented) && (ec->comp_data->reparented)) _e_comp_wl_focus_down_set(ec); ec->already_unparented = EINA_TRUE; - if (cdata->reparented) + if (ec->comp_data->reparented) { /* reset pixmap parent window */ e_pixmap_parent_window_set(ec->pixmap, 0); } - if (cdata->sub.watcher) - wl_resource_destroy(cdata->sub.watcher); + if (ec->comp_data->sub.watcher) + wl_resource_destroy(ec->comp_data->sub.watcher); if ((ec->parent) && (ec->parent->modal == ec)) { @@ -3724,29 +3592,29 @@ _e_comp_wl_client_cb_del(void *data EINA_UNUSED, E_Client *ec) ec->parent->modal = NULL; } - wl_signal_emit(&cdata->destroy_signal, &cdata->surface); + wl_signal_emit(&ec->comp_data->destroy_signal, &ec->comp_data->surface); - _e_comp_wl_surface_state_finish(&cdata->pending); + _e_comp_wl_surface_state_finish(&ec->comp_data->pending); - e_comp_wl_buffer_reference(&cdata->buffer_ref, NULL); + e_comp_wl_buffer_reference(&ec->comp_data->buffer_ref, NULL); - EINA_LIST_FREE(cdata->frames, cb) + EINA_LIST_FREE(ec->comp_data->frames, cb) wl_resource_destroy(cb); - EINA_LIST_FREE(cdata->pending.frames, cb) + EINA_LIST_FREE(ec->comp_data->pending.frames, cb) wl_resource_destroy(cb); - if (cdata->surface) - wl_resource_set_user_data(cdata->surface, NULL); + if (ec->comp_data->surface) + wl_resource_set_user_data(ec->comp_data->surface, NULL); if (ec->internal_elm_win) _e_comp_wl_surface_render_stop(ec); _e_comp_wl_focus_check(); - if (cdata->aux_hint.hints) + if (ec->comp_data->aux_hint.hints) { E_Comp_Wl_Aux_Hint *hint; - EINA_LIST_FREE(cdata->aux_hint.hints, hint) + EINA_LIST_FREE(ec->comp_data->aux_hint.hints, hint) { eina_stringshare_del(hint->hint); eina_stringshare_del(hint->val); @@ -3760,24 +3628,23 @@ _e_comp_wl_client_cb_del(void *data EINA_UNUSED, E_Client *ec) cursor_timer_ec = NULL; } - if (e_comp_wl->selection.cbhm == cdata->surface) + if (e_comp_wl->selection.cbhm == ec->comp_data->surface) e_comp_wl->selection.cbhm = NULL; - if (cdata->viewport_transform) + if (ec->comp_data->viewport_transform) { - e_client_transform_core_remove(ec, cdata->viewport_transform); - e_util_transform_del(cdata->viewport_transform); - cdata->viewport_transform = NULL; + e_client_transform_core_remove(ec, ec->comp_data->viewport_transform); + e_util_transform_del(ec->comp_data->viewport_transform); + ec->comp_data->viewport_transform = NULL; } - e_presentation_time_container_finish(&cdata->presentation_container); + e_presentation_time_container_finish(&ec->comp_data->presentation_container); e_pixmap_cdata_set(ec->pixmap, NULL); - E_FREE_FUNC(cdata->on_focus_timer, ecore_timer_del); + E_FREE_FUNC(ec->comp_data->on_focus_timer, ecore_timer_del); - E_FREE(cdata); - ec->comp_data = NULL; + E_FREE(ec->comp_data); _e_comp_wl_focus_check(); @@ -3787,37 +3654,33 @@ _e_comp_wl_client_cb_del(void *data EINA_UNUSED, E_Client *ec) static void _e_comp_wl_client_cb_focus_set(void *data EINA_UNUSED, E_Client *ec) { - E_Comp_Wl_Client_Data *cdata = e_client_cdata_get(ec); - if (!cdata) return; if (e_pixmap_type_get(ec->pixmap) != E_PIXMAP_TYPE_WL) return; /* send configure */ - if (cdata->shell.configure_send) + if (ec->comp_data->shell.configure_send) { - if (cdata->shell.surface) + if (ec->comp_data->shell.surface) _e_comp_wl_configure_send(ec, 0, 0); } - e_comp_wl->kbd.focus = cdata->surface; + e_comp_wl->kbd.focus = ec->comp_data->surface; } static void _e_comp_wl_client_cb_focus_unset(void *data EINA_UNUSED, E_Client *ec) { - E_Comp_Wl_Client_Data *cdata = e_client_cdata_get(ec); - if (!cdata) return; if (e_pixmap_type_get(ec->pixmap) != E_PIXMAP_TYPE_WL) return; /* send configure */ - if (cdata->shell.configure_send) + if (ec->comp_data->shell.configure_send) { - if (cdata->shell.surface) + if (ec->comp_data->shell.surface) _e_comp_wl_configure_send(ec, 0, 0); } _e_comp_wl_focus_check(); - if (e_comp_wl->kbd.focus == cdata->surface) + if (e_comp_wl->kbd.focus == ec->comp_data->surface) e_comp_wl->kbd.focus = NULL; } @@ -3882,9 +3745,8 @@ _e_comp_wl_client_usable_get(pid_t pid, E_Pixmap *ep) if (ec) { E_Pixmap *oldep = NULL; - E_Comp_Wl_Client_Data *cdata = e_client_cdata_get(ec); - if (cdata) + if (ec->comp_data) { /* do NOT replace with the client having comp data */ return NULL; @@ -3905,7 +3767,7 @@ _e_comp_wl_client_usable_get(pid_t pid, E_Pixmap *ep) /* to set-up comp data */ _e_comp_wl_client_cb_new(NULL, ec); ec->ignored = 0; - if (!cdata) return NULL; + if (!ec->comp_data) return NULL; _e_comp_wl_client_evas_init(ec); ELOGF("COMP", "Reusable ec. new_pixmap:%p", ec, ec->pixmap); @@ -4455,16 +4317,14 @@ e_comp_wl_surface_event_simple_free(void *d EINA_UNUSED, E_Event_Client *ev) EINTERN void e_comp_wl_surface_attach(E_Client *ec, E_Comp_Wl_Buffer *buffer) { - E_Comp_Wl_Client_Data *cdata = NULL; E_Event_Client *ev; ev = E_NEW(E_Event_Client, 1); if (!ev) return; - cdata = e_client_cdata_get(ec); - e_comp_wl_buffer_reference(&cdata->buffer_ref, buffer); + e_comp_wl_buffer_reference(&ec->comp_data->buffer_ref, buffer); /* set usable early because shell module checks this */ - if (cdata->shell.surface || cdata->sub.data) + if (ec->comp_data->shell.surface || ec->comp_data->sub.data) e_pixmap_usable_set(ec->pixmap, (buffer != NULL)); e_pixmap_resource_set(ec->pixmap, buffer); @@ -4472,7 +4332,7 @@ e_comp_wl_surface_attach(E_Client *ec, E_Comp_Wl_Buffer *buffer) e_pixmap_refresh(ec->pixmap); e_comp_wl_map_size_cal_from_buffer(ec); - _e_comp_wl_surface_state_size_update(ec, &cdata->pending); + _e_comp_wl_surface_state_size_update(ec, &ec->comp_data->pending); /* wm-policy module uses it */ _e_comp_wl_hook_call(E_COMP_WL_HOOK_BUFFER_CHANGE, ec); @@ -4486,15 +4346,13 @@ e_comp_wl_surface_attach(E_Client *ec, E_Comp_Wl_Buffer *buffer) E_API Eina_Bool e_comp_wl_surface_commit(E_Client *ec) { - E_Comp_Wl_Client_Data *cdata = NULL; Eina_Bool ignored; int x = 0, y = 0; - cdata = e_client_cdata_get(ec); - _e_comp_wl_surface_state_commit(ec, &cdata->pending); + _e_comp_wl_surface_state_commit(ec, &ec->comp_data->pending); if (!e_comp_object_damage_exists(ec->frame)) { - if ((cdata->video_client) || + if ((ec->comp_data->video_client) || (!e_client_video_hw_composition_check(ec))) e_pixmap_image_clear(ec->pixmap, 1); } @@ -4508,36 +4366,36 @@ e_comp_wl_surface_commit(E_Client *ec) if (!e_pixmap_usable_get(ec->pixmap)) { - if (cdata->mapped) + if (ec->comp_data->mapped) { - if ((cdata->shell.surface) && (cdata->shell.unmap)) + if ((ec->comp_data->shell.surface) && (ec->comp_data->shell.unmap)) { ELOGF("COMP", "Try to unmap2. Call shell.unmap.", ec); - cdata->shell.unmap(cdata->shell.surface); + ec->comp_data->shell.unmap(ec->comp_data->shell.surface); } - else if (e_client_has_xwindow(ec) || ec->internal || cdata->sub.data || + else if (e_client_has_xwindow(ec) || ec->internal || ec->comp_data->sub.data || (ec == e_comp_wl->drag_client)) { ELOGF("COMP", "Try to unmap2. Hide window. internal:%d, sub:%p, drag:%d", - ec, ec->internal, cdata->sub.data, (ec == e_comp_wl->drag_client)); + ec, ec->internal, ec->comp_data->sub.data, (ec == e_comp_wl->drag_client)); ec->visible = EINA_FALSE; evas_object_hide(ec->frame); - cdata->mapped = 0; + ec->comp_data->mapped = 0; } } - if (cdata->sub.below_obj && evas_object_visible_get(cdata->sub.below_obj)) - evas_object_hide(cdata->sub.below_obj); + if (ec->comp_data->sub.below_obj && evas_object_visible_get(ec->comp_data->sub.below_obj)) + evas_object_hide(ec->comp_data->sub.below_obj); } else { - if (!cdata->mapped) + if (!ec->comp_data->mapped) { - if ((cdata->shell.surface) && (cdata->shell.map) && + if ((ec->comp_data->shell.surface) && (ec->comp_data->shell.map) && (!ec->ignored)) { ELOGF("COMP", "Try to map2. Call shell.map.", ec); - cdata->shell.map(cdata->shell.surface); + ec->comp_data->shell.map(ec->comp_data->shell.surface); } else if (e_client_has_xwindow(ec) || ec->internal || e_comp_wl_subsurface_can_show(ec) || (ec == e_comp_wl->drag_client)) @@ -4547,13 +4405,13 @@ e_comp_wl_surface_commit(E_Client *ec) ec->visible = EINA_TRUE; ec->ignored = 0; evas_object_show(ec->frame); - cdata->mapped = 1; + ec->comp_data->mapped = 1; } } - if (cdata->sub.below_obj && !evas_object_visible_get(cdata->sub.below_obj) + if (ec->comp_data->sub.below_obj && !evas_object_visible_get(ec->comp_data->sub.below_obj) && evas_object_visible_get(ec->frame)) - evas_object_show(cdata->sub.below_obj); + evas_object_show(ec->comp_data->sub.below_obj); } ec->ignored = ignored; @@ -4636,7 +4494,6 @@ EINTERN E_Comp_Wl_Buffer * e_comp_wl_buffer_get(struct wl_resource *resource, E_Client *ec) { E_Comp_Wl_Buffer *buffer = NULL; - E_Comp_Wl_Client_Data *cdata = NULL; struct wl_listener *listener; struct wl_shm_buffer *shmbuff; Eina_Bool res; @@ -4668,8 +4525,7 @@ e_comp_wl_buffer_get(struct wl_resource *resource, E_Client *ec) } else { - cdata = e_client_cdata_get(ec); - if ((ec) && (cdata->video_client)) + if ((ec) && (ec->comp_data->video_client)) { buffer->type = E_COMP_WL_BUFFER_TYPE_VIDEO; buffer->w = buffer->h = 1; @@ -4742,8 +4598,7 @@ e_comp_wl_buffer_get(struct wl_resource *resource, E_Client *ec) if (!tbm_surf) goto err; - cdata = e_client_cdata_get(ec); - if ((ec) && (cdata->video_client)) + if ((ec) && (ec->comp_data->video_client)) { buffer->type = E_COMP_WL_BUFFER_TYPE_VIDEO; buffer->w = buffer->h = 1; @@ -4959,7 +4814,6 @@ _e_comp_wl_key_send(Ecore_Event_Key *ev, enum wl_keyboard_key_state state, Eina_ uint32_t serial, keycode; struct wl_client *wc = NULL; E_Comp_Config *comp_conf = NULL; - E_Comp_Wl_Client_Data *cdata = NULL; keycode = (ev->keycode - 8); @@ -4967,8 +4821,8 @@ _e_comp_wl_key_send(Ecore_Event_Key *ev, enum wl_keyboard_key_state state, Eina_ comp_conf = e_comp_config_get(); - if (ec && (cdata = e_client_cdata_get(ec)) && cdata->surface) - wc = wl_resource_get_client(cdata->surface); + if (ec && ec->comp_data && ec->comp_data->surface) + wc = wl_resource_get_client(ec->comp_data->surface); EINA_LIST_FOREACH(key_list, l, res) { @@ -4990,7 +4844,6 @@ EINTERN Eina_Bool e_comp_wl_key_down(Ecore_Event_Key *ev) { E_Client *ec = NULL; - E_Comp_Wl_Client_Data *cdata = NULL; uint32_t keycode; E_Comp_Wl_Key_Data *end, *k; @@ -5029,7 +4882,7 @@ e_comp_wl_key_down(Ecore_Event_Key *ev) if ((!e_client_action_get()) && (!e_comp->input_key_grabs)) { ec = e_client_focused_get(); - if (ec && (cdata = e_client_cdata_get(ec)) && cdata->surface && e_comp_wl->kbd.focused) + if (ec && ec->comp_data && ec->comp_data->surface && e_comp_wl->kbd.focused) { _e_comp_wl_key_send(ev, WL_KEYBOARD_KEY_STATE_PRESSED, e_comp_wl->kbd.focused, ec); @@ -5126,7 +4979,6 @@ e_comp_wl_evas_handle_mouse_button(E_Client *ec, uint32_t timestamp, uint32_t bu uint32_t serial, btn; struct wl_resource *res; E_Comp_Config *comp_conf = NULL; - E_Comp_Wl_Client_Data *cdata = NULL; if (ec->cur_mouse_action || e_comp_wl->drag) return EINA_FALSE; @@ -5143,13 +4995,12 @@ e_comp_wl_evas_handle_mouse_button(E_Client *ec, uint32_t timestamp, uint32_t bu e_comp_wl->ptr.button = btn; - cdata = e_client_cdata_get(ec); - if (!cdata || !cdata->surface) return EINA_FALSE; + if (!ec->comp_data || !ec->comp_data->surface) return EINA_FALSE; if (!eina_list_count(e_comp_wl->ptr.resources)) return EINA_TRUE; - wc = wl_resource_get_client(cdata->surface); + wc = wl_resource_get_client(ec->comp_data->surface); serial = wl_display_next_serial(e_comp_wl->wl.disp); comp_conf = e_comp_config_get(); @@ -5309,18 +5160,16 @@ e_comp_wl_key_send(E_Client *ec, int keycode, Eina_Bool pressed, Ecore_Device *d uint32_t serial, wl_keycode; enum wl_keyboard_key_state state; E_Comp_Config *comp_conf = NULL; - E_Comp_Wl_Client_Data *cdata = NULL; EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE); - cdata = e_client_cdata_get(ec); - EINA_SAFETY_ON_NULL_RETURN_VAL(cdata, EINA_FALSE); - EINA_SAFETY_ON_NULL_RETURN_VAL(cdata->surface, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(ec->comp_data, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(ec->comp_data->surface, EINA_FALSE); EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_wl, EINA_FALSE); wl_keycode = keycode - 8; EINA_SAFETY_ON_TRUE_RETURN_VAL(wl_keycode <= 0, EINA_FALSE); - wc = wl_resource_get_client(cdata->surface); + wc = wl_resource_get_client(ec->comp_data->surface); serial = wl_display_next_serial(e_comp_wl->wl.disp); if (!time) time = (uint32_t)(ecore_time_get() * 1000); if (pressed) state = WL_KEYBOARD_KEY_STATE_PRESSED; @@ -5353,12 +5202,10 @@ e_comp_wl_key_cancel(E_Client *ec, int keycode, Ecore_Device *dev, uint32_t time Eina_List *l; uint32_t serial, wl_keycode, cancel_keycode; E_Comp_Config *comp_conf = NULL; - E_Comp_Wl_Client_Data *cdata = NULL; EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE); - cdata = e_client_cdata_get(ec); - EINA_SAFETY_ON_NULL_RETURN_VAL(cdata, EINA_FALSE); - EINA_SAFETY_ON_NULL_RETURN_VAL(cdata->surface, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(ec->comp_data, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(ec->comp_data->surface, EINA_FALSE); EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_wl, EINA_FALSE); EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_wl->xkb.keymap, EINA_FALSE); @@ -5373,7 +5220,7 @@ e_comp_wl_key_cancel(E_Client *ec, int keycode, Ecore_Device *dev, uint32_t time wl_keycode = keycode - 8; EINA_SAFETY_ON_TRUE_RETURN_VAL(wl_keycode <= 0, EINA_FALSE); - wc = wl_resource_get_client(cdata->surface); + wc = wl_resource_get_client(ec->comp_data->surface); serial = wl_display_next_serial(e_comp_wl->wl.disp); if (!time) time = (uint32_t)(ecore_time_get() * 1000); @@ -5406,17 +5253,15 @@ e_comp_wl_touch_send(E_Client *ec, int idx, int x, int y, Eina_Bool pressed, Eco struct wl_client *wc; uint32_t serial; E_Devicemgr_Input_Device *device = NULL; - E_Comp_Wl_Client_Data *cdata = NULL; EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE); - cdata = e_client_cdata_get(ec); - EINA_SAFETY_ON_NULL_RETURN_VAL(cdata, EINA_FALSE); - EINA_SAFETY_ON_NULL_RETURN_VAL(cdata->surface, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(ec->comp_data, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(ec->comp_data->surface, EINA_FALSE); EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_wl, EINA_FALSE); if (!dev) device = _e_comp_wl_device_last_device_get(ECORE_DEVICE_CLASS_TOUCH); - wc = wl_resource_get_client(cdata->surface); + wc = wl_resource_get_client(ec->comp_data->surface); if (!time) time = (uint32_t)(ecore_time_get() * 1000); serial = wl_display_next_serial(e_comp_wl->wl.disp); @@ -5445,17 +5290,15 @@ e_comp_wl_touch_update_send(E_Client *ec, int idx, int x, int y, Ecore_Device *d E_Devicemgr_Input_Device *device; uint32_t serial; struct wl_client *wc; - E_Comp_Wl_Client_Data *cdata = NULL; EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE); - cdata = e_client_cdata_get(ec); - EINA_SAFETY_ON_NULL_RETURN_VAL(cdata, EINA_FALSE); - EINA_SAFETY_ON_NULL_RETURN_VAL(cdata->surface, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(ec->comp_data, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(ec->comp_data->surface, EINA_FALSE); EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_wl, EINA_FALSE); if (!dev) device = _e_comp_wl_device_last_device_get(ECORE_DEVICE_CLASS_TOUCH); - wc = wl_resource_get_client(cdata->surface); + wc = wl_resource_get_client(ec->comp_data->surface); if (!time) time = (uint32_t)(ecore_time_get() * 1000); serial = wl_display_next_serial(e_comp_wl->wl.disp); @@ -5481,11 +5324,8 @@ e_comp_wl_touch_update_send(E_Client *ec, int idx, int x, int y, Ecore_Device *d EINTERN Eina_Bool e_comp_wl_touch_cancel_send(E_Client *ec) { - E_Comp_Wl_Client_Data *cdata = NULL; - EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE); - cdata = e_client_cdata_get(ec); - EINA_SAFETY_ON_NULL_RETURN_VAL(cdata, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(ec->comp_data, EINA_FALSE); EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_wl, EINA_FALSE); _e_comp_wl_send_touch_cancel(ec); @@ -5498,15 +5338,13 @@ e_comp_wl_mouse_button_send(E_Client *ec, int buttons, Eina_Bool pressed, Ecore_ { uint32_t serial; struct wl_client *wc; - E_Comp_Wl_Client_Data *cdata = NULL; EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE); - cdata = e_client_cdata_get(ec); - EINA_SAFETY_ON_NULL_RETURN_VAL(cdata, EINA_FALSE); - EINA_SAFETY_ON_NULL_RETURN_VAL(cdata->surface, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(ec->comp_data, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(ec->comp_data->surface, EINA_FALSE); EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_wl, EINA_FALSE); - wc = wl_resource_get_client(cdata->surface); + wc = wl_resource_get_client(ec->comp_data->surface); if (!time) time = (uint32_t)(ecore_time_get() * 1000); serial = wl_display_next_serial(e_comp_wl->wl.disp); @@ -5528,15 +5366,13 @@ e_comp_wl_mouse_move_send(E_Client *ec, int x, int y, Ecore_Device *dev, uint32_ { uint32_t serial; struct wl_client *wc; - E_Comp_Wl_Client_Data *cdata = NULL; EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE); - cdata = e_client_cdata_get(ec); - EINA_SAFETY_ON_NULL_RETURN_VAL(cdata, EINA_FALSE); - EINA_SAFETY_ON_NULL_RETURN_VAL(cdata->surface, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(ec->comp_data, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(ec->comp_data->surface, EINA_FALSE); EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_wl, EINA_FALSE); - wc = wl_resource_get_client(cdata->surface); + wc = wl_resource_get_client(ec->comp_data->surface); if (!time) time = (uint32_t)(ecore_time_get() * 1000); serial = wl_display_next_serial(e_comp_wl->wl.disp); @@ -5556,15 +5392,13 @@ e_comp_wl_mouse_wheel_send(E_Client *ec, int direction, int z, Ecore_Device *dev { uint32_t serial; struct wl_client *wc; - E_Comp_Wl_Client_Data *cdata = NULL; EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE); - cdata = e_client_cdata_get(ec); - EINA_SAFETY_ON_NULL_RETURN_VAL(cdata, EINA_FALSE); - EINA_SAFETY_ON_NULL_RETURN_VAL(cdata->surface, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(ec->comp_data, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(ec->comp_data->surface, EINA_FALSE); EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_wl, EINA_FALSE); - wc = wl_resource_get_client(cdata->surface); + wc = wl_resource_get_client(ec->comp_data->surface); if (!time) time = (uint32_t)(ecore_time_get() * 1000); serial = wl_display_next_serial(e_comp_wl->wl.disp); @@ -5583,17 +5417,15 @@ e_comp_wl_mouse_in_send(E_Client *ec, int x, int y, Ecore_Device *dev, uint32_t struct wl_client *wc; struct wl_resource *res; Eina_List *l; - E_Comp_Wl_Client_Data *cdata = NULL; EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE); - cdata = e_client_cdata_get(ec); - EINA_SAFETY_ON_NULL_RETURN_VAL(cdata, EINA_FALSE); - EINA_SAFETY_ON_NULL_RETURN_VAL(cdata->surface, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(ec->comp_data, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(ec->comp_data->surface, EINA_FALSE); EINA_SAFETY_ON_NULL_RETURN_VAL(e_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; - wc = wl_resource_get_client(cdata->surface); + wc = wl_resource_get_client(ec->comp_data->surface); serial = wl_display_next_serial(e_comp_wl->wl.disp); EINA_LIST_FOREACH(e_comp_wl->ptr.resources, l, res) { @@ -5603,7 +5435,7 @@ e_comp_wl_mouse_in_send(E_Client *ec, int x, int y, Ecore_Device *dev, uint32_t 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); - wl_pointer_send_enter(res, serial, cdata->surface, + wl_pointer_send_enter(res, serial, ec->comp_data->surface, wl_fixed_from_int(x), wl_fixed_from_int(y)); } @@ -5614,7 +5446,6 @@ e_comp_wl_mouse_in_send(E_Client *ec, int x, int y, Ecore_Device *dev, uint32_t EINTERN Eina_Bool e_comp_wl_mouse_out_send(E_Client *ec, Ecore_Device *dev, uint32_t time) { - E_Comp_Wl_Client_Data *cdata = NULL; uint32_t serial; struct wl_client *wc; struct wl_resource *res; @@ -5622,13 +5453,12 @@ e_comp_wl_mouse_out_send(E_Client *ec, Ecore_Device *dev, uint32_t time) EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_wl, EINA_FALSE); EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE); - cdata = e_client_cdata_get(ec); - EINA_SAFETY_ON_NULL_RETURN_VAL(cdata, EINA_FALSE); - EINA_SAFETY_ON_NULL_RETURN_VAL(cdata->surface, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(ec->comp_data, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(ec->comp_data->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; - wc = wl_resource_get_client(cdata->surface); + wc = wl_resource_get_client(ec->comp_data->surface); serial = wl_display_next_serial(e_comp_wl->wl.disp); EINA_LIST_FOREACH(e_comp_wl->ptr.resources, l, res) { @@ -5638,7 +5468,7 @@ e_comp_wl_mouse_out_send(E_Client *ec, Ecore_Device *dev, uint32_t time) 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); - wl_pointer_send_leave(res, serial, cdata->surface); + wl_pointer_send_leave(res, serial, ec->comp_data->surface); } return EINA_TRUE; @@ -5701,7 +5531,6 @@ e_comp_wl_mouse_out_renew(E_Client *ec, int buttons, int x, int y, void *data, E EINTERN Eina_Bool e_comp_wl_cursor_hide(E_Client *ec) { - E_Comp_Wl_Client_Data *cdata = NULL; struct wl_resource *res; struct wl_client *wc; Eina_List *l; @@ -5718,17 +5547,16 @@ e_comp_wl_cursor_hide(E_Client *ec) if (!ec) return EINA_FALSE; if (e_object_is_del(E_OBJECT(ec))) return EINA_FALSE; - cdata = e_client_cdata_get(ec); - if (!cdata || !cdata->surface) return EINA_FALSE; - wc = wl_resource_get_client(cdata->surface); + if (!ec->comp_data || !ec->comp_data->surface) return EINA_FALSE; + wc = wl_resource_get_client(ec->comp_data->surface); serial = wl_display_next_serial(e_comp_wl->wl.disp); EINA_LIST_FOREACH(e_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; - wl_pointer_send_leave(res, serial, cdata->surface); + wl_pointer_send_leave(res, serial, ec->comp_data->surface); ec->pointer_enter_sent = EINA_FALSE; } @@ -5897,9 +5725,7 @@ e_comp_wl_output_find(E_Client *ec) Eina_List *l; E_Comp_Wl_Output *output; - if (!ec) return NULL; - if (e_object_is_del(E_OBJECT(ec))) return NULL; - if (!e_client_cdata_get(ec)) return NULL; + if (!ec || !ec->comp_data || e_object_is_del(E_OBJECT(ec))) return NULL; EINA_LIST_FOREACH(e_comp_wl->outputs, l, output) { @@ -5942,7 +5768,7 @@ _e_comp_wl_surface_state_serial_update(E_Client *ec, E_Comp_Wl_Surface_State *st if (!ec) return; if (e_object_is_del(E_OBJECT(ec))) return; - if (!e_client_cdata_get(ec)) return; + if (!ec->comp_data) return; buffer = state->buffer; if (!buffer) return; @@ -6001,7 +5827,6 @@ ret: EINTERN Eina_Bool e_comp_wl_commit_sync_configure(E_Client *ec) { - E_Comp_Wl_Client_Data *cdata = NULL; Eina_List *l; E_Client_Pending_Geometry *geo; E_Client_Demand_Geometry change = 0; @@ -6013,8 +5838,6 @@ e_comp_wl_commit_sync_configure(E_Client *ec) if (!ec || !ec->frame) goto ret; if (e_object_is_del(E_OBJECT(ec))) goto ret; - cdata = e_client_cdata_get(ec); - if (!cdata) goto ret; bw = bh = 0; config.x = ec->x; config.y = ec->y; config.w = ec->w; config.h = ec->h; @@ -6067,9 +5890,10 @@ e_comp_wl_commit_sync_configure(E_Client *ec) // cw interceptor(move,resize) won't work if wait_commit is TRUE ec->surface_sync.wait_commit = EINA_FALSE; - if (cdata->shell.surface && cdata->shell.configure) + if ((ec->comp_data->shell.surface) && + (ec->comp_data->shell.configure)) { - cdata->shell.configure(cdata->shell.surface, + ec->comp_data->shell.configure(ec->comp_data->shell.surface, ec->x, ec->y, ec->w, ec->h); } @@ -6414,17 +6238,15 @@ _transform_merge_with_rotation(enum wl_output_transform transform, unsigned int static void _e_comp_wl_surface_output_viewport_get(E_Client *ec, Eina_Rectangle *out) { - E_Comp_Wl_Client_Data *cdata = NULL; E_Comp_Wl_Subsurf_Data *sdata = NULL; if (!out) return; - cdata = e_client_cdata_get(ec); - if (!cdata) + if (!ec->comp_data) return; - sdata = cdata->sub.data; + sdata = ec->comp_data->sub.data; if (sdata) { if (sdata->parent) @@ -6444,9 +6266,9 @@ _e_comp_wl_surface_output_viewport_get(E_Client *ec, Eina_Rectangle *out) out->y = ec->y; } - out->w = cdata->width_from_viewport; + out->w = ec->comp_data->width_from_viewport; out->w = (out->w + 1) & ~1; - out->h = cdata->height_from_viewport; + out->h = ec->comp_data->height_from_viewport; e_comp_object_frame_xy_unadjust(ec->frame, out->x, out->y, &out->x, &out->y); e_comp_object_frame_wh_unadjust(ec->frame, out->w, out->h, &out->w, &out->h); @@ -6455,7 +6277,6 @@ _e_comp_wl_surface_output_viewport_get(E_Client *ec, Eina_Rectangle *out) EINTERN Eina_Bool e_comp_wl_surface_viewport_get(E_Client *ec, Eina_Rectangle *buffer_viewport, Eina_Rectangle *output_viewport, unsigned int *transform) { - E_Comp_Wl_Client_Data *cdata = NULL; E_Comp_Wl_Buffer *buffer; E_Comp_Wl_Buffer_Viewport *vp; const Evas_Map *m; @@ -6468,14 +6289,11 @@ e_comp_wl_surface_viewport_get(E_Client *ec, Eina_Rectangle *buffer_viewport, Ei if (e_object_is_del(E_OBJECT(ec))) return EINA_FALSE; - cdata = e_client_cdata_get(ec); - if (!cdata) return EINA_FALSE; - - vp = &cdata->scaler.buffer_viewport; + vp = &ec->comp_data->scaler.buffer_viewport; if (buffer_viewport) { - buffer = cdata->buffer_ref.buffer; + buffer = ec->comp_data->buffer_ref.buffer; /* Getting a viewport of buffer needs geometry of buffer. */ if (!buffer) return EINA_FALSE; diff --git a/src/bin/e_comp_wl_capture.c b/src/bin/e_comp_wl_capture.c index a5c1e6f79e..4d7d977ce1 100644 --- a/src/bin/e_comp_wl_capture.c +++ b/src/bin/e_comp_wl_capture.c @@ -1273,7 +1273,6 @@ _e_capture_client_child_data_check(Thread_Data *td) Eina_List *list, *l; E_Client *ec = NULL; E_Client *child_ec = NULL; - E_Comp_Wl_Client_Data *cdata = NULL; ec = td->ec; if (!ec) return EINA_FALSE; @@ -1283,9 +1282,8 @@ _e_capture_client_child_data_check(Thread_Data *td) EINA_LIST_FOREACH(list, l, child_ec) { if (e_object_is_del(E_OBJECT(child_ec))) continue; - cdata = e_client_cdata_get(child_ec); - if (!cdata) continue; - if (!cdata->mapped) continue; + if (!child_ec->comp_data) continue; + if (!child_ec->comp_data->mapped) continue; if (child_ec->iconic && child_ec->exp_iconify.by_client) continue; diff --git a/src/bin/e_comp_wl_data.c b/src/bin/e_comp_wl_data.c index 7457f15af6..be3b7b72bc 100644 --- a/src/bin/e_comp_wl_data.c +++ b/src/bin/e_comp_wl_data.c @@ -387,8 +387,8 @@ _e_comp_wl_data_device_drag_finished(E_Drag *drag, int dropped) if (e_comp_wl->selection.target && (!dropped)) { struct wl_resource *res; - E_Comp_Wl_Client_Data *selection_target_cdata = e_client_cdata_get(e_comp_wl->selection.target); - res = e_comp_wl_data_find_for_client(wl_resource_get_client(selection_target_cdata->surface)); + + res = e_comp_wl_data_find_for_client(wl_resource_get_client(e_comp_wl->selection.target->comp_data->surface)); if (res) { wl_data_device_send_drop(res); @@ -748,13 +748,10 @@ e_comp_wl_data_device_send_enter(E_Client *ec) struct wl_resource *data_device_res, *offer_res; uint32_t serial; int x, y; - E_Comp_Wl_Client_Data *cdata = NULL; - - cdata = e_client_cdata_get(ec); { data_device_res = - e_comp_wl_data_find_for_client(wl_resource_get_client(cdata->surface)); + e_comp_wl_data_find_for_client(wl_resource_get_client(ec->comp_data->surface)); if (!data_device_res) return; offer_res = e_comp_wl_data_device_send_offer(ec); if (e_comp_wl->drag_source) @@ -778,7 +775,7 @@ e_comp_wl_data_device_send_enter(E_Client *ec) x = wl_fixed_to_int(e_comp_wl->ptr.x) - e_comp_wl->selection.target->client.x; y = wl_fixed_to_int(e_comp_wl->ptr.y) - e_comp_wl->selection.target->client.y; serial = wl_display_next_serial(e_comp_wl->wl.disp); - wl_data_device_send_enter(data_device_res, serial, cdata->surface, + wl_data_device_send_enter(data_device_res, serial, ec->comp_data->surface, wl_fixed_from_int(x), wl_fixed_from_int(y), offer_res); } @@ -786,12 +783,11 @@ E_API void e_comp_wl_data_device_send_leave(E_Client *ec) { struct wl_resource *res; - E_Comp_Wl_Client_Data *cdata = e_client_cdata_get(ec); evas_object_event_callback_del_full(ec->frame, EVAS_CALLBACK_DEL, _e_comp_wl_data_device_target_del, ec); if (e_comp_wl->selection.target == ec) e_comp_wl->selection.target = NULL; - res = e_comp_wl_data_find_for_client(wl_resource_get_client(cdata->surface)); + res = e_comp_wl_data_find_for_client(wl_resource_get_client(ec->comp_data->surface)); if (res) wl_data_device_send_leave(res); } @@ -801,10 +797,9 @@ e_comp_wl_data_device_send_offer(E_Client *ec) { struct wl_resource *data_device_res, *offer_res = NULL; E_Comp_Wl_Data_Source *source; - E_Comp_Wl_Client_Data *cdata = e_client_cdata_get(ec); data_device_res = - e_comp_wl_data_find_for_client(wl_resource_get_client(cdata->surface)); + e_comp_wl_data_find_for_client(wl_resource_get_client(ec->comp_data->surface)); if (!data_device_res) return NULL; source = e_comp_wl->drag_source; if (source) diff --git a/src/bin/e_comp_wl_input.c b/src/bin/e_comp_wl_input.c index 66b2268163..c5354a3a59 100644 --- a/src/bin/e_comp_wl_input.c +++ b/src/bin/e_comp_wl_input.c @@ -40,7 +40,6 @@ static void _e_comp_wl_input_pointer_map(struct wl_resource *resource) { E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; E_Pointer *ptr; struct wl_client *wc; @@ -50,14 +49,9 @@ _e_comp_wl_input_pointer_map(struct wl_resource *resource) //if cursor ec have external content e_comp_object_content_unset(ec->frame); - if (!e_comp_wl->ptr.ec) return; - - cdata = e_client_cdata_get(e_comp_wl->ptr.ec); - if (!cdata) return; - if (!cdata->surface) return; - + if (!e_comp_wl->ptr.ec || !e_comp_wl->ptr.ec->comp_data || !e_comp_wl->ptr.ec->comp_data->surface) return; wc = wl_resource_get_client(resource); - if (wc != wl_resource_get_client(cdata->surface)) return; + if (wc != wl_resource_get_client(e_comp_wl->ptr.ec->comp_data->surface)) return; if (!e_comp_wl->ptr.ec->pointer_enter_sent) return; if ((ptr = e_comp->pointer)) @@ -87,17 +81,14 @@ static void _e_comp_wl_input_pointer_cb_cursor_set(struct wl_client *client, struct wl_resource *resource EINA_UNUSED, uint32_t serial EINA_UNUSED, struct wl_resource *surface_resource, int32_t x, int32_t y) { E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; Eina_Bool got_mouse = EINA_FALSE; E_CLIENT_FOREACH(ec) { if (e_object_is_del(E_OBJECT(ec))) continue; if (e_pixmap_type_get(ec->pixmap) != E_PIXMAP_TYPE_WL) continue; - cdata = e_client_cdata_get(ec); - if (!cdata) continue; - if (!cdata->surface) continue; - if (client != wl_resource_get_client(cdata->surface)) continue; + if (!ec->comp_data->surface) continue; + if (client != wl_resource_get_client(ec->comp_data->surface)) continue; if (ec->mouse.in && ec->pointer_enter_sent) { got_mouse = EINA_TRUE; @@ -129,9 +120,9 @@ _e_comp_wl_input_pointer_cb_cursor_set(struct wl_client *client, struct wl_resou EC_CHANGED(ec); /* Set fuctions to prevent unwanted handling by shell */ - cdata->shell.surface = surface_resource; - cdata->shell.configure = _e_comp_wl_input_pointer_configure; - cdata->shell.map = _e_comp_wl_input_pointer_map; + ec->comp_data->shell.surface = surface_resource; + ec->comp_data->shell.configure = _e_comp_wl_input_pointer_configure; + ec->comp_data->shell.map = _e_comp_wl_input_pointer_map; e_client_layer_set(ec, E_LAYER_CLIENT_CURSOR); ec->is_cursor = EINA_TRUE; @@ -204,7 +195,7 @@ _e_comp_wl_input_cb_pointer_get(struct wl_client *client, struct wl_resource *re 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) { - cdata = e_client_cdata_get(e_comp_wl->ptr.ec); + cdata = (E_Comp_Wl_Client_Data*)e_comp_wl->ptr.ec->comp_data; if (cdata && cdata->wl_surface) ptr_client = wl_resource_get_client(cdata->wl_surface); @@ -252,14 +243,11 @@ _e_comp_wl_input_cb_keyboard_unbind(struct wl_resource *resource) void e_comp_wl_input_keyboard_enter_send(E_Client *ec) { - E_Comp_Wl_Client_Data *cdata = NULL; struct wl_resource *res; Eina_List *l; uint32_t serial; - cdata = e_client_cdata_get(ec); - if (!cdata) return; - if (!cdata->surface) return; + if (!ec->comp_data->surface) return; if (!e_comp_wl->kbd.focused) return; @@ -269,7 +257,7 @@ e_comp_wl_input_keyboard_enter_send(E_Client *ec) EINA_LIST_FOREACH(e_comp_wl->kbd.focused, l, res) { - wl_keyboard_send_enter(res, serial, cdata->surface, + wl_keyboard_send_enter(res, serial, ec->comp_data->surface, &e_comp_wl->kbd.keys); wl_keyboard_send_modifiers(res, serial, e_comp_wl->kbd.mod_depressed, @@ -283,7 +271,6 @@ static void _e_comp_wl_input_cb_keyboard_get(struct wl_client *client, struct wl_resource *resource, uint32_t id) { E_Client *focused; - E_Comp_Wl_Client_Data *focused_cdata = NULL; struct wl_resource *res; /* try to create keyboard resource */ @@ -316,11 +303,10 @@ _e_comp_wl_input_cb_keyboard_get(struct wl_client *client, struct wl_resource *r /* if the client owns the focused surface, we need to send an enter */ focused = e_client_focused_get(); - if ((!focused) || (e_object_is_del(E_OBJECT(focused)))) return; - focused_cdata = e_client_cdata_get(focused); - if ((!focused_cdata) || (!focused_cdata->surface)) return; + if ((!focused) || (e_object_is_del(E_OBJECT(focused))) || + (!focused->comp_data) || (!focused->comp_data->surface)) return; - if (client != wl_resource_get_client(focused_cdata->surface)) return; + if (client != wl_resource_get_client(focused->comp_data->surface)) return; e_comp_wl->kbd.focused = eina_list_append(e_comp_wl->kbd.focused, res); e_comp_wl_input_keyboard_enter_send(focused); diff --git a/src/bin/e_comp_wl_rsm.c b/src/bin/e_comp_wl_rsm.c index e721089e3d..6f8e2833c8 100644 --- a/src/bin/e_comp_wl_rsm.c +++ b/src/bin/e_comp_wl_rsm.c @@ -225,19 +225,16 @@ static void _remote_provider_rect_add(E_Comp_Wl_Remote_Provider *provider, Eina_Rectangle *rect) { E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; ec = provider->common.ec; if (!ec) return; + if (!ec->comp_data) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; - - cdata->remote_surface.regions = - eina_list_remove(cdata->remote_surface.regions, + ec->comp_data->remote_surface.regions = + eina_list_remove(ec->comp_data->remote_surface.regions, rect); - cdata->remote_surface.regions = - eina_list_append(cdata->remote_surface.regions, + ec->comp_data->remote_surface.regions = + eina_list_append(ec->comp_data->remote_surface.regions, rect); } @@ -245,16 +242,13 @@ static void _remote_provider_rect_del(E_Comp_Wl_Remote_Provider *provider, Eina_Rectangle *rect) { E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; ec = provider->common.ec; if (!ec) return; + if (!ec->comp_data) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; - - cdata->remote_surface.regions = - eina_list_remove(cdata->remote_surface.regions, + ec->comp_data->remote_surface.regions = + eina_list_remove(ec->comp_data->remote_surface.regions, rect); } @@ -262,27 +256,23 @@ static void _remote_provider_rect_clear(E_Comp_Wl_Remote_Provider *provider) { E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; ec = provider->common.ec; if (!ec) return; - - cdata = e_client_cdata_get(ec); - if (!cdata) return; + if (!ec->comp_data) return; /* TODO : remove it from here after supporting multiple onscreen surface */ _remote_surface_region_clear(provider->onscreen_parent); - cdata->remote_surface.regions = - eina_list_remove_list(cdata->remote_surface.regions, - cdata->remote_surface.regions); + ec->comp_data->remote_surface.regions = + eina_list_remove_list(ec->comp_data->remote_surface.regions, + ec->comp_data->remote_surface.regions); } static void _remote_provider_onscreen_parent_set(E_Comp_Wl_Remote_Provider *provider, E_Comp_Wl_Remote_Surface *parent) { E_Comp_Wl_Remote_Region *region; - E_Comp_Wl_Client_Data *cdata = NULL; Eina_List *l; if (!provider) return; @@ -291,11 +281,8 @@ _remote_provider_onscreen_parent_set(E_Comp_Wl_Remote_Provider *provider, E_Comp _remote_provider_rect_clear(provider); - cdata = e_client_cdata_get(provider->common.ec); - if (!cdata) return; - provider->onscreen_parent = parent; - cdata->remote_surface.onscreen_parent = NULL; + provider->common.ec->comp_data->remote_surface.onscreen_parent = NULL; RSMDBG("set onscreen_parent %p(ec:%p)", provider->common.ec, "PROVIDER", provider, @@ -308,7 +295,7 @@ _remote_provider_onscreen_parent_set(E_Comp_Wl_Remote_Provider *provider, E_Comp _remote_provider_rect_add(provider, ®ion->geometry); } - cdata->remote_surface.onscreen_parent = parent->ec; + provider->common.ec->comp_data->remote_surface.onscreen_parent = parent->ec; } } @@ -325,7 +312,7 @@ _remote_provider_onscreen_parent_calculate(E_Comp_Wl_Remote_Provider *provider) ec = provider->common.ec; if (!ec) return; - if (!e_client_cdata_get(ec)) return; + if (!ec->comp_data) return; if (!provider->common.surfaces) return; o = evas_object_top_get(e_comp->evas); @@ -345,7 +332,7 @@ _remote_provider_onscreen_parent_calculate(E_Comp_Wl_Remote_Provider *provider) (_ec->visibility.obscured != E_VISIBILITY_PARTIALLY_OBSCURED)) continue; /* if _ec is subsurface, skip this */ - cdata = e_client_cdata_get(_ec); + cdata = (E_Comp_Wl_Client_Data *)_ec->comp_data; if (cdata && cdata->sub.data) continue; if (!E_INTERSECTS(_ec->x, _ec->y, _ec->w, _ec->h, ec->zone->x, ec->zone->y, ec->zone->w, ec->zone->h)) @@ -370,7 +357,6 @@ static void _remote_provider_offscreen_set(E_Comp_Wl_Remote_Provider* provider, Eina_Bool set) { E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; EINA_SAFETY_ON_NULL_RETURN(provider); EINA_SAFETY_ON_NULL_RETURN(provider->common.ec); @@ -384,19 +370,18 @@ _remote_provider_offscreen_set(E_Comp_Wl_Remote_Provider* provider, Eina_Bool se provider->common.is_offscreen = set; ec->ignored = EINA_TRUE; - cdata = e_client_cdata_get(ec); //TODO: consider what happens if it's not normal client such as subsurface client //TODO: save original values - if ((cdata->shell.surface) && (cdata->shell.unmap)) + if ((ec->comp_data->shell.surface) && (ec->comp_data->shell.unmap)) { ELOGF("COMP", "Call shell.unmap by rsm", ec); - cdata->shell.unmap(cdata->shell.surface); + ec->comp_data->shell.unmap(ec->comp_data->shell.surface); } else { ec->visible = EINA_FALSE; evas_object_hide(ec->frame); - cdata->mapped = 0; + ec->comp_data->mapped = 0; } ec->icccm.accepts_focus = ec->icccm.take_focus = ec->want_focus = EINA_FALSE; @@ -523,7 +508,7 @@ _remote_surface_comp_wl_buffer_get(E_Client *ec) if (!ec) return NULL; - cdata = e_client_cdata_get(ec); + cdata = ec->comp_data; if (!cdata) return NULL; return cdata->buffer_ref.buffer; @@ -927,9 +912,6 @@ _remote_surface_bind_client_unset(E_Comp_Wl_Remote_Surface *remote_surface) static void _remote_surface_bind_client(E_Comp_Wl_Remote_Surface *remote_surface, E_Client *ec) { - E_Comp_Wl_Client_Data *bind_ec_cdata = NULL; - E_Comp_Wl_Client_Data *provider_ec_cdata = NULL; - if (!remote_surface) return; if ((ec) && (remote_surface->bind_ec == ec)) return; @@ -943,10 +925,9 @@ _remote_surface_bind_client(E_Comp_Wl_Remote_Surface *remote_surface, E_Client * if (remote_surface->provider && remote_surface->provider->common.ec) e_client_base_output_resolution_rsm_update(remote_surface->bind_ec, remote_surface->provider->common.ec); - bind_ec_cdata = e_client_cdata_get(remote_surface->bind_ec); - bind_ec_cdata->pending.sx = 0; - bind_ec_cdata->pending.sy = 0; - bind_ec_cdata->pending.new_attach = EINA_TRUE; + remote_surface->bind_ec->comp_data->pending.sx = 0; + remote_surface->bind_ec->comp_data->pending.sy = 0; + remote_surface->bind_ec->comp_data->pending.new_attach = EINA_TRUE; e_comp_wl_surface_attach(remote_surface->bind_ec, NULL); e_comp_object_render_update_del(remote_surface->bind_ec->frame); @@ -1003,14 +984,14 @@ bind_ec_set: buffer = _remote_surface_comp_wl_buffer_get(remote_surface->provider->common.ec); EINA_SAFETY_ON_NULL_RETURN(buffer); - bind_ec_cdata = e_client_cdata_get(remote_surface->bind_ec); - provider_ec_cdata = e_client_cdata_get(remote_surface->provider->common.ec); + _e_comp_wl_remote_surface_state_buffer_set(&remote_surface->bind_ec->comp_data->pending, buffer); - _e_comp_wl_remote_surface_state_buffer_set(&bind_ec_cdata->pending, buffer); - bind_ec_cdata->pending.sx = 0; - bind_ec_cdata->pending.sy = 0; - bind_ec_cdata->pending.new_attach = EINA_TRUE; - bind_ec_cdata->pending.buffer_viewport = provider_ec_cdata->scaler.buffer_viewport; + remote_surface->bind_ec->comp_data->pending.sx = 0; + remote_surface->bind_ec->comp_data->pending.sy = 0; + remote_surface->bind_ec->comp_data->pending.new_attach = EINA_TRUE; + + remote_surface->bind_ec->comp_data->pending.buffer_viewport = + remote_surface->provider->common.ec->comp_data->scaler.buffer_viewport; /* check the base_output resolution */ e_client_base_output_resolution_rsm_update(ec, remote_surface->provider->common.ec); @@ -2396,7 +2377,6 @@ _remote_manager_cb_surface_create(struct wl_client *client, E_Comp_Wl_Remote_Provider *provider = NULL; E_Comp_Wl_Remote_Source *source = NULL; E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; int version; pid_t pid = 0; uid_t uid = 0; @@ -2461,8 +2441,7 @@ _remote_manager_cb_surface_create(struct wl_client *client, if (version >= TIZEN_REMOTE_SURFACE_CHANGED_BUFFER_SINCE_VERSION) { - cdata = e_client_cdata_get(ec); - if (cdata && cdata->sub.data) + if ((ec->comp_data) && (ec->comp_data->sub.data)) { ERR("Subsurface could not be source client"); goto fail; @@ -2550,7 +2529,6 @@ _remote_manager_cb_surface_create_with_wl_surface(struct wl_client *client, E_Comp_Wl_Remote_Provider *provider = NULL; E_Comp_Wl_Remote_Source *source = NULL; E_Client *ec, *provider_ec; - E_Comp_Wl_Client_Data *provider_cdata = NULL; Eina_List *surfaces; int version; pid_t pid = 0; @@ -2627,8 +2605,7 @@ _remote_manager_cb_surface_create_with_wl_surface(struct wl_client *client, if (version >= TIZEN_REMOTE_SURFACE_CHANGED_BUFFER_SINCE_VERSION) { - provider_cdata = e_client_cdata_get(provider_ec); - if (provider_cdata && provider_cdata->sub.data) + if ((provider_ec->comp_data) && (provider_ec->comp_data->sub.data)) { ERR("Subsurface could not be source client"); goto fail; @@ -3027,17 +3004,10 @@ _e_comp_wl_remote_surface_state_commit(E_Client *ec, E_Comp_Wl_Surface_State *st int x = 0, y = 0, sx = 0, sy = 0; E_Comp_Wl_Buffer *buffer; Eina_List *l, *ll; - E_Comp_Wl_Client_Data *cdata = NULL; - E_Comp_Wl_Client_Data *bind_ec_cdata = NULL; - E_Comp_Wl_Buffer_Viewport *vp = NULL; + E_Comp_Wl_Buffer_Viewport *vp = &ec->comp_data->scaler.buffer_viewport; if (e_object_is_del(E_OBJECT(ec))) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; - - vp = &cdata->scaler.buffer_viewport; - if (vp->buffer.transform != state->buffer_viewport.buffer.transform) { int transform_change = (4 + state->buffer_viewport.buffer.transform - vp->buffer.transform) & 0x3; @@ -3050,7 +3020,7 @@ _e_comp_wl_remote_surface_state_commit(E_Client *ec, E_Comp_Wl_Surface_State *st vp->wait_for_transform_change = 0; } - cdata->scaler.buffer_viewport = state->buffer_viewport; + ec->comp_data->scaler.buffer_viewport = state->buffer_viewport; if (state->new_attach) e_comp_wl_surface_attach(ec, state->buffer); @@ -3065,8 +3035,9 @@ _e_comp_wl_remote_surface_state_commit(E_Client *ec, E_Comp_Wl_Surface_State *st ec->client.h = state->bh; e_client_size_set(ec, state->bw, state->bh); - if ((cdata->shell.surface) && (cdata->shell.configure)) - cdata->shell.configure(cdata->shell.surface, x, y, ec->w, ec->h); + if ((ec->comp_data->shell.surface) && (ec->comp_data->shell.configure)) + ec->comp_data->shell.configure(ec->comp_data->shell.surface, + x, y, ec->w, ec->h); } sx = state->sx; @@ -3076,13 +3047,14 @@ _e_comp_wl_remote_surface_state_commit(E_Client *ec, E_Comp_Wl_Surface_State *st state->new_attach = EINA_FALSE; /* send previous frame done */ - EINA_LIST_FOREACH_SAFE(cdata->frames, l, ll, cb) + EINA_LIST_FOREACH_SAFE(ec->comp_data->frames, l, ll, cb) { wl_callback_send_done(cb, (unsigned int)(ecore_loop_time_get() * 1000)); wl_resource_destroy(cb); } - cdata->frames = eina_list_merge(cdata->frames, state->frames); + ec->comp_data->frames = eina_list_merge(ec->comp_data->frames, + state->frames); state->frames = NULL; /* clear stored damages... */ @@ -3103,7 +3075,21 @@ _e_comp_wl_remote_surface_state_commit(E_Client *ec, E_Comp_Wl_Surface_State *st EINA_LIST_FOREACH(provider->common.surfaces, l, surface) { if (!surface->redirect) continue; - if (!surface->bind_ec) + if (surface->bind_ec) + { + surface->bind_ec->comp_data->pending.buffer_viewport = ec->comp_data->scaler.buffer_viewport; + + _e_comp_wl_remote_surface_state_buffer_set(&surface->bind_ec->comp_data->pending, buffer); + surface->bind_ec->comp_data->pending.sx = sx; + surface->bind_ec->comp_data->pending.sy = sy; + surface->bind_ec->comp_data->pending.new_attach = EINA_TRUE; + + e_comp_wl_surface_commit(surface->bind_ec); + + /* need to prepare hwc whenever buffer changed */ + e_comp_render_queue(); + } + else { _remote_surface_changed_buff_protocol_send(surface, TIZEN_REMOTE_SURFACE_BUFFER_TYPE_TBM, @@ -3111,22 +3097,7 @@ _e_comp_wl_remote_surface_state_commit(E_Client *ec, E_Comp_Wl_Surface_State *st 0, EINA_TRUE, buffer, NULL, EINA_FALSE); - continue; } - - bind_ec_cdata = e_client_cdata_get(surface->bind_ec); - if (!bind_ec_cdata) continue; - - bind_ec_cdata->pending.buffer_viewport = bind_ec_cdata->scaler.buffer_viewport; - _e_comp_wl_remote_surface_state_buffer_set(&bind_ec_cdata->pending, buffer); - bind_ec_cdata->pending.sx = sx; - bind_ec_cdata->pending.sy = sy; - bind_ec_cdata->pending.new_attach = EINA_TRUE; - - e_comp_wl_surface_commit(surface->bind_ec); - - /* need to prepare hwc whenever buffer changed */ - e_comp_render_queue(); } } else if ((source = _remote_source_find(ec))) @@ -3151,13 +3122,6 @@ _e_comp_wl_remote_surface_subsurface_commit(E_Comp_Wl_Remote_Provider *parent_pr int x, y, w, h; Eina_Bool first_skip = EINA_TRUE; E_Comp_Wl_Buffer *buffer; - E_Comp_Wl_Client_Data *cdata = NULL; - E_Comp_Wl_Client_Data *common_cdata = NULL; - - if (!ec) return EINA_FALSE; - - cdata = e_client_cdata_get(ec); - if (!cdata) return EINA_FALSE; if (!e_comp_wl_subsurface_commit(ec)) return EINA_FALSE; @@ -3172,11 +3136,10 @@ _e_comp_wl_remote_surface_subsurface_commit(E_Comp_Wl_Remote_Provider *parent_pr if (!evas_object_visible_get(ec->frame)) return EINA_TRUE; - sdata = cdata->sub.data; + sdata = ec->comp_data->sub.data; evas_object_geometry_get(ec->frame, &fx, &fy, &fw, &fh); - common_cdata = e_client_cdata_get(parent_provider->common.ec); - EINA_LIST_FOREACH(common_cdata->remote_surface.regions, l, rect) + EINA_LIST_FOREACH(parent_provider->common.ec->comp_data->remote_surface.regions, l, rect) { E_Comp_Wl_Remote_Region *region; @@ -3196,8 +3159,8 @@ _e_comp_wl_remote_surface_subsurface_commit(E_Comp_Wl_Remote_Provider *parent_pr continue; } - w = cdata->width_from_viewport; - h = cdata->height_from_viewport; + w = ec->comp_data->width_from_viewport; + h = ec->comp_data->height_from_viewport; /* consider scale? * w = (int) (w * ((double)rect->w / parent_provider->ec->w)); @@ -3259,7 +3222,7 @@ e_comp_wl_remote_surface_bound_provider_ec_get(E_Client *ec) EINA_SAFETY_ON_NULL_RETURN_VAL(ec, NULL); EINA_SAFETY_ON_TRUE_RETURN_VAL(e_object_is_del(E_OBJECT(ec)), NULL); - EINA_SAFETY_ON_NULL_RETURN_VAL(e_client_cdata_get(ec), NULL); + EINA_SAFETY_ON_NULL_RETURN_VAL(ec->comp_data, NULL); remote_surface = eina_hash_find(_rsm->bind_surface_hash, &ec); if (!remote_surface || !remote_surface->provider) return NULL; @@ -3270,50 +3233,45 @@ e_comp_wl_remote_surface_bound_provider_ec_get(E_Client *ec) EINTERN Eina_Bool e_comp_wl_remote_surface_commit(E_Client *ec) { - E_Comp_Wl_Client_Data *parent_cdata = NULL; E_Comp_Wl_Remote_Provider *provider; E_Comp_Wl_Remote_Source *source = NULL; E_Comp_Wl_Subsurf_Data *sdata, *ssdata; E_Client *offscreen_parent; - E_Comp_Wl_Client_Data *cdata = NULL; EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE); EINA_SAFETY_ON_TRUE_RETURN_VAL(e_object_is_del(E_OBJECT(ec)), EINA_FALSE); - - cdata = e_client_cdata_get(ec); - EINA_SAFETY_ON_NULL_RETURN_VAL(cdata, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(ec->comp_data, EINA_FALSE); source = _remote_source_find(ec); if (source) { if (source->common.is_offscreen) { - _e_comp_wl_remote_surface_state_commit(ec, &cdata->pending); + _e_comp_wl_remote_surface_state_commit(ec, &ec->comp_data->pending); return EINA_TRUE; } //send update to remote_surface of source client - _e_comp_wl_remote_surface_source_update(source, cdata->pending.buffer, EINA_TRUE); + _e_comp_wl_remote_surface_source_update(source, ec->comp_data->pending.buffer, EINA_TRUE); //do normal commit callback process return EINA_FALSE; } /* subsurface case */ - if ((sdata = cdata->sub.data)) + if ((sdata = ec->comp_data->sub.data)) { /* check for valid subcompositor data */ if (!sdata->parent) return EINA_FALSE; - if (e_object_is_del(E_OBJECT(sdata->parent))) + if (!sdata->parent->comp_data) return EINA_FALSE; - parent_cdata = e_client_cdata_get(sdata->parent); - if (!parent_cdata) + if (e_object_is_del(E_OBJECT(sdata->parent))) return EINA_FALSE; - if (!(ssdata = parent_cdata->sub.data)) + if (!(ssdata = sdata->parent->comp_data->sub.data)) return EINA_FALSE; if (!ssdata->remote_surface.offscreen_parent) @@ -3332,7 +3290,7 @@ e_comp_wl_remote_surface_commit(E_Client *ec) if (!(provider = _remote_provider_find(ec))) return EINA_FALSE; - _e_comp_wl_remote_surface_state_commit(ec, &cdata->pending); + _e_comp_wl_remote_surface_state_commit(ec, &ec->comp_data->pending); return EINA_TRUE; } diff --git a/src/bin/e_comp_wl_shell.c b/src/bin/e_comp_wl_shell.c index c01e8292b9..71afc7e005 100644 --- a/src/bin/e_comp_wl_shell.c +++ b/src/bin/e_comp_wl_shell.c @@ -19,8 +19,6 @@ static Eina_Hash *xdg_sh_hash = NULL; EINTERN Eina_Bool e_shell_e_client_shell_assignable_check(E_Client *ec) { - E_Comp_Wl_Client_Data *cdata = NULL; - EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE); if (e_object_is_del(E_OBJECT(ec))) @@ -29,16 +27,13 @@ e_shell_e_client_shell_assignable_check(E_Client *ec) ec); return EINA_FALSE; } - - cdata = e_client_cdata_get(ec); - if (!cdata) + else if (!ec->comp_data) { - ELOGF("SHELL", "ERR: Could not assign shell: No E_Comp_Wl_Client_Data", + ELOGF("SHELL", "ERR: Could not assign shell: No E_Comp_Client_Data", ec); return EINA_FALSE; } - - if (cdata->shell.surface) + else if (ec->comp_data->shell.surface) { ELOGF("SHELL", "ERR: Could not assign shell: Already assigned", ec); @@ -53,15 +48,15 @@ e_shell_e_client_shsurface_assign(E_Client *ec, struct wl_resource *shsurface, E_Shell_Surface_Api *api) { - E_Comp_Wl_Client_Data *cdata; + E_Comp_Client_Data *cdata; EINA_SAFETY_ON_NULL_RETURN(ec); EINA_SAFETY_ON_NULL_RETURN(shsurface); - cdata = e_client_cdata_get(ec); + cdata = ec->comp_data; if (!cdata) { - ELOGF("SHELL", "ERR: E_Client must have E_Comp_Wl_Client_Data", + ELOGF("SHELL", "ERR: E_Client must have E_Comp_Client_Data", ec); return; } @@ -83,15 +78,15 @@ e_shell_e_client_shsurface_assign(E_Client *ec, EINTERN void e_shell_e_client_shsurface_api_set(E_Client *ec, E_Shell_Surface_Api *api) { - E_Comp_Wl_Client_Data *cdata; + E_Comp_Client_Data *cdata; EINA_SAFETY_ON_NULL_RETURN(ec); EINA_SAFETY_ON_NULL_RETURN(api); - cdata = e_client_cdata_get(ec); + cdata = ec->comp_data; if (!cdata) { - ELOGF("SHELL", "ERR: E_Client must have E_Comp_Wl_Client_Data", + ELOGF("SHELL", "ERR: E_Client must have E_Comp_Client_Data", ec); return; } @@ -106,20 +101,10 @@ e_shell_e_client_shsurface_api_set(E_Client *ec, E_Shell_Surface_Api *api) EINTERN void e_shell_e_client_toplevel_set(E_Client *ec) { - E_Comp_Wl_Client_Data *cdata; - EINA_SAFETY_ON_NULL_RETURN(ec); ELOGF("SHELL", "Set toplevel", ec); - cdata = e_client_cdata_get(ec); - if (!cdata) - { - ELOGF("SHELL", "ERR: E_Client must have E_Comp_Wl_Client_Data", - ec); - return; - } - /* set toplevel client properties */ if (!ec->internal) ec->borderless = 1; @@ -128,26 +113,16 @@ e_shell_e_client_toplevel_set(E_Client *ec) ec->border.changed = ec->changes.border = !ec->borderless; if (ec->netwm.type == E_WINDOW_TYPE_UNKNOWN) ec->netwm.type = E_WINDOW_TYPE_NORMAL; - cdata->set_win_type = EINA_TRUE; + ec->comp_data->set_win_type = EINA_TRUE; } EINTERN void e_shell_e_client_popup_set(E_Client *ec) { - E_Comp_Wl_Client_Data *cdata; - EINA_SAFETY_ON_NULL_RETURN(ec); ELOGF("SHELL", "Set popup", ec); - cdata = e_client_cdata_get(ec); - if (!cdata) - { - ELOGF("SHELL", "ERR: E_Client must have E_Comp_Wl_Client_Data", - ec); - return; - } - EC_CHANGED(ec); ec->new_client = ec->override = 1; e_client_unignore(ec); @@ -159,7 +134,7 @@ e_shell_e_client_popup_set(E_Client *ec) ec->border.changed = ec->changes.border = !ec->borderless; ec->changes.icon = !!ec->icccm.class; ec->netwm.type = E_WINDOW_TYPE_POPUP_MENU; - cdata->set_win_type = EINA_TRUE; + ec->comp_data->set_win_type = EINA_TRUE; e_client_layer_set(ec, E_LAYER_CLIENT_POPUP); } @@ -414,8 +389,6 @@ e_shell_e_client_interactive_resize(E_Client *ec, EINTERN void e_shell_e_client_destroy(E_Client *ec) { - E_Comp_Wl_Client_Data *cdata = NULL; - EINA_SAFETY_ON_NULL_RETURN(ec); ELOGF("SHELL", "Destroy shell surface", ec); @@ -441,23 +414,22 @@ e_shell_e_client_destroy(E_Client *ec) if (e_object_unref(E_OBJECT(ec)) == 0) return; - cdata = e_client_cdata_get(ec); - if (!e_object_is_del(E_OBJECT(ec)) && !cdata) + if (!e_object_is_del(E_OBJECT(ec))) { - if (cdata->mapped) + if (ec->comp_data->mapped) { - if ((cdata->shell.surface) && - (cdata->shell.unmap)) + if ((ec->comp_data->shell.surface) && + (ec->comp_data->shell.unmap)) { ELOGF("SHELL", "Call shell.unmap by destory surface", ec); - cdata->shell.unmap(cdata->shell.surface); + ec->comp_data->shell.unmap(ec->comp_data->shell.surface); } } e_policy_client_unmap(ec); } - if (cdata) - cdata->shell.surface = NULL; + if (ec->comp_data) + ec->comp_data->shell.surface = NULL; } static void @@ -583,7 +555,6 @@ static void _e_shell_surface_cb_popup_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, struct wl_resource *seat_resource EINA_UNUSED, uint32_t serial EINA_UNUSED, struct wl_resource *parent_resource, int32_t x, int32_t y, uint32_t flags EINA_UNUSED) { E_Client *ec; - E_Comp_Wl_Client_Data *cdata; if (!(ec = wl_resource_get_user_data(resource))) { @@ -592,11 +563,10 @@ _e_shell_surface_cb_popup_set(struct wl_client *client EINA_UNUSED, struct wl_re return; } - cdata = e_client_cdata_get(ec); - if (cdata) + if (ec->comp_data) { - cdata->popup.x = x; - cdata->popup.y = y; + ec->comp_data->popup.x = x; + ec->comp_data->popup.y = y; } if (!ec->internal) @@ -606,8 +576,8 @@ _e_shell_surface_cb_popup_set(struct wl_client *client EINA_UNUSED, struct wl_re ec->border.changed = ec->changes.border = !ec->borderless; ec->changes.icon = !!ec->icccm.class; ec->netwm.type = E_WINDOW_TYPE_POPUP_MENU; - if (cdata) - cdata->set_win_type = EINA_TRUE; + if (ec->comp_data) + ec->comp_data->set_win_type = EINA_TRUE; ec->layer = E_LAYER_CLIENT_POPUP; /* set this client as a transient for parent */ @@ -711,7 +681,6 @@ static void _e_shell_surface_configure(struct wl_resource *resource, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h) { E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; if (!resource) return; @@ -724,20 +693,17 @@ _e_shell_surface_configure(struct wl_resource *resource, Evas_Coord x, Evas_Coor return; } - cdata = e_client_cdata_get(ec); - if (!cdata) return; - if (ec->parent) { if ((ec->netwm.type == E_WINDOW_TYPE_MENU) || (ec->netwm.type == E_WINDOW_TYPE_POPUP_MENU) || (ec->netwm.type == E_WINDOW_TYPE_DROPDOWN_MENU)) { - x = E_CLAMP(ec->parent->client.x + cdata->popup.x, + x = E_CLAMP(ec->parent->client.x + ec->comp_data->popup.x, ec->parent->client.x, ec->parent->client.x + ec->parent->client.w - ec->client.w); - y = E_CLAMP(ec->parent->client.y + cdata->popup.y, + y = E_CLAMP(ec->parent->client.y + ec->comp_data->popup.y, ec->parent->client.y, ec->parent->client.y + ec->parent->client.h - ec->client.h); @@ -751,7 +717,6 @@ static void _e_shell_surface_ping(struct wl_resource *resource) { E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; uint32_t serial; if (!resource) @@ -766,21 +731,14 @@ _e_shell_surface_ping(struct wl_resource *resource) return; } - cdata = e_client_cdata_get(ec); - if (!cdata) return; - serial = wl_display_next_serial(e_comp_wl->wl.disp); - wl_shell_surface_send_ping(cdata->shell.surface, serial); + wl_shell_surface_send_ping(ec->comp_data->shell.surface, serial); } static void _e_shell_client_map_common_pre(E_Client *ec) { - E_Comp_Wl_Client_Data *cdata = NULL; - if (!ec) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; e_comp_object_signal_emit(ec->frame, "e,state,map", "e"); @@ -800,17 +758,13 @@ _e_shell_client_map_common_pre(E_Client *ec) /* map this surface if needed */ ec->visible = EINA_TRUE; evas_object_show(ec->frame); - cdata->mapped = EINA_TRUE; + ec->comp_data->mapped = EINA_TRUE; } static void _e_shell_client_map_common_post(E_Client *ec) { - E_Comp_Wl_Client_Data *cdata = NULL; - if (!ec) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; if ((!ec->iconic) && (!e_client_util_ignored_get(ec))) { @@ -823,7 +777,7 @@ _e_shell_client_map_common_post(E_Client *ec) ec->post_raise = EINA_FALSE; } - if (!cdata->sub.data) + if (!ec->comp_data->sub.data) { if (ec->post_lower) { @@ -859,7 +813,6 @@ static void _e_shell_surface_map(struct wl_resource *resource) { E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; if (!resource) return; @@ -873,11 +826,8 @@ _e_shell_surface_map(struct wl_resource *resource) return; } - cdata = e_client_cdata_get(ec); - if (!cdata) return; - /* map this surface if needed */ - if ((!cdata->mapped) && (e_pixmap_usable_get(ec->pixmap))) + if ((!ec->comp_data->mapped) && (e_pixmap_usable_get(ec->pixmap))) { ELOGF("SHELL", "Map window |win:0x%08x|ec_size:%d,%d|pid:%d|title:%s, name:%s", @@ -1045,7 +995,6 @@ static void _e_xdg_shell_surface_cb_parent_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, struct wl_resource *parent_resource) { E_Client *ec, *pc; - E_Comp_Wl_Client_Data *parent_cdata = NULL; if (!(ec = wl_resource_get_user_data(resource))) { @@ -1061,9 +1010,8 @@ _e_xdg_shell_surface_cb_parent_set(struct wl_client *client EINA_UNUSED, struct ERR("Could not get parent resource clinet"); return; } - parent_cdata = e_client_cdata_get(pc); - if (!parent_cdata) return; - parent_resource = parent_cdata->surface; + if (!pc->comp_data) return; + parent_resource = pc->comp_data->surface; } /* set this client as a transient for parent */ @@ -1173,7 +1121,6 @@ static void _e_xdg_shell_surface_cb_window_geometry_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, int32_t x, int32_t y, int32_t w, int32_t h) { E_Client *ec; - E_Comp_Wl_Client_Data *cdata= NULL; ec = wl_resource_get_user_data(resource); if (!ec) @@ -1182,10 +1129,7 @@ _e_xdg_shell_surface_cb_window_geometry_set(struct wl_client *client EINA_UNUSED "No Client For Shell Surface"); return; } - cdata = e_client_cdata_get(ec); - if (!cdata) return; - - EINA_RECTANGLE_SET(&cdata->shell.window, x, y, w, h); + EINA_RECTANGLE_SET(&ec->comp_data->shell.window, x, y, w, h); } static void @@ -1316,7 +1260,6 @@ static void _e_xdg_shell_surface_configure(struct wl_resource *resource, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h) { E_Client *ec; - E_Comp_Wl_Client_Data *cdata= NULL; if (!resource) return; @@ -1335,18 +1278,14 @@ _e_xdg_shell_surface_configure(struct wl_resource *resource, Evas_Coord x, Evas_ (ec->netwm.type == E_WINDOW_TYPE_POPUP_MENU) || (ec->netwm.type == E_WINDOW_TYPE_DROPDOWN_MENU)) { - cdata = e_client_cdata_get(ec); - if (cdata) - { - x = E_CLAMP(ec->parent->client.x + cdata->popup.x, - ec->parent->client.x, - ec->parent->client.x + - ec->parent->client.w - ec->client.w); - y = E_CLAMP(ec->parent->client.y + cdata->popup.y, - ec->parent->client.y, - ec->parent->client.y + - ec->parent->client.h - ec->client.h); - } + x = E_CLAMP(ec->parent->client.x + ec->comp_data->popup.x, + ec->parent->client.x, + ec->parent->client.x + + ec->parent->client.w - ec->client.w); + y = E_CLAMP(ec->parent->client.y + ec->comp_data->popup.y, + ec->parent->client.y, + ec->parent->client.y + + ec->parent->client.h - ec->client.h); } } @@ -1392,15 +1331,11 @@ static Eina_Bool _e_xdg_shell_surface_map_cb_timer(void *data) { E_Client *ec = data; - E_Comp_Wl_Client_Data *cdata = NULL; if (!ec) return ECORE_CALLBACK_CANCEL; if (e_object_is_del(E_OBJECT(ec))) return ECORE_CALLBACK_CANCEL; - cdata = e_client_cdata_get(ec); - if (!cdata) return ECORE_CALLBACK_CANCEL; - - if ((!cdata->mapped) && (e_pixmap_usable_get(ec->pixmap))) + if ((!ec->comp_data->mapped) && (e_pixmap_usable_get(ec->pixmap))) { ELOGF("SHELL", "Map window by map_timer |win:0x%08x|ec_size:%d,%d|pid:%d|title:%s, name:%s", @@ -1432,7 +1367,6 @@ _e_xdg_shell_surface_map_cb_timer(void *data) EINTERN void e_shell_e_client_map(E_Client *ec) { - E_Comp_Wl_Client_Data *cdata = NULL; int pw = 0; int ph = 0; int cw; @@ -1440,10 +1374,7 @@ e_shell_e_client_map(E_Client *ec) EINA_SAFETY_ON_NULL_RETURN(ec); - cdata = e_client_cdata_get(ec); - EINA_SAFETY_ON_NULL_RETURN(cdata); - - if (cdata->mapped) + if (ec->comp_data->mapped) { ELOGF("SHELL", "Map window | Already mapped.", ec); return; @@ -1530,12 +1461,10 @@ _e_xdg_shell_surface_map(struct wl_resource *resource) EINTERN void e_shell_e_client_unmap(E_Client *ec) { - E_Comp_Wl_Client_Data *cdata = NULL; E_FREE_FUNC(ec->map_timer, ecore_timer_del); - cdata = e_client_cdata_get(ec); - if (cdata->mapped) + if (ec->comp_data->mapped) { e_comp_object_signal_emit(ec->frame, "e,state,unmap", "e"); @@ -1544,7 +1473,7 @@ e_shell_e_client_unmap(E_Client *ec) ec->visible = EINA_FALSE; evas_object_hide(ec->frame); - cdata->mapped = EINA_FALSE; + ec->comp_data->mapped = EINA_FALSE; ec->visibility.last_sent_type = E_VISIBILITY_UNKNOWN; ELOGF("SHELL", @@ -1648,7 +1577,7 @@ static void _e_xdg_shell_cb_popup_get(struct wl_client *client, struct wl_resource *resource EINA_UNUSED, uint32_t id, struct wl_resource *surface_resource, struct wl_resource *parent_resource, struct wl_resource *seat_resource EINA_UNUSED, uint32_t serial EINA_UNUSED, int32_t x, int32_t y) { E_Client *ec; - E_Comp_Wl_Client_Data *cdata; + E_Comp_Client_Data *cdata; struct wl_resource *shsurf_resource; E_Shell_Surface_Api api = { .configure_send = _e_xdg_shell_surface_configure_send, @@ -1705,7 +1634,7 @@ _e_xdg_shell_cb_popup_get(struct wl_client *client, struct wl_resource *resource /* set this client as a transient for parent */ e_shell_e_client_parent_set(ec, parent_resource); - cdata = e_client_cdata_get(ec); + cdata = ec->comp_data; if (ec->parent) { cdata->popup.x = E_CLAMP(x, 0, ec->parent->client.w); diff --git a/src/bin/e_comp_wl_subsurface.c b/src/bin/e_comp_wl_subsurface.c index 303b68240e..f2ba1bb38a 100644 --- a/src/bin/e_comp_wl_subsurface.c +++ b/src/bin/e_comp_wl_subsurface.c @@ -23,26 +23,22 @@ static void _e_comp_wl_subsurface_restack_bg_rectangle(E_Client *ec) { E_Client *bottom = ec; - E_Comp_Wl_Client_Data *cdata = NULL; - E_Comp_Wl_Client_Data *bottom_cdata = NULL; - if (!ec) return; - if (e_object_is_del(E_OBJECT(ec))) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; - if (!cdata->sub.below_obj) return; + if (!ec || !ec->comp_data || e_object_is_del(E_OBJECT(ec))) + return; + + if (!ec->comp_data->sub.below_obj) + return; while (bottom) { short layer = evas_object_layer_get(bottom->frame); - if (evas_object_layer_get(cdata->sub.below_obj) != layer) - evas_object_layer_set(cdata->sub.below_obj, layer); - - evas_object_stack_below(cdata->sub.below_obj, bottom->frame); + if (evas_object_layer_get(ec->comp_data->sub.below_obj) != layer) + evas_object_layer_set(ec->comp_data->sub.below_obj, layer); - bottom_cdata = e_client_cdata_get(bottom); - bottom = eina_list_nth(bottom_cdata->sub.below_list, 0); + evas_object_stack_below(ec->comp_data->sub.below_obj, bottom->frame); + bottom = eina_list_nth(bottom->comp_data->sub.below_list, 0); } } @@ -50,85 +46,75 @@ static void _e_comp_wl_subsurface_restack(E_Client *ec) { E_Client *subc, *temp; - E_Comp_Wl_Client_Data *cdata = NULL; Eina_List *l; - if (!ec) return; - if (e_object_is_del(E_OBJECT(ec))) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; + if (!ec || !ec->comp_data || e_object_is_del(E_OBJECT(ec))) return; - if (cdata->sub.restacking) + if (ec->comp_data->sub.restacking) return; - cdata->sub.restacking = EINA_TRUE; + ec->comp_data->sub.restacking = EINA_TRUE; temp = ec; - EINA_LIST_FOREACH(cdata->sub.list, l, subc) + EINA_LIST_FOREACH(ec->comp_data->sub.list, l, subc) { - if (!subc || e_object_is_del(E_OBJECT(subc))) continue; - if (!e_client_cdata_get(subc)) continue; + if (!subc || !subc->comp_data || e_object_is_del(E_OBJECT(subc))) continue; e_client_stack_above(subc, temp); temp = subc; } temp = ec; - EINA_LIST_REVERSE_FOREACH(cdata->sub.below_list, l, subc) + EINA_LIST_REVERSE_FOREACH(ec->comp_data->sub.below_list, l, subc) { - if (!subc || e_object_is_del(E_OBJECT(subc))) continue; - if (!e_client_cdata_get(subc)) continue; + if (!subc || !subc->comp_data || e_object_is_del(E_OBJECT(subc))) continue; e_client_stack_below(subc, temp); temp = subc; } - EINA_LIST_FOREACH(cdata->sub.list, l, subc) + EINA_LIST_FOREACH(ec->comp_data->sub.list, l, subc) _e_comp_wl_subsurface_restack(subc); - EINA_LIST_REVERSE_FOREACH(cdata->sub.below_list, l, subc) + EINA_LIST_REVERSE_FOREACH(ec->comp_data->sub.below_list, l, subc) _e_comp_wl_subsurface_restack(subc); - cdata->sub.restacking = EINA_FALSE; + ec->comp_data->sub.restacking = EINA_FALSE; } static void _e_comp_wl_subsurface_bg_evas_cb_resize(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED) { E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; if (!(ec = data)) return; if (e_object_is_del(E_OBJECT(ec))) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; + if (!ec->comp_data) return; - if (cdata->sub.below_obj) - evas_object_resize(cdata->sub.below_obj, ec->w, ec->h); + if (ec->comp_data->sub.below_obj) + evas_object_resize(ec->comp_data->sub.below_obj, ec->w, ec->h); } static Eina_Bool _e_comp_wl_subsurface_video_has(E_Client *ec) { E_Client *subc; - E_Comp_Wl_Client_Data *cdata = NULL; Eina_List *l; if (!ec) return EINA_FALSE; if (e_object_is_del(E_OBJECT(ec))) return EINA_FALSE; - cdata = e_client_cdata_get(ec); - if (!cdata) return EINA_FALSE; + if (!ec->comp_data) return EINA_FALSE; - if ((cdata->video_client) || + if ((ec->comp_data->video_client) || (e_client_video_hw_composition_check(ec))) return EINA_TRUE; - if (cdata->has_video_client) + if (ec->comp_data->has_video_client) return EINA_TRUE; - EINA_LIST_FOREACH(cdata->sub.below_list_pending, l, subc) + EINA_LIST_FOREACH(ec->comp_data->sub.below_list_pending, l, subc) if (_e_comp_wl_subsurface_video_has(subc)) return EINA_TRUE; - EINA_LIST_FOREACH(cdata->sub.below_list, l, subc) + EINA_LIST_FOREACH(ec->comp_data->sub.below_list, l, subc) if (_e_comp_wl_subsurface_video_has(subc)) return EINA_TRUE; @@ -138,14 +124,9 @@ _e_comp_wl_subsurface_video_has(E_Client *ec) static void _e_comp_wl_subsurface_below_obj_create(E_Client *ec) { - E_Comp_Wl_Client_Data *cdata = NULL; Evas_Object *below_obj; short layer; - if (!ec) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; - /* create a bg rectangle if topmost window is 24 depth window */ below_obj = evas_object_rectangle_add(e_comp->evas); EINA_SAFETY_ON_NULL_RETURN(below_obj); @@ -165,7 +146,7 @@ _e_comp_wl_subsurface_below_obj_create(E_Client *ec) if (evas_object_visible_get(ec->frame)) evas_object_show(below_obj); - cdata->sub.below_obj = below_obj; + ec->comp_data->sub.below_obj = below_obj; ELOGF("COMP", " |bg_rectangle(%p) created", ec, below_obj); @@ -195,37 +176,31 @@ _e_comp_wl_subsurface_below_obj_create(E_Client *ec) static void _e_comp_wl_subsurface_below_obj_destroy(E_Client *ec) { - E_Comp_Wl_Client_Data *cdata = NULL; - - cdata = e_client_cdata_get(ec); - if (!cdata) return; - - ELOGF("COMP", " |bg_rectangle(%p) delete", ec, cdata->sub.below_obj); - E_FREE_FUNC(cdata->sub.below_obj, evas_object_del); + ELOGF("COMP", " |bg_rectangle(%p) delete", ec, ec->comp_data->sub.below_obj); + E_FREE_FUNC(ec->comp_data->sub.below_obj, evas_object_del); } static void _e_comp_wl_subsurface_check_below_bg_rectangle(E_Client *ec) { E_Client *topmost; - E_Comp_Wl_Client_Data *topmost_cdata = NULL; topmost = e_comp_wl_topmost_parent_get(ec); if (!topmost) return; - if ((!topmost_cdata) || + if ((!topmost->comp_data) || (e_object_is_del(E_OBJECT(topmost)))) return; if (_e_comp_wl_subsurface_data_get(topmost)) return; - if (topmost_cdata->sub.below_obj) + if (topmost->comp_data->sub.below_obj) { if ((topmost->argb) || - ((!topmost_cdata->sub.below_list) && - (!topmost_cdata->sub.below_list_pending) && + ((!topmost->comp_data->sub.below_list) && + (!topmost->comp_data->sub.below_list_pending) && (!_e_comp_wl_subsurface_video_has(topmost)))) { ELOGF("COMP", "below_obj becomes useless. argb(%d)", @@ -236,8 +211,8 @@ _e_comp_wl_subsurface_check_below_bg_rectangle(E_Client *ec) else { if ((!topmost->argb) && - ((topmost_cdata->sub.below_list) || - (topmost_cdata->sub.below_list_pending) || + ((topmost->comp_data->sub.below_list) || + (topmost->comp_data->sub.below_list_pending) || (_e_comp_wl_subsurface_video_has(topmost)))) { ELOGF("COMP", "it has below subsurfaces and video.", topmost); @@ -250,41 +225,32 @@ static void _e_comp_wl_subsurface_show(E_Client *ec) { E_Client *subc; - E_Comp_Wl_Client_Data *cdata = NULL; - E_Comp_Wl_Client_Data *subc_cdata = NULL; Eina_List *l; - if (!ec) return; - if (e_object_is_del(E_OBJECT(ec))) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; + if (!ec->comp_data || e_object_is_del(E_OBJECT(ec))) return; - EINA_LIST_FOREACH(cdata->sub.list, l, subc) + EINA_LIST_FOREACH(ec->comp_data->sub.list, l, subc) { - if (e_object_is_del(E_OBJECT(subc))) continue; - subc_cdata = e_client_cdata_get(subc); - if (!subc_cdata) continue; + if (!subc->comp_data || e_object_is_del(E_OBJECT(subc))) continue; - if (e_pixmap_resource_get(subc->pixmap) && !subc_cdata->mapped) + if (e_pixmap_resource_get(subc->pixmap) && !subc->comp_data->mapped) { subc->visible = EINA_TRUE; evas_object_show(subc->frame); - subc_cdata->mapped = 1; + subc->comp_data->mapped = 1; } _e_comp_wl_subsurface_show(subc); } - EINA_LIST_FOREACH(cdata->sub.below_list, l, subc) + EINA_LIST_FOREACH(ec->comp_data->sub.below_list, l, subc) { - if (e_object_is_del(E_OBJECT(subc))) continue; - subc_cdata = e_client_cdata_get(subc); - if (!subc_cdata) continue; + if (!subc->comp_data || e_object_is_del(E_OBJECT(subc))) continue; - if (e_pixmap_resource_get(subc->pixmap) && !subc_cdata->mapped) + if (e_pixmap_resource_get(subc->pixmap) && !subc->comp_data->mapped) { subc->visible = EINA_TRUE; evas_object_show(subc->frame); - subc_cdata->mapped = 1; + subc->comp_data->mapped = 1; } _e_comp_wl_subsurface_show(subc); } @@ -294,44 +260,35 @@ static void _e_comp_wl_subsurface_hide(E_Client *ec) { E_Client *subc; - E_Comp_Wl_Client_Data *cdata = NULL; - E_Comp_Wl_Client_Data *sub_cdata = NULL; Eina_List *l; - if (!ec) return; - if (e_object_is_del(E_OBJECT(ec))) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; - - EINA_LIST_FOREACH(cdata->sub.list, l, subc) + EINA_LIST_FOREACH(ec->comp_data->sub.list, l, subc) { - sub_cdata = e_client_cdata_get(subc); - if (!sub_cdata || !sub_cdata->sub.data) continue; + if (!subc->comp_data || !subc->comp_data->sub.data) continue; - if (!sub_cdata->sub.data->stand_alone) + if (!subc->comp_data->sub.data->stand_alone) { - if (sub_cdata->mapped) + if (subc->comp_data->mapped) { subc->visible = EINA_FALSE; evas_object_hide(subc->frame); - sub_cdata->mapped = 0; + subc->comp_data->mapped = 0; } _e_comp_wl_subsurface_hide(subc); } } - EINA_LIST_FOREACH(cdata->sub.below_list, l, subc) + EINA_LIST_FOREACH(ec->comp_data->sub.below_list, l, subc) { - sub_cdata = e_client_cdata_get(subc); - if (!sub_cdata || !sub_cdata->sub.data) continue; + if (!subc->comp_data || !subc->comp_data->sub.data) continue; - if (!sub_cdata->sub.data->stand_alone) + if (!subc->comp_data->sub.data->stand_alone) { - if (sub_cdata->mapped) + if (subc->comp_data->mapped) { subc->visible = EINA_FALSE; evas_object_hide(subc->frame); - sub_cdata->mapped = 0; + subc->comp_data->mapped = 0; } _e_comp_wl_subsurface_hide(subc); } @@ -342,35 +299,28 @@ static E_Client* _e_comp_wl_subsurface_invisible_parent_get(E_Client *ec) { E_Client *parent = NULL; - E_Comp_Wl_Client_Data *cdata = NULL; - E_Comp_Wl_Client_Data *parent_cdata = NULL; - if (!ec) return NULL; - if (e_object_is_del(E_OBJECT(ec))) return NULL; - cdata = e_client_cdata_get(ec); - if (!cdata) return NULL; - if (!cdata->sub.data) return NULL; + if (!ec->comp_data || e_object_is_del(E_OBJECT(ec)) || !ec->comp_data->sub.data) + return NULL; - parent = cdata->sub.data->parent; + parent = ec->comp_data->sub.data->parent; while (parent) { /* in case of topmost */ - if (e_object_is_del(E_OBJECT(parent))) return NULL; - parent_cdata = e_client_cdata_get(parent); - if (!parent_cdata) return NULL; + if (e_object_is_del(E_OBJECT(parent)) || !parent->comp_data) return NULL; - if (!parent_cdata->sub.data) + if (!parent->comp_data->sub.data) return (!evas_object_visible_get(parent->frame)) ? parent : NULL; if (!evas_object_visible_get(parent->frame)){ if (e_pixmap_resource_get(parent->pixmap)) return parent; - if (!parent_cdata->sub.data->parent) + if (!parent->comp_data->sub.data->parent) return parent; } - parent = parent_cdata->sub.data->parent; + parent = parent->comp_data->sub.data->parent; } return NULL; @@ -380,30 +330,28 @@ static Eina_Bool _e_comp_wl_subsurface_order_commit_recursive(E_Client *ec) { E_Client *subc; - E_Comp_Wl_Client_Data *cdata = NULL; Eina_List *l; - cdata = e_client_cdata_get(ec); - if (!cdata) return EINA_FALSE; + if (!ec->comp_data) return EINA_FALSE; - if (!cdata->sub.list_changed) + if (!ec->comp_data->sub.list_changed) return EINA_FALSE; - cdata->sub.list_changed = EINA_FALSE; + ec->comp_data->sub.list_changed = EINA_FALSE; /* TODO: need to check more complicated subsurface tree */ - EINA_LIST_FOREACH(cdata->sub.list_pending, l, subc) + EINA_LIST_FOREACH(ec->comp_data->sub.list_pending, l, subc) { - cdata->sub.list = eina_list_remove(cdata->sub.list, subc); - cdata->sub.list = eina_list_append(cdata->sub.list, subc); + ec->comp_data->sub.list = eina_list_remove(ec->comp_data->sub.list, subc); + ec->comp_data->sub.list = eina_list_append(ec->comp_data->sub.list, subc); _e_comp_wl_subsurface_order_commit_recursive(subc); } - EINA_LIST_FOREACH(cdata->sub.below_list_pending, l, subc) + EINA_LIST_FOREACH(ec->comp_data->sub.below_list_pending, l, subc) { - cdata->sub.below_list = eina_list_remove(cdata->sub.below_list, subc); - cdata->sub.below_list = eina_list_append(cdata->sub.below_list, subc); + ec->comp_data->sub.below_list = eina_list_remove(ec->comp_data->sub.below_list, subc); + ec->comp_data->sub.below_list = eina_list_append(ec->comp_data->sub.below_list, subc); _e_comp_wl_subsurface_order_commit_recursive(subc); } @@ -427,14 +375,14 @@ _e_comp_wl_subsurface_order_commit(E_Client *ec) static void _e_comp_wl_subsurface_commit_to_cache(E_Client *ec) { - E_Comp_Wl_Client_Data *cdata; + E_Comp_Client_Data *cdata; E_Comp_Wl_Subsurf_Data *sdata; struct wl_resource *cb; Eina_List *l, *ll; Eina_Iterator *itr; Eina_Rectangle *rect; - if (!(cdata = e_client_cdata_get(ec))) return; + if (!(cdata = ec->comp_data)) return; sdata = _e_comp_wl_subsurface_data_get(ec); EINA_SAFETY_ON_NULL_RETURN(sdata); @@ -509,7 +457,6 @@ _e_comp_wl_subsurface_commit_to_cache(E_Client *ec) static void _e_comp_wl_subsurface_commit_from_cache(E_Client *ec) { - E_Comp_Wl_Client_Data *cdata = NULL; E_Comp_Wl_Subsurf_Data *sdata; sdata = _e_comp_wl_subsurface_data_get(ec); @@ -521,8 +468,7 @@ _e_comp_wl_subsurface_commit_from_cache(E_Client *ec) if (!e_comp_object_damage_exists(ec->frame)) { - cdata = e_client_cdata_get(ec); - if ((cdata->video_client) || + if ((ec->comp_data->video_client) || (!e_client_video_hw_composition_check(ec))) e_pixmap_image_clear(ec->pixmap, 1); } @@ -537,7 +483,6 @@ _e_comp_wl_subsurface_commit_from_cache(E_Client *ec) static void _e_comp_wl_subsurface_synchronized_commit(E_Client *ec) { - E_Comp_Wl_Client_Data *cdata = NULL; E_Comp_Wl_Subsurf_Data *sdata; E_Client *subc; Eina_List *l; @@ -548,13 +493,12 @@ _e_comp_wl_subsurface_synchronized_commit(E_Client *ec) if (sdata->cached.has_data) _e_comp_wl_subsurface_commit_from_cache(ec); - cdata = e_client_cdata_get(ec); - EINA_LIST_FOREACH(cdata->sub.list, l, subc) + EINA_LIST_FOREACH(ec->comp_data->sub.list, l, subc) { if (ec != subc) _e_comp_wl_subsurface_parent_commit(subc, EINA_TRUE); } - EINA_LIST_FOREACH(cdata->sub.below_list, l, subc) + EINA_LIST_FOREACH(ec->comp_data->sub.below_list, l, subc) { if (ec != subc) _e_comp_wl_subsurface_parent_commit(subc, EINA_TRUE); @@ -565,13 +509,9 @@ static void _e_comp_wl_subsurface_parent_commit(E_Client *ec, Eina_Bool parent_synchronized) { E_Client *parent; - E_Comp_Wl_Client_Data *cdata = NULL; E_Comp_Wl_Subsurf_Data *sdata; - if (!ec) return; - if (e_object_is_del(E_OBJECT(ec))) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; + if (!ec || e_object_is_del(E_OBJECT(ec)) || !ec->comp_data) return; sdata = _e_comp_wl_subsurface_data_get(ec); EINA_SAFETY_ON_NULL_RETURN(sdata); @@ -599,16 +539,13 @@ static void _e_comp_wl_subsurface_cb_position_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, int32_t x, int32_t y) { E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; E_Comp_Wl_Subsurf_Data *sdata; DBG("Subsurface Cb Position Set: %d", wl_resource_get_id(resource)); ec = wl_resource_get_user_data(resource); - if (!ec) return; - if (e_object_is_del(E_OBJECT(ec))) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; + + if (e_object_is_del(E_OBJECT(ec)) || !ec->comp_data) return; sdata = _e_comp_wl_subsurface_data_get(ec); EINA_SAFETY_ON_NULL_RETURN(sdata); @@ -623,23 +560,19 @@ _subsurface_sibling_check(E_Client *ec1, E_Client *ec2) { E_Client *parent, *sibling; Eina_List *l; - E_Comp_Wl_Client_Data *ec1_cdata = e_client_cdata_get(ec1); - E_Comp_Wl_Client_Data *parent_cdata; - parent = ec1_cdata->sub.data->parent; + parent = ec1->comp_data->sub.data->parent; if (parent == ec2) return EINA_TRUE; - parent_cdata = e_client_cdata_get(parent); - - EINA_LIST_FOREACH(parent_cdata->sub.list_pending, l, sibling) + EINA_LIST_FOREACH(parent->comp_data->sub.list_pending, l, sibling) { if ((sibling != ec1) && (sibling == ec2)) return EINA_TRUE; } - EINA_LIST_FOREACH(parent_cdata->sub.below_list_pending, l, sibling) + EINA_LIST_FOREACH(parent->comp_data->sub.below_list_pending, l, sibling) { if ((sibling != ec1) && (sibling == ec2)) return EINA_TRUE; @@ -653,45 +586,38 @@ _e_comp_wl_subsurface_cb_place_above(struct wl_client *client EINA_UNUSED, struc { E_Client *ec, *ecs; E_Client *parent; - E_Comp_Wl_Client_Data *cdata = NULL; - E_Comp_Wl_Client_Data *ecs_cdata = NULL; - E_Comp_Wl_Client_Data *parent_cdata = NULL; DBG("Subsurface Cb Place Above: %d", wl_resource_get_id(resource)); ec = wl_resource_get_user_data(resource); - if (!ec) return; - if (e_object_is_del(E_OBJECT(ec))) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; - if (!(parent = cdata->sub.data->parent)) return; - if (e_object_is_del(E_OBJECT(parent))) return; - parent_cdata = e_client_cdata_get(parent); - if (!parent_cdata) return; + + if (e_object_is_del(E_OBJECT(ec)) || !ec->comp_data) return; + if (!ec->comp_data->sub.data) return; + + if (!(parent = ec->comp_data->sub.data->parent)) return; + if (e_object_is_del(E_OBJECT(parent)) || !parent->comp_data) return; /* try to get the client from the sibling resource */ if (!(ecs = wl_resource_get_user_data(sibling_resource))) return; - ecs_cdata = e_client_cdata_get(ecs); - if (!ecs_cdata) return; if (!_subsurface_sibling_check(ec, ecs)) { - wl_resource_post_error(ecs_cdata->sub.data->resource, + wl_resource_post_error(ec->comp_data->sub.data->resource, WL_SUBSURFACE_ERROR_BAD_SURFACE, "%s: wl_surface@%d is not a parent or sibling", - "place_above", wl_resource_get_id(ecs_cdata->surface)); + "place_above", wl_resource_get_id(ecs->comp_data->surface)); return; } - if (!ecs_cdata->sub.data) return; + if (!ecs->comp_data->sub.data) return; - parent_cdata->sub.list_pending = - eina_list_remove(parent_cdata->sub.list_pending, ec); + parent->comp_data->sub.list_pending = + eina_list_remove(parent->comp_data->sub.list_pending, ec); - parent_cdata->sub.list_pending = - eina_list_append_relative(parent_cdata->sub.list_pending, ec, ecs); + parent->comp_data->sub.list_pending = + eina_list_append_relative(parent->comp_data->sub.list_pending, ec, ecs); - parent_cdata->sub.list_changed = EINA_TRUE; + parent->comp_data->sub.list_changed = EINA_TRUE; } static void @@ -699,65 +625,51 @@ _e_comp_wl_subsurface_cb_place_below(struct wl_client *client EINA_UNUSED, struc { E_Client *ec, *ecs; E_Client *parent; - E_Comp_Wl_Client_Data *cdata = NULL; - E_Comp_Wl_Client_Data *ecs_cdata = NULL; - E_Comp_Wl_Client_Data *parent_cdata = NULL; DBG("Subsurface Cb Place Below: %d", wl_resource_get_id(resource)); ec = wl_resource_get_user_data(resource); - if (!ec) return; - if (e_object_is_del(E_OBJECT(ec))) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; - if (!cdata->sub.data) return; - if (!(parent = cdata->sub.data->parent)) return; - if (e_object_is_del(E_OBJECT(parent))) return; - parent_cdata = e_client_cdata_get(parent); - if (!parent_cdata) return; + if (e_object_is_del(E_OBJECT(ec)) || !ec->comp_data) return; + if (!ec->comp_data->sub.data) return; + + if (!(parent = ec->comp_data->sub.data->parent)) return; + if (e_object_is_del(E_OBJECT(parent)) || !parent->comp_data) return; /* try to get the client from the sibling resource */ if (!(ecs = wl_resource_get_user_data(sibling_resource))) return; - ecs_cdata = e_client_cdata_get(ecs); - if (!ecs_cdata) return; - if (!ecs_cdata->sub.data) return; - if (!_subsurface_sibling_check(ec, ecs)) { - wl_resource_post_error(ecs_cdata->sub.data->resource, + wl_resource_post_error(ec->comp_data->sub.data->resource, WL_SUBSURFACE_ERROR_BAD_SURFACE, "%s: wl_surface@%d is not a parent or sibling", - "place_below", wl_resource_get_id(ecs_cdata->surface)); + "place_below", wl_resource_get_id(ecs->comp_data->surface)); return; } - if (!ecs_cdata->sub.data) return; + if (!ecs->comp_data->sub.data) return; - parent_cdata->sub.list_pending = - eina_list_remove(parent_cdata->sub.list_pending, ec); + parent->comp_data->sub.list_pending = + eina_list_remove(parent->comp_data->sub.list_pending, ec); - parent_cdata->sub.list_pending = - eina_list_prepend_relative(parent_cdata->sub.list_pending, ec, ecs); + parent->comp_data->sub.list_pending = + eina_list_prepend_relative(parent->comp_data->sub.list_pending, ec, ecs); - parent_cdata->sub.list_changed = EINA_TRUE; + parent->comp_data->sub.list_changed = EINA_TRUE; } static void _e_comp_wl_subsurface_cb_sync_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource) { E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; E_Comp_Wl_Subsurf_Data *sdata; DBG("Subsurface Cb Sync Set: %d", wl_resource_get_id(resource)); ec = wl_resource_get_user_data(resource); - if (!ec) return; - if (e_object_is_del(E_OBJECT(ec))) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; + + if (e_object_is_del(E_OBJECT(ec)) || !ec->comp_data) return; sdata = _e_comp_wl_subsurface_data_get(ec); EINA_SAFETY_ON_NULL_RETURN(sdata); @@ -769,16 +681,13 @@ static void _e_comp_wl_subsurface_cb_desync_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource) { E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; E_Comp_Wl_Subsurf_Data *sdata; DBG("Subsurface Cb Desync Set: %d", wl_resource_get_id(resource)); ec = wl_resource_get_user_data(resource); - if (!ec) return; - if (e_object_is_del(E_OBJECT(ec))) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; + + if (e_object_is_del(E_OBJECT(ec)) || !ec->comp_data) return; sdata = _e_comp_wl_subsurface_data_get(ec); EINA_SAFETY_ON_NULL_RETURN(sdata); @@ -812,7 +721,6 @@ static void _e_comp_wl_subcompositor_cb_subsurface_get(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, uint32_t id, struct wl_resource *surface_resource, struct wl_resource *parent_resource) { E_Client *ec, *epc = NULL; - E_Comp_Wl_Client_Data *cdata = NULL; static const char where[] = "get_subsurface: wl_subsurface@"; if (!(ec = wl_resource_get_user_data(surface_resource))) return; @@ -829,9 +737,8 @@ _e_comp_wl_subcompositor_cb_subsurface_get(struct wl_client *client EINA_UNUSED, if (e_object_is_del(E_OBJECT(ec))) return; if (e_object_is_del(E_OBJECT(epc))) return; - cdata = e_client_cdata_get(ec); /* check if this surface is already a sub-surface */ - if ((cdata) && (cdata->sub.data)) + if ((ec->comp_data) && (ec->comp_data->sub.data)) { wl_resource_post_error(resource, WL_SUBCOMPOSITOR_ERROR_BAD_SURFACE, @@ -916,42 +823,36 @@ static void _e_comp_wl_surface_sub_list_free(Eina_List *sub_list) { E_Client *subc; - E_Comp_Wl_Client_Data *subc_cdata = NULL; EINA_LIST_FREE(sub_list, subc) { - subc_cdata = e_client_cdata_get(subc); - if (!subc_cdata || !subc_cdata->sub.data) continue; + if (!subc->comp_data || !subc->comp_data->sub.data) continue; - subc_cdata->sub.data->parent = NULL; + subc->comp_data->sub.data->parent = NULL; - if (subc_cdata->sub.watcher) - tizen_subsurface_watcher_send_message(subc_cdata->sub.watcher, TIZEN_SUBSURFACE_WATCHER_MSG_PARENT_ID_DESTROYED); + if (subc->comp_data->sub.watcher) + tizen_subsurface_watcher_send_message(subc->comp_data->sub.watcher, TIZEN_SUBSURFACE_WATCHER_MSG_PARENT_ID_DESTROYED); } } static void _e_comp_wl_subsurface_cb_ec_del(void *data EINA_UNUSED, E_Client *ec) { - E_Comp_Wl_Client_Data *cdata = NULL; - - if (!ec) return; - /* make sure this is a wayland client */ if (e_pixmap_type_get(ec->pixmap) != E_PIXMAP_TYPE_WL) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; + if (!ec->comp_data) + return; - if (cdata->sub.data) + if (ec->comp_data->sub.data) { - if (cdata->sub.data->parent) - _e_comp_wl_subsurface_remove_from_parent(cdata->sub.data->parent, ec); - _e_comp_wl_subsurface_data_destroy(cdata->sub.data); - cdata->sub.data = NULL; + if (ec->comp_data->sub.data->parent) + _e_comp_wl_subsurface_remove_from_parent(ec->comp_data->sub.data->parent, ec); + _e_comp_wl_subsurface_data_destroy(ec->comp_data->sub.data); + ec->comp_data->sub.data = NULL; } - if (cdata->sub.below_obj) + if (ec->comp_data->sub.below_obj) { ELOGF("COMP", "ec deleted", ec); _e_comp_wl_subsurface_below_obj_destroy(ec); @@ -959,15 +860,14 @@ _e_comp_wl_subsurface_cb_ec_del(void *data EINA_UNUSED, E_Client *ec) /* remove sub list */ /* TODO: if parent is set by onscreen_parent of remote surface? */ - _e_comp_wl_surface_sub_list_free(cdata->sub.list); - cdata->sub.list = NULL; - _e_comp_wl_surface_sub_list_free(cdata->sub.list_pending); - cdata->sub.list_pending = NULL; - _e_comp_wl_surface_sub_list_free(cdata->sub.below_list); - cdata->sub.below_list = NULL; - _e_comp_wl_surface_sub_list_free(cdata->sub.below_list_pending); - cdata->sub.below_list_pending = NULL; - + _e_comp_wl_surface_sub_list_free(ec->comp_data->sub.list); + ec->comp_data->sub.list = NULL; + _e_comp_wl_surface_sub_list_free(ec->comp_data->sub.list_pending); + ec->comp_data->sub.list_pending = NULL; + _e_comp_wl_surface_sub_list_free(ec->comp_data->sub.below_list); + ec->comp_data->sub.below_list = NULL; + _e_comp_wl_surface_sub_list_free(ec->comp_data->sub.below_list_pending); + ec->comp_data->sub.below_list_pending = NULL; evas_object_event_callback_del(ec->frame, EVAS_CALLBACK_RESTACK, @@ -978,19 +878,16 @@ static void _e_comp_wl_subsurface_destroy(struct wl_resource *resource) { E_Client *ec = wl_resource_get_user_data(resource); - E_Comp_Wl_Client_Data *cdata = NULL; if (!e_object_unref(E_OBJECT(ec))) return; if (e_object_is_del(E_OBJECT(ec))) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; - if (cdata->sub.data) + if ((ec->comp_data) && (ec->comp_data->sub.data)) { - if (cdata->sub.data->parent) - _e_comp_wl_subsurface_remove_from_parent(cdata->sub.data->parent, ec); - _e_comp_wl_subsurface_data_destroy(cdata->sub.data); - cdata->sub.data = NULL; + if (ec->comp_data->sub.data->parent) + _e_comp_wl_subsurface_remove_from_parent(ec->comp_data->sub.data->parent, ec); + _e_comp_wl_subsurface_data_destroy(ec->comp_data->sub.data); + ec->comp_data->sub.data = NULL; } } @@ -1002,8 +899,8 @@ _e_comp_wl_subsurface_synchronized_get(E_Comp_Wl_Subsurf_Data *sdata) if (sdata->synchronized) return EINA_TRUE; if (!sdata->parent) return EINA_FALSE; + if (!sdata->parent->comp_data) return EINA_FALSE; if (e_object_is_del(E_OBJECT(sdata->parent))) return EINA_FALSE; - if (!e_client_cdata_get(sdata->parent)) return EINA_FALSE; sdata = _e_comp_wl_subsurface_data_get(sdata->parent); } @@ -1014,16 +911,13 @@ _e_comp_wl_subsurface_synchronized_get(E_Comp_Wl_Subsurf_Data *sdata) static Eina_Bool _e_comp_wl_subsurface_circular_reference_check(E_Client *ec, E_Client *parent) { - E_Comp_Wl_Client_Data *parent_cdata = NULL; - while(parent) { if (ec == parent) return EINA_TRUE; - parent_cdata = e_client_cdata_get(parent); - if (parent_cdata && parent_cdata->sub.data) - parent = parent_cdata->sub.data->parent; + if ((parent->comp_data) && (parent->comp_data->sub.data)) + parent = parent->comp_data->sub.data->parent; else break; } @@ -1068,8 +962,6 @@ e_comp_wl_subsurface_create(E_Client *ec, E_Client *epc, uint32_t id, struct wl_ struct wl_resource *res; E_Comp_Wl_Subsurf_Data *sdata; E_Client *offscreen_parent = NULL; - E_Comp_Wl_Client_Data *cdata = NULL; - E_Comp_Wl_Client_Data *epc_cdata = NULL; EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE); EINA_SAFETY_ON_NULL_RETURN_VAL(surface_resource, EINA_FALSE); @@ -1082,9 +974,7 @@ e_comp_wl_subsurface_create(E_Client *ec, E_Client *epc, uint32_t id, struct wl_ return EINA_FALSE; } - if (e_object_is_del(E_OBJECT(ec))) return EINA_FALSE; - cdata = e_client_cdata_get(ec); - if (!cdata) return EINA_FALSE; + if (e_object_is_del(E_OBJECT(ec)) || !ec->comp_data) return EINA_FALSE; res = wl_resource_create(client, &wl_subsurface_interface, 1, id); if (!res) @@ -1101,13 +991,11 @@ e_comp_wl_subsurface_create(E_Client *ec, E_Client *epc, uint32_t id, struct wl_ return EINA_FALSE; } - epc_cdata = e_client_cdata_get(epc); - // reparent remote surface provider's subsurfaces - if (epc_cdata && epc_cdata->remote_surface.onscreen_parent) + if ((epc->comp_data) && (epc->comp_data->remote_surface.onscreen_parent)) { offscreen_parent = epc; - epc = epc_cdata->remote_surface.onscreen_parent; + epc = epc->comp_data->remote_surface.onscreen_parent; } // check parent relationship is a cycle @@ -1160,8 +1048,8 @@ e_comp_wl_subsurface_create(E_Client *ec, E_Client *epc, uint32_t id, struct wl_ /* TODO: add callbacks ?? */ - cdata->surface = surface_resource; - cdata->sub.data = sdata; + ec->comp_data->surface = surface_resource; + ec->comp_data->sub.data = sdata; ec->lock_user_location = 0; ec->lock_client_location = 0; @@ -1182,7 +1070,7 @@ e_comp_wl_subsurface_create(E_Client *ec, E_Client *epc, uint32_t id, struct wl_ /* Delete 'below_obj' if it was created before 'E_Client' becomes subsurface. * It's not for subsurface. */ - E_FREE_FUNC(cdata->sub.below_obj, evas_object_del); + E_FREE_FUNC(ec->comp_data->sub.below_obj, evas_object_del); /* Delete a listener for restack of evas. * There is no need to watch restack of evas for sub-surface because @@ -1217,13 +1105,12 @@ e_comp_wl_subsurface_order_commit(E_Client *ec) EINTERN Eina_Bool e_comp_wl_subsurface_commit(E_Client *ec) { - E_Comp_Wl_Client_Data *cdata = NULL; E_Comp_Wl_Subsurf_Data *sdata; EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE); - if (e_object_is_del(E_OBJECT(ec))) return EINA_FALSE; - cdata = e_client_cdata_get(ec); - if (!cdata) return EINA_FALSE; + + /* check for valid subcompositor data */ + if (e_object_is_del(E_OBJECT(ec)) || !ec->comp_data) return EINA_FALSE; sdata = _e_comp_wl_subsurface_data_get(ec); if (!sdata) return EINA_FALSE; @@ -1254,12 +1141,12 @@ e_comp_wl_subsurface_commit(E_Client *ec) else e_comp_wl_surface_commit(ec); - EINA_LIST_FOREACH(cdata->sub.list, l, subc) + EINA_LIST_FOREACH(ec->comp_data->sub.list, l, subc) { if (ec != subc) _e_comp_wl_subsurface_parent_commit(subc, EINA_FALSE); } - EINA_LIST_FOREACH(cdata->sub.below_list, l, subc) + EINA_LIST_FOREACH(ec->comp_data->sub.below_list, l, subc) { if (ec != subc) _e_comp_wl_subsurface_parent_commit(subc, EINA_FALSE); @@ -1330,26 +1217,24 @@ EINTERN Eina_Bool e_comp_wl_normal_subsurface_has(E_Client *ec) { E_Client *subc; - E_Comp_Wl_Client_Data *cdata = NULL; Eina_List *l; EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE); if (e_object_is_del(E_OBJECT(ec))) return EINA_FALSE; - cdata = e_client_cdata_get(ec); - if (!cdata) return EINA_FALSE; + if (!ec->comp_data) return EINA_FALSE; /* if a leaf client is not video cliet */ - if (cdata->sub.data && !cdata->sub.below_list && - !cdata->sub.below_list_pending && - ((!cdata->video_client) && (!e_client_video_hw_composition_check(ec)))) + if (ec->comp_data->sub.data && !ec->comp_data->sub.below_list && + !ec->comp_data->sub.below_list_pending && + ((!ec->comp_data->video_client) && (!e_client_video_hw_composition_check(ec)))) return EINA_TRUE; - EINA_LIST_FOREACH(cdata->sub.below_list_pending, l, subc) + EINA_LIST_FOREACH(ec->comp_data->sub.below_list_pending, l, subc) if (e_comp_wl_normal_subsurface_has(subc)) return EINA_TRUE; - EINA_LIST_FOREACH(cdata->sub.below_list, l, subc) + EINA_LIST_FOREACH(ec->comp_data->sub.below_list, l, subc) if (e_comp_wl_normal_subsurface_has(subc)) return EINA_TRUE; @@ -1360,8 +1245,9 @@ EINTERN void e_comp_wl_subsurface_check_below_bg_rectangle(E_Client *ec) { EINA_SAFETY_ON_NULL_RETURN(ec); - if (e_object_is_del(E_OBJECT(ec))) return; - if (!e_client_cdata_get(ec)) return; + + if ((e_object_is_del(E_OBJECT(ec))) || (!ec->comp_data)) + return; _e_comp_wl_subsurface_check_below_bg_rectangle(ec); } @@ -1475,9 +1361,8 @@ static const struct wl_subsurface_interface _e_subsurface_dummy_interface = static void _e_comp_wl_subsurface_invalid_parent_handle(E_Client *ec, struct wl_resource *resource) { - E_Comp_Wl_Client_Data *cdata = e_client_cdata_get(ec); - if (cdata->sub.watcher) - tizen_subsurface_watcher_send_message(cdata->sub.watcher, TIZEN_SUBSURFACE_WATCHER_MSG_PARENT_ID_INVALID); + if (ec->comp_data->sub.watcher) + tizen_subsurface_watcher_send_message(ec->comp_data->sub.watcher, TIZEN_SUBSURFACE_WATCHER_MSG_PARENT_ID_INVALID); /* We have to create a subsurface resource here even though it's error case * because server will send the fatal error when a client destroy a subsurface object. @@ -1489,16 +1374,14 @@ _e_comp_wl_subsurface_invalid_parent_handle(E_Client *ec, struct wl_resource *re static void _e_comp_wl_subsurface_remove_from_parent(E_Client *parent, E_Client *subc) { - E_Comp_Wl_Client_Data *parent_cdata = e_client_cdata_get(parent); - - parent_cdata->sub.list = - eina_list_remove(parent_cdata->sub.list, subc); - parent_cdata->sub.list_pending = - eina_list_remove(parent_cdata->sub.list_pending, subc); - parent_cdata->sub.below_list = - eina_list_remove(parent_cdata->sub.below_list, subc); - parent_cdata->sub.below_list_pending = - eina_list_remove(parent_cdata->sub.below_list_pending, subc); + parent->comp_data->sub.list = + eina_list_remove(parent->comp_data->sub.list, subc); + parent->comp_data->sub.list_pending = + eina_list_remove(parent->comp_data->sub.list_pending, subc); + parent->comp_data->sub.below_list = + eina_list_remove(parent->comp_data->sub.below_list, subc); + parent->comp_data->sub.below_list_pending = + eina_list_remove(parent->comp_data->sub.below_list_pending, subc); if ((!_e_comp_wl_subsurface_data_get(parent)) && (_e_comp_wl_subsurface_empty_check(parent))) @@ -1509,30 +1392,29 @@ _e_comp_wl_subsurface_remove_from_parent(E_Client *parent, E_Client *subc) EVAS_CALLBACK_RESTACK, _e_comp_wl_subsurface_cb_evas_restack); } + + } static E_Comp_Wl_Subsurf_Data * _e_comp_wl_subsurface_data_get(E_Client *ec) { - E_Comp_Wl_Client_Data *cdata = e_client_cdata_get(ec); - return (cdata) ? (cdata->sub.data) : NULL; + return (ec->comp_data) ? (ec->comp_data->sub.data) : NULL; } static void _e_comp_wl_subsurface_stack_update(E_Client *ec) { E_Client *topmost; - E_Comp_Wl_Client_Data *cdata = NULL; + if (!ec->comp_data) return; if (e_object_is_del(E_OBJECT(ec))) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; - if (cdata->sub.restacking) return; + if (ec->comp_data->sub.restacking) return; /* return if ec isn't both a parent of a subsurface and a subsurface itself */ - if (!cdata->sub.list && !cdata->sub.below_list && !cdata->sub.data) + if (!ec->comp_data->sub.list && !ec->comp_data->sub.below_list && !ec->comp_data->sub.data) { - if (cdata->sub.below_obj) + if (ec->comp_data->sub.below_obj) _e_comp_wl_subsurface_restack_bg_rectangle(ec); return; } @@ -1543,25 +1425,23 @@ _e_comp_wl_subsurface_stack_update(E_Client *ec) _e_comp_wl_subsurface_restack_bg_rectangle(topmost); //To update client stack list - if ((cdata->sub.data) && - (cdata->sub.data->parent)) + if ((ec->comp_data->sub.data) && + (ec->comp_data->sub.data->parent)) { E_Client *parent; - E_Comp_Wl_Client_Data *parent_cdata = NULL; Evas_Object *o; - parent = cdata->sub.data->parent; - parent_cdata = e_client_cdata_get(parent); + parent = ec->comp_data->sub.data->parent; - if ((parent_cdata->sub.list) && - (eina_list_data_find(parent_cdata->sub.list, ec))) + if ((parent->comp_data->sub.list) && + (eina_list_data_find(parent->comp_data->sub.list, ec))) { //stack above done o = evas_object_below_get(ec->frame); e_comp_object_layer_update(ec->frame, o, NULL); } - else if ((parent_cdata->sub.below_list) && - (eina_list_data_find(parent_cdata->sub.below_list, ec))) + else if ((parent->comp_data->sub.below_list) && + (eina_list_data_find(parent->comp_data->sub.below_list, ec))) { //stack below done o = evas_object_above_get(ec->frame); @@ -1574,12 +1454,10 @@ static void _e_comp_wl_subsurface_cb_evas_restack(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { E_Client *topmost; - E_Comp_Wl_Client_Data *topmost_cdata; /* Given data must be a topmost E_Client of subsurfaces. */ topmost = data; - topmost_cdata = e_client_cdata_get(topmost); - if (topmost_cdata->sub.restacking) + if (topmost->comp_data->sub.restacking) { ELOGF("SUB-COMP", "A topmost parent is getting restacked", topmost); return; @@ -1592,20 +1470,17 @@ _e_comp_wl_subsurface_cb_evas_restack(void *data, Evas *e EINA_UNUSED, Evas_Obje static Eina_Bool _e_comp_wl_subsurface_empty_check(E_Client *ec) { - E_Comp_Wl_Client_Data *cdata = e_client_cdata_get(ec); - - return (!cdata) || - ((eina_list_count(cdata->sub.list) == 0) && - (eina_list_count(cdata->sub.list_pending) == 0) && - (eina_list_count(cdata->sub.below_list) == 0) && - (eina_list_count(cdata->sub.below_list_pending) == 0)); + return (!ec->comp_data) || + ((eina_list_count(ec->comp_data->sub.list) == 0) && + (eina_list_count(ec->comp_data->sub.list_pending) == 0) && + (eina_list_count(ec->comp_data->sub.below_list) == 0) && + (eina_list_count(ec->comp_data->sub.below_list_pending) == 0)); } static void _e_comp_wl_subsurface_parent_link(E_Comp_Wl_Subsurf_Data *sdata, E_Client *subc, E_Client *epc) { E_Layer layer; - E_Comp_Wl_Client_Data *epc_cdata = e_client_cdata_get(epc); sdata->parent = epc; @@ -1626,11 +1501,11 @@ _e_comp_wl_subsurface_parent_link(E_Comp_Wl_Subsurf_Data *sdata, E_Client *subc, } } - if (epc_cdata) + if (epc->comp_data) { /* append this client to the parents subsurface list */ - epc_cdata->sub.list_pending = - eina_list_append(epc_cdata->sub.list_pending, subc); - epc_cdata->sub.list_changed = EINA_TRUE; + epc->comp_data->sub.list_pending = + eina_list_append(epc->comp_data->sub.list_pending, subc); + epc->comp_data->sub.list_changed = EINA_TRUE; } } diff --git a/src/bin/e_comp_wl_viewport.c b/src/bin/e_comp_wl_viewport.c index 7f0fcb5327..c2d110f5c0 100644 --- a/src/bin/e_comp_wl_viewport.c +++ b/src/bin/e_comp_wl_viewport.c @@ -108,21 +108,17 @@ static E_Client* _topmost_parent_get(E_Client *ec) { E_Client *parent = NULL; - E_Comp_Wl_Client_Data *cdata = NULL; - E_Comp_Wl_Client_Data *parent_cdata = NULL; - cdata = e_client_cdata_get(ec); - if (!cdata || !cdata->sub.data) + if (!ec->comp_data || !ec->comp_data->sub.data) return ec; - parent = cdata->sub.data->parent; + parent = ec->comp_data->sub.data->parent; while (parent) { - parent_cdata = e_client_cdata_get(parent); - if (!parent_cdata || !parent_cdata->sub.data) + if (!parent->comp_data || !parent->comp_data->sub.data) return parent; - parent = parent_cdata->sub.data->parent; + parent = parent->comp_data->sub.data->parent; } return ec; @@ -132,7 +128,6 @@ static void _destroy_viewport(E_Viewport *viewport) { E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; if (!viewport) return; @@ -162,16 +157,15 @@ _destroy_viewport(E_Viewport *viewport) if (viewport->dst_mode_res) wl_resource_set_user_data(viewport->dst_mode_res, NULL); - cdata = e_client_cdata_get(ec); - if (cdata && cdata->scaler.viewport) + if (ec->comp_data && ec->comp_data->scaler.viewport) { - cdata->scaler.viewport = NULL; - cdata->scaler.buffer_viewport.buffer.src_width = wl_fixed_from_int(-1); - cdata->scaler.buffer_viewport.surface.width = -1; - cdata->scaler.buffer_viewport.changed = 1; - cdata->pending.buffer_viewport.buffer.src_width = wl_fixed_from_int(-1); - cdata->pending.buffer_viewport.surface.width = -1; - cdata->pending.buffer_viewport.changed = 1; + ec->comp_data->scaler.viewport = NULL; + ec->comp_data->scaler.buffer_viewport.buffer.src_width = wl_fixed_from_int(-1); + ec->comp_data->scaler.buffer_viewport.surface.width = -1; + ec->comp_data->scaler.buffer_viewport.changed = 1; + ec->comp_data->pending.buffer_viewport.buffer.src_width = wl_fixed_from_int(-1); + ec->comp_data->pending.buffer_viewport.surface.width = -1; + ec->comp_data->pending.buffer_viewport.changed = 1; } PIN("tizen_viewport@%d destroy. viewport(%p)", wl_resource_get_id(viewport->resource), viewport); @@ -254,13 +248,10 @@ _e_comp_wl_viewport_parent_check(E_Viewport *viewport) { E_Client *ec = viewport->ec; E_Client *new_parent; - E_Comp_Wl_Client_Data *cdata = NULL; - if (e_object_is_del(E_OBJECT(ec))) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; + if (e_object_is_del(E_OBJECT(ec)) || !ec->comp_data) return; - new_parent = (cdata->sub.data) ? cdata->sub.data->parent : NULL; + new_parent = (ec->comp_data->sub.data) ? ec->comp_data->sub.data->parent : NULL; if (viewport->epc == new_parent) return; @@ -284,8 +275,6 @@ _e_comp_wl_viewport_set_changed(E_Viewport *viewport) { E_Client *ec; E_Client *subc; - E_Comp_Wl_Client_Data *cdata = NULL; - E_Comp_Wl_Client_Data *subc_cdata = NULL; Eina_List *l; E_Viewport *sub_viewport; @@ -294,26 +283,21 @@ _e_comp_wl_viewport_set_changed(E_Viewport *viewport) viewport->current.changed = EINA_TRUE; ec = viewport->ec; - cdata = e_client_cdata_get(ec); - EINA_LIST_FOREACH(cdata->sub.list, l, subc) + EINA_LIST_FOREACH(ec->comp_data->sub.list, l, subc) { - if (!subc) continue; - if (e_object_is_del(E_OBJECT(subc))) continue; - subc_cdata = e_client_cdata_get(subc); - if (!subc_cdata) continue; + if (!subc || !subc->comp_data || e_object_is_del(E_OBJECT(subc))) + continue; - sub_viewport = _e_comp_wl_viewport_get_viewport(subc_cdata->scaler.viewport); + sub_viewport = _e_comp_wl_viewport_get_viewport(subc->comp_data->scaler.viewport); _e_comp_wl_viewport_set_changed(sub_viewport); } - EINA_LIST_FOREACH(cdata->sub.below_list, l, subc) + EINA_LIST_FOREACH(ec->comp_data->sub.below_list, l, subc) { - if (!subc) continue; - if (e_object_is_del(E_OBJECT(subc))) continue; - subc_cdata = e_client_cdata_get(subc); - if (!subc_cdata) continue; + if (!subc || !subc->comp_data || e_object_is_del(E_OBJECT(subc))) + continue; - sub_viewport = _e_comp_wl_viewport_get_viewport(subc_cdata->scaler.viewport); + sub_viewport = _e_comp_wl_viewport_get_viewport(subc->comp_data->scaler.viewport); _e_comp_wl_viewport_set_changed(sub_viewport); } } @@ -1030,14 +1014,11 @@ _get_parent_transform(E_Viewport *viewport) { E_Client *epc = viewport->epc; E_Client *topmost; - E_Comp_Wl_Client_Data *epc_cdata = NULL; unsigned int ptran, pflip; int ptransform; - if (!epc) return 0; - if (e_object_is_del(E_OBJECT(epc))) return 0; - epc_cdata = e_client_cdata_get(epc); - if (!epc_cdata) return 0; + if (!epc->comp_data || e_object_is_del(E_OBJECT(epc))) + return 0; ptransform = e_comp_wl_output_buffer_transform_get(epc); @@ -1153,9 +1134,7 @@ _destination_mode_calculate_destination(E_Viewport *viewport, Eina_Rectangle *pr { int ptransform; - if (e_object_is_del(E_OBJECT(epc))) - return EINA_FALSE; - if (!e_client_cdata_get(epc)) + if (!epc->comp_data || e_object_is_del(E_OBJECT(epc))) return EINA_FALSE; ptransform = e_comp_wl_output_buffer_transform_get(epc); @@ -1361,8 +1340,7 @@ static Eina_Bool _e_comp_wl_viewport_apply_transform(E_Viewport *viewport, int *rtransform) { E_Client *ec = viewport->ec; - E_Comp_Wl_Client_Data *cdata = e_client_cdata_get(ec); - E_Comp_Wl_Buffer_Viewport *vp = &cdata->scaler.buffer_viewport; + E_Comp_Wl_Buffer_Viewport *vp = &ec->comp_data->scaler.buffer_viewport; Eina_Bool changed = EINA_FALSE; unsigned int new_transform; @@ -1374,7 +1352,7 @@ _e_comp_wl_viewport_apply_transform(E_Viewport *viewport, int *rtransform) unsigned int pwtran, ptran, pflip, ctran, cflip; int ptransform; - if (!e_client_cdata_get(epc) || e_object_is_del(E_OBJECT(epc))) + if (!epc->comp_data || e_object_is_del(E_OBJECT(epc))) { *rtransform = vp->buffer.transform; return EINA_FALSE; @@ -1399,9 +1377,9 @@ _e_comp_wl_viewport_apply_transform(E_Viewport *viewport, int *rtransform) vp->buffer.transform = new_transform; vp->changed = changed = EINA_TRUE; - cdata->pending.buffer_viewport = *vp; - if (cdata->sub.data) - cdata->sub.data->cached.buffer_viewport = *vp; + ec->comp_data->pending.buffer_viewport = *vp; + if (ec->comp_data->sub.data) + ec->comp_data->sub.data->cached.buffer_viewport = *vp; } if (changed) @@ -1418,12 +1396,11 @@ static Eina_Bool _e_comp_wl_viewport_apply_destination(E_Viewport *viewport, Eina_Rectangle *rrect) { E_Client *ec = viewport->ec; - E_Comp_Wl_Client_Data *cdata = e_client_cdata_get(ec); E_Comp_Wl_Buffer_Viewport *vp; Eina_Rectangle dst = {0,}, prect; Eina_Bool changed = EINA_FALSE; - vp = &cdata->scaler.buffer_viewport; + vp = &ec->comp_data->scaler.buffer_viewport; if (!viewport->epc) { E_Zone *zone = e_comp_zone_xy_get(ec->x, ec->y); @@ -1437,13 +1414,12 @@ _e_comp_wl_viewport_apply_destination(E_Viewport *viewport, Eina_Rectangle *rrec else { E_Client *epc = viewport->epc; - E_Comp_Wl_Client_Data *epc_cdata = e_client_cdata_get(epc); E_Comp_Wl_Buffer_Viewport *vpp; - if (!epc_cdata || e_object_is_del(E_OBJECT(epc))) + if (!epc->comp_data || e_object_is_del(E_OBJECT(epc))) return EINA_FALSE; - vpp = &epc_cdata->scaler.buffer_viewport; + vpp = &epc->comp_data->scaler.buffer_viewport; prect.x = prect.y = 0; if (vpp->surface.width != -1) { @@ -1480,14 +1456,14 @@ _e_comp_wl_viewport_apply_destination(E_Viewport *viewport, Eina_Rectangle *rrec _e_comp_wl_viewport_crop_by_parent(viewport, &prect, &dst); /* The values of below x, y, w, h are specified in the transform 0 and in the parent */ - if (cdata->sub.data) + if (ec->comp_data->sub.data) { - if (cdata->sub.data->position.x != dst.x || - cdata->sub.data->position.y != dst.y) + if (ec->comp_data->sub.data->position.x != dst.x || + ec->comp_data->sub.data->position.y != dst.y) { - cdata->sub.data->position.x = dst.x; - cdata->sub.data->position.y = dst.y; - cdata->sub.data->position.set = EINA_TRUE; + ec->comp_data->sub.data->position.x = dst.x; + ec->comp_data->sub.data->position.y = dst.y; + ec->comp_data->sub.data->position.set = EINA_TRUE; vp->changed = changed = EINA_TRUE; } } @@ -1504,9 +1480,9 @@ _e_comp_wl_viewport_apply_destination(E_Viewport *viewport, Eina_Rectangle *rrec vp->surface.height = dst.h; vp->changed = changed = EINA_TRUE; - cdata->pending.buffer_viewport = *vp; - if (cdata->sub.data) - cdata->sub.data->cached.buffer_viewport = *vp; + ec->comp_data->pending.buffer_viewport = *vp; + if (ec->comp_data->sub.data) + ec->comp_data->sub.data->cached.buffer_viewport = *vp; } *rrect = dst; @@ -1521,8 +1497,7 @@ static Eina_Bool _e_comp_wl_viewport_apply_source(E_Viewport *viewport) { E_Client *ec = viewport->ec; - E_Comp_Wl_Client_Data *cdata = e_client_cdata_get(ec); - E_Comp_Wl_Buffer_Viewport *vp = &cdata->scaler.buffer_viewport; + E_Comp_Wl_Buffer_Viewport *vp = &ec->comp_data->scaler.buffer_viewport; Eina_Rectangle rect = {0,}; int bw = 0, bh = 0; wl_fixed_t fx, fy, fw, fh; @@ -1560,9 +1535,9 @@ _e_comp_wl_viewport_apply_source(E_Viewport *viewport) vp->buffer.src_height = wl_fixed_from_int(rect.h); vp->changed = changed = EINA_TRUE; - cdata->pending.buffer_viewport = *vp; - if (cdata->sub.data) - cdata->sub.data->cached.buffer_viewport = *vp; + ec->comp_data->pending.buffer_viewport = *vp; + if (ec->comp_data->sub.data) + ec->comp_data->sub.data->cached.buffer_viewport = *vp; } if (changed) @@ -1577,22 +1552,19 @@ e_comp_wl_viewport_apply(E_Client *ec) { E_Viewport *viewport; E_Client *subc; - E_Comp_Wl_Client_Data *cdata = NULL; Eina_List *l; - if (!ec) return EINA_FALSE; - if (e_object_is_del(E_OBJECT(ec))) return EINA_FALSE; - cdata = e_client_cdata_get(ec); - if (!cdata) return EINA_FALSE; + if (!ec || !ec->comp_data || e_object_is_del(E_OBJECT(ec))) + return EINA_FALSE; - viewport = _e_comp_wl_viewport_get_viewport(cdata->scaler.viewport); + viewport = _e_comp_wl_viewport_get_viewport(ec->comp_data->scaler.viewport); if (viewport) _e_comp_wl_viewport_parent_check(viewport); - if (viewport && cdata->buffer_ref.buffer) + if (viewport && ec->comp_data->buffer_ref.buffer) { - E_Comp_Wl_Buffer_Viewport *vp = &cdata->scaler.buffer_viewport; + E_Comp_Wl_Buffer_Viewport *vp = &ec->comp_data->scaler.buffer_viewport; Eina_Bool changed = EINA_FALSE, src_changed = EINA_FALSE; Eina_Rectangle rrect = {0,}; int rtransform = 0; @@ -1626,12 +1598,12 @@ e_comp_wl_viewport_apply(E_Client *ec) } } else if (viewport) - PDB("%p buffer", cdata->buffer_ref.buffer); + PDB("%p buffer", ec->comp_data->buffer_ref.buffer); - EINA_LIST_FOREACH(cdata->sub.list, l, subc) + EINA_LIST_FOREACH(ec->comp_data->sub.list, l, subc) e_comp_wl_viewport_apply(subc); - EINA_LIST_FOREACH(cdata->sub.below_list, l, subc) + EINA_LIST_FOREACH(ec->comp_data->sub.below_list, l, subc) e_comp_wl_viewport_apply(subc); return EINA_TRUE; @@ -1642,23 +1614,20 @@ e_comp_wl_viewport_is_changed(E_Client *ec) { E_Viewport *viewport; E_Client *subc; - E_Comp_Wl_Client_Data *cdata = NULL; Eina_List *l; - if (!ec) return EINA_FALSE; - if (e_object_is_del(E_OBJECT(ec))) return EINA_FALSE; - cdata = e_client_cdata_get(ec); - if (!cdata) return EINA_FALSE; + if (!ec || !ec->comp_data || e_object_is_del(E_OBJECT(ec))) + return EINA_FALSE; - viewport = _e_comp_wl_viewport_get_viewport(cdata->scaler.viewport); + viewport = _e_comp_wl_viewport_get_viewport(ec->comp_data->scaler.viewport); if(viewport && viewport->current.changed) return EINA_TRUE; - EINA_LIST_FOREACH(cdata->sub.list, l, subc) + EINA_LIST_FOREACH(ec->comp_data->sub.list, l, subc) if (e_comp_wl_viewport_is_changed(subc)) return EINA_TRUE; - EINA_LIST_FOREACH(cdata->sub.below_list, l, subc) + EINA_LIST_FOREACH(ec->comp_data->sub.below_list, l, subc) if (e_comp_wl_viewport_is_changed(subc)) return EINA_TRUE; @@ -1679,9 +1648,7 @@ _e_comp_wl_viewport_cb_apply_viewport(struct wl_listener *listener, void *data) E_Viewport *viewport = container_of(listener, E_Viewport, surface_apply_viewport_listener); E_Client *ec = viewport->ec; E_Client *topmost = _topmost_parent_get(ec); - E_Comp_Wl_Client_Data *cdata = e_client_cdata_get(ec); - E_Comp_Wl_Client_Data *epc_cdata = NULL; - E_Comp_Wl_Buffer_Viewport *vp = &cdata->scaler.buffer_viewport; + E_Comp_Wl_Buffer_Viewport *vp = &ec->comp_data->scaler.buffer_viewport; Eina_Bool changed = EINA_FALSE; if (vp->changed) @@ -1706,12 +1673,8 @@ _e_comp_wl_viewport_cb_apply_viewport(struct wl_listener *listener, void *data) _e_comp_wl_viewport_parent_check(viewport); if (!viewport->current.changed) return; - if (!cdata->buffer_ref.buffer) return; - if (viewport->epc) - { - epc_cdata = e_client_cdata_get(viewport->epc); - if (!epc_cdata) return; - } + if (!ec->comp_data->buffer_ref.buffer) return; + if (viewport->epc && !viewport->epc->comp_data->buffer_ref.buffer) return; PDB("apply: topmost(%p)", topmost); @@ -1746,32 +1709,18 @@ e_comp_wl_viewport_create(struct wl_resource *resource, struct wl_resource *surface) { E_Client *ec = wl_resource_get_user_data(surface); - E_Comp_Wl_Client_Data *cdata = NULL; int version = wl_resource_get_version(resource); struct wl_client *client; struct wl_resource *res; E_Viewport *viewport; - if (!ec || e_object_is_del(E_OBJECT(ec))) + if (!ec || !ec->comp_data || e_object_is_del(E_OBJECT(ec)) || !ec->comp_data->surface) { ERR("wrong resource %d", wl_resource_get_id(surface)); return EINA_FALSE; } - cdata = e_client_cdata_get(ec); - if (!cdata) - { - ERR("no cdata"); - return EINA_FALSE; - } - - if (!cdata->surface) - { - ERR("wrong resource %d.(cdata->surface)", wl_resource_get_id(surface)); - return EINA_FALSE; - } - - if (cdata->scaler.viewport) + if (ec->comp_data->scaler.viewport) { ERR("wl_surface@%d already has a viewport", wl_resource_get_id(surface)); @@ -1822,15 +1771,15 @@ e_comp_wl_viewport_create(struct wl_resource *resource, viewport->cropped_source.w = -1; viewport->surface_apply_viewport_listener.notify = _e_comp_wl_viewport_cb_apply_viewport; - wl_signal_add(&cdata->apply_viewport_signal, &viewport->surface_apply_viewport_listener); + wl_signal_add(&ec->comp_data->apply_viewport_signal, &viewport->surface_apply_viewport_listener); /* Use scaler variable because tizen_viewport is the alternative of wl_viewport */ - cdata->scaler.viewport = res; + ec->comp_data->scaler.viewport = res; wl_resource_set_implementation(res, &_e_comp_wl_viewport_interface, viewport, _e_comp_wl_viewport_destroy); viewport->surface_destroy_listener.notify = _e_comp_wl_viewport_cb_surface_destroy; - wl_resource_add_destroy_listener(cdata->surface, &viewport->surface_destroy_listener); + wl_resource_add_destroy_listener(ec->comp_data->surface, &viewport->surface_destroy_listener); PIN("tizen_viewport@%d viewport(%p) created", id, viewport); @@ -1870,17 +1819,14 @@ _e_comp_wl_viewport_print(void *data, const char *log_path) for (o = evas_object_top_get(e_comp->evas); o; o = evas_object_below_get(o)) { E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; E_Viewport *viewport; Ecore_Window win = 0; const char *name = NULL; ec = evas_object_data_get(o, "E_Client"); - if (!ec || e_object_is_del(E_OBJECT(ec))) continue; - cdata = e_client_cdata_get(ec); - if (!cdata) continue; + if (!ec || e_object_is_del(E_OBJECT(ec)) || !ec->comp_data) continue; - viewport = _e_comp_wl_viewport_get_viewport(cdata->scaler.viewport); + viewport = _e_comp_wl_viewport_get_viewport(ec->comp_data->scaler.viewport); if (!viewport) continue; if (first_line) @@ -1957,18 +1903,16 @@ static void _e_viewport_destroy(struct wl_resource *resource) { E_Client *ec = wl_resource_get_user_data(resource); - E_Comp_Wl_Client_Data *cdata = NULL; if (!e_object_unref(E_OBJECT(ec))) return; if (e_object_is_del(E_OBJECT(ec))) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; - if (!cdata->scaler.viewport) return; - - cdata->scaler.viewport = NULL; - cdata->pending.buffer_viewport.buffer.src_width = wl_fixed_from_int(-1); - cdata->pending.buffer_viewport.surface.width = -1; - cdata->pending.buffer_viewport.changed = 1; + if (!ec->comp_data) return; + if (!ec->comp_data->scaler.viewport) return; + + ec->comp_data->scaler.viewport = NULL; + ec->comp_data->pending.buffer_viewport.buffer.src_width = wl_fixed_from_int(-1); + ec->comp_data->pending.buffer_viewport.surface.width = -1; + ec->comp_data->pending.buffer_viewport.changed = 1; } static void @@ -1988,13 +1932,11 @@ _e_viewport_cb_set(struct wl_client *client EINA_UNUSED, int32_t dst_height) { E_Client *ec = wl_resource_get_user_data(resource); - E_Comp_Wl_Client_Data *cdata = NULL; if (e_object_is_del(E_OBJECT(ec))) return; - cdata = e_client_cdata_get(ec); - EINA_SAFETY_ON_NULL_RETURN(cdata); - EINA_SAFETY_ON_NULL_RETURN(cdata->scaler.viewport); + EINA_SAFETY_ON_NULL_RETURN(ec->comp_data); + EINA_SAFETY_ON_NULL_RETURN(ec->comp_data->scaler.viewport); if (wl_fixed_to_double(src_width) < 0 || wl_fixed_to_double(src_height) < 0) { @@ -2009,13 +1951,13 @@ _e_viewport_cb_set(struct wl_client *client EINA_UNUSED, return; } - cdata->pending.buffer_viewport.buffer.src_x = src_x; - cdata->pending.buffer_viewport.buffer.src_y = src_y; - cdata->pending.buffer_viewport.buffer.src_width = src_width; - cdata->pending.buffer_viewport.buffer.src_height = src_height; - cdata->pending.buffer_viewport.surface.width = dst_width; - cdata->pending.buffer_viewport.surface.height = dst_height; - cdata->pending.buffer_viewport.changed = 1; + ec->comp_data->pending.buffer_viewport.buffer.src_x = src_x; + ec->comp_data->pending.buffer_viewport.buffer.src_y = src_y; + ec->comp_data->pending.buffer_viewport.buffer.src_width = src_width; + ec->comp_data->pending.buffer_viewport.buffer.src_height = src_height; + ec->comp_data->pending.buffer_viewport.surface.width = dst_width; + ec->comp_data->pending.buffer_viewport.surface.height = dst_height; + ec->comp_data->pending.buffer_viewport.changed = 1; } static void @@ -2027,19 +1969,17 @@ _e_viewport_cb_set_source(struct wl_client *client EINA_UNUSED, wl_fixed_t src_height) { E_Client *ec = wl_resource_get_user_data(resource); - E_Comp_Wl_Client_Data *cdata = NULL; if (e_object_is_del(E_OBJECT(ec))) return; - cdata = e_client_cdata_get(ec); - EINA_SAFETY_ON_NULL_RETURN(cdata); - EINA_SAFETY_ON_NULL_RETURN(cdata->scaler.viewport); + EINA_SAFETY_ON_NULL_RETURN(ec->comp_data); + EINA_SAFETY_ON_NULL_RETURN(ec->comp_data->scaler.viewport); if (src_width == wl_fixed_from_int(-1) && src_height == wl_fixed_from_int(-1)) { /* unset source size */ - cdata->pending.buffer_viewport.buffer.src_width = wl_fixed_from_int(-1); - cdata->pending.buffer_viewport.changed = 1; + ec->comp_data->pending.buffer_viewport.buffer.src_width = wl_fixed_from_int(-1); + ec->comp_data->pending.buffer_viewport.changed = 1; return; } @@ -2050,11 +1990,11 @@ _e_viewport_cb_set_source(struct wl_client *client EINA_UNUSED, return; } - cdata->pending.buffer_viewport.buffer.src_x = src_x; - cdata->pending.buffer_viewport.buffer.src_y = src_y; - cdata->pending.buffer_viewport.buffer.src_width = src_width; - cdata->pending.buffer_viewport.buffer.src_height = src_height; - cdata->pending.buffer_viewport.changed = 1; + ec->comp_data->pending.buffer_viewport.buffer.src_x = src_x; + ec->comp_data->pending.buffer_viewport.buffer.src_y = src_y; + ec->comp_data->pending.buffer_viewport.buffer.src_width = src_width; + ec->comp_data->pending.buffer_viewport.buffer.src_height = src_height; + ec->comp_data->pending.buffer_viewport.changed = 1; } static void @@ -2064,19 +2004,17 @@ _e_viewport_cb_set_destination(struct wl_client *client EINA_UNUSED, int32_t dst_height) { E_Client *ec = wl_resource_get_user_data(resource); - E_Comp_Wl_Client_Data *cdata = NULL; if (e_object_is_del(E_OBJECT(ec))) return; - cdata = e_client_cdata_get(ec); - EINA_SAFETY_ON_NULL_RETURN(cdata); - EINA_SAFETY_ON_NULL_RETURN(cdata->scaler.viewport); + EINA_SAFETY_ON_NULL_RETURN(ec->comp_data); + EINA_SAFETY_ON_NULL_RETURN(ec->comp_data->scaler.viewport); if (dst_width == -1 && dst_height == -1) { /* unset destination size */ - cdata->pending.buffer_viewport.surface.width = -1; - cdata->pending.buffer_viewport.changed = 1; + ec->comp_data->pending.buffer_viewport.surface.width = -1; + ec->comp_data->pending.buffer_viewport.changed = 1; return; } @@ -2086,9 +2024,9 @@ _e_viewport_cb_set_destination(struct wl_client *client EINA_UNUSED, return; } - cdata->pending.buffer_viewport.surface.width = dst_width; - cdata->pending.buffer_viewport.surface.height = dst_height; - cdata->pending.buffer_viewport.changed = 1; + ec->comp_data->pending.buffer_viewport.surface.width = dst_width; + ec->comp_data->pending.buffer_viewport.surface.height = dst_height; + ec->comp_data->pending.buffer_viewport.changed = 1; } static const struct wl_viewport_interface _e_viewport_interface = @@ -2110,14 +2048,12 @@ _e_scaler_cb_get_viewport(struct wl_client *client EINA_UNUSED, struct wl_resour { int version = wl_resource_get_version(scaler); E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; struct wl_resource *res; if (!(ec = wl_resource_get_user_data(surface_resource))) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; + if (!ec->comp_data) return; - if (cdata && cdata->scaler.viewport) + if (ec->comp_data && ec->comp_data->scaler.viewport) { wl_resource_post_error(scaler, WL_SCALER_ERROR_VIEWPORT_EXISTS, @@ -2132,7 +2068,7 @@ _e_scaler_cb_get_viewport(struct wl_client *client EINA_UNUSED, struct wl_resour return; } - cdata->scaler.viewport = res; + ec->comp_data->scaler.viewport = res; wl_resource_set_implementation(res, &_e_viewport_interface, ec, _e_viewport_destroy); e_object_ref(E_OBJECT(ec)); } diff --git a/src/bin/e_desk.c b/src/bin/e_desk.c index 58abaf1f65..f7955a8dfb 100644 --- a/src/bin/e_desk.c +++ b/src/bin/e_desk.c @@ -836,7 +836,6 @@ E_API void e_desk_geometry_set(E_Desk *desk, int x, int y, int w, int h) { E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; E_Maximize max; Eina_List *l = NULL, *ll = NULL; Evas_Object *m; @@ -865,7 +864,6 @@ e_desk_geometry_set(E_Desk *desk, int x, int y, int w, int h) EINA_LIST_FOREACH(sd->clients, l, ec) { - cdata = e_client_cdata_get(ec); /* even if the desktop geometry is chagned, the system partial windows such as virtual * keyboard and clipboard should be placed at the bottom of the desktop. */ /* QUICK FIX */ @@ -873,7 +871,7 @@ e_desk_geometry_set(E_Desk *desk, int x, int y, int w, int h) { continue; } - else if (cdata && cdata->sub.data) + else if ((ec->comp_data) && (ec->comp_data->sub.data)) { continue; } @@ -927,7 +925,6 @@ _animator_cb(void *data, double pos) { E_Desk *desk; E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; Eina_List *l; int cx, cy; double zoomx, zoomy; @@ -952,9 +949,8 @@ _animator_cb(void *data, double pos) EINA_LIST_FOREACH(sd->clients, l, ec) { - cdata = e_client_cdata_get(ec); if ((ec->visibility.obscured == E_VISIBILITY_UNOBSCURED) || - (cdata && cdata->sub.data)) + (ec->comp_data && ec->comp_data->sub.data)) _e_desk_client_zoom(ec, zoomx, zoomy, cx, cy); } diff --git a/src/bin/e_desk_group.c b/src/bin/e_desk_group.c index f3ced5a5d1..53f48d4b29 100644 --- a/src/bin/e_desk_group.c +++ b/src/bin/e_desk_group.c @@ -189,15 +189,13 @@ e_desk_group_del(E_Desk_Group *edg) void _e_desk_group_ec_geometry_apply(E_Desk_Group *edg, E_Client *ec) { - E_Comp_Wl_Client_Data *cdata = NULL; E_Util_Transform *transform; transform = ec->desk_group.transform; if (!transform) return; // skip subsurface - cdata = e_client_cdata_get(ec); - if (cdata && cdata->sub.data) + if (ec->comp_data && ec->comp_data->sub.data) return; e_util_transform_move(transform, edg->x, edg->y, 0); diff --git a/src/bin/e_devicemgr_wl.c b/src/bin/e_devicemgr_wl.c index 572b63b6ee..cf980ff461 100644 --- a/src/bin/e_devicemgr_wl.c +++ b/src/bin/e_devicemgr_wl.c @@ -221,18 +221,16 @@ e_devicemgr_wl_detent_send_event(int detent) Eina_List *l, *ll; wl_fixed_t f_value; E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; ec = e_client_focused_get(); if (!ec) return; if (e_object_is_del(E_OBJECT(ec))) return; if (ec->ignored) return; - cdata = e_client_cdata_get(ec); - if (!cdata || !cdata->surface) return; + if (!ec->comp_data || !ec->comp_data->surface) return; f_value = wl_fixed_from_double(detent * 1.0); - wc = wl_resource_get_client(cdata->surface); + wc = wl_resource_get_client(ec->comp_data->surface); EINA_LIST_FOREACH(e_devicemgr->device_list, l, input_dev) { diff --git a/src/bin/e_eom.c b/src/bin/e_eom.c index d3dc98b412..3f2f62718a 100644 --- a/src/bin/e_eom.c +++ b/src/bin/e_eom.c @@ -353,7 +353,6 @@ _e_eom_output_by_ec_child_get(E_Client *ec) { E_EomOutputPtr eom_output = NULL; E_Client *parent_ec = NULL, *output_ec = NULL; - E_Comp_Wl_Client_Data *cdata = NULL, *parent_cdata = NULL; Eina_List *l; EINA_LIST_FOREACH(g_eom->eom_outputs, l, eom_output) @@ -363,19 +362,17 @@ _e_eom_output_by_ec_child_get(E_Client *ec) if (output_ec == ec) return eom_output; - cdata = e_client_cdata_get(ec); - if (!cdata) continue; - if (!cdata->sub.data) continue; + if (!ec->comp_data) continue; + if (!ec->comp_data->sub.data) continue; - parent_ec = cdata->sub.data->parent; + parent_ec = ec->comp_data->sub.data->parent; while (parent_ec) { if (parent_ec == output_ec) return eom_output; - parent_cdata = e_client_cdata_get(parent_ec); - if (!parent_cdata) break; - if (!parent_cdata->sub.data) break; + if (!parent_ec->comp_data) break; + if (!parent_ec->comp_data->sub.data) break; - parent_ec = parent_cdata->sub.data->parent; + parent_ec = parent_ec->comp_data->sub.data->parent; } } @@ -385,12 +382,12 @@ _e_eom_output_by_ec_child_get(E_Client *ec) static void _e_eom_output_send_configure_event(E_EomOutput *eom_output, E_Client *ec) { - E_Comp_Wl_Client_Data *cdata = NULL; + E_Comp_Client_Data *cdata = NULL; E_EomCompObjectInterceptHookData *hook_data = NULL; E_Comp_Object_Intercept_Hook *hook = NULL; int w, h; - cdata = e_client_cdata_get(ec); + cdata = ec->comp_data; EINA_SAFETY_ON_NULL_RETURN(cdata); EINA_SAFETY_ON_NULL_RETURN(cdata->shell.configure_send); @@ -409,7 +406,7 @@ _e_eom_output_send_configure_event(E_EomOutput *eom_output, E_Client *ec) /* get the output size */ e_output_size_get(eom_output->output, &w, &h); - cdata->shell.configure_send(cdata->shell.surface, 0, w, h); + cdata->shell.configure_send(ec->comp_data->shell.surface, 0, w, h); EOMINF("Send Configure Event for Presentation (%d X %d)", ec, eom_output->output, w, h); @@ -455,25 +452,22 @@ _e_eom_client_get_current_by_ec_parrent(E_Client *ec) Eina_List *l; E_EomClientPtr client; E_Client *parent = NULL; - E_Comp_Wl_Client_Data *cdata = NULL, *parent_cdata = NULL; - cdata = e_client_cdata_get(ec); - if (!cdata || !cdata->sub.data) + if (!ec->comp_data || !ec->comp_data->sub.data) return NULL; EINA_LIST_FOREACH(g_eom->clients, l, client) { - parent = cdata->sub.data->parent; + parent = ec->comp_data->sub.data->parent; while (parent) { if (client->ec == parent) return client; - parent_cdata = e_client_cdata_get(parent); - if (!parent_cdata || !parent_cdata->sub.data) + if (!parent->comp_data || !parent->comp_data->sub.data) break; - parent = parent_cdata->sub.data->parent; + parent = parent->comp_data->sub.data->parent; } } diff --git a/src/bin/e_explicit_sync.c b/src/bin/e_explicit_sync.c index b2ec472f74..1db20c16ff 100644 --- a/src/bin/e_explicit_sync.c +++ b/src/bin/e_explicit_sync.c @@ -31,10 +31,11 @@ static Eina_Bool ex_sync_trace = EINA_FALSE; static E_Comp_Wl_Buffer * _e_explicit_sync_comp_wl_buffer_get(E_Client *ec) { - E_Comp_Wl_Client_Data *cdata; + E_Comp_Client_Data *cdata; if (!ec) return NULL; - cdata = e_client_cdata_get(ec); + + cdata = ec->comp_data; if (!cdata) return NULL; return cdata->buffer_ref.buffer; diff --git a/src/bin/e_hints.c b/src/bin/e_hints.c index cd1fda3cb5..2d56dded23 100644 --- a/src/bin/e_hints.c +++ b/src/bin/e_hints.c @@ -268,7 +268,7 @@ e_hints_aux_hint_add_with_pixmap(E_Pixmap *cp, int32_t id, const char *name, con Eina_List *l; if (!cp) return EINA_FALSE; - cdata = e_pixmap_cdata_get(cp); + cdata = (E_Comp_Wl_Client_Data*)e_pixmap_cdata_get(cp); if (!cdata) return EINA_FALSE; EINA_LIST_FOREACH(cdata->aux_hint.hints, l, hint) @@ -322,7 +322,7 @@ e_hints_aux_hint_change_with_pixmap(E_Pixmap *cp, int32_t id, const char *val) Eina_Bool found = EINA_FALSE; if (!cp) return EINA_FALSE; - cdata = e_pixmap_cdata_get(cp); + cdata = (E_Comp_Wl_Client_Data*)e_pixmap_cdata_get(cp); if (!cdata) return EINA_FALSE; EINA_LIST_FOREACH(cdata->aux_hint.hints, l, hint) @@ -362,7 +362,7 @@ e_hints_aux_hint_del_with_pixmap(E_Pixmap *cp, int32_t id) int res = -1; if (!cp) return EINA_FALSE; - cdata = e_pixmap_cdata_get(cp); + cdata = (E_Comp_Wl_Client_Data*)e_pixmap_cdata_get(cp); if (!cdata) return EINA_FALSE; EINA_LIST_FOREACH_SAFE(cdata->aux_hint.hints, l, ll, hint) @@ -393,7 +393,7 @@ e_hints_aux_hint_value_get_with_pixmap(E_Pixmap *cp, const char *name) const char *res = NULL; if (!cp) return NULL; - cdata = e_pixmap_cdata_get(cp); + cdata = (E_Comp_Wl_Client_Data*)e_pixmap_cdata_get(cp); if (!cdata) return NULL; EINA_LIST_REVERSE_FOREACH(cdata->aux_hint.hints, l, hint) diff --git a/src/bin/e_hwc_planes.c b/src/bin/e_hwc_planes.c index ee01fa28a2..b840641443 100644 --- a/src/bin/e_hwc_planes.c +++ b/src/bin/e_hwc_planes.c @@ -18,7 +18,7 @@ e_hwc_planes_deinit(void) static Eina_Bool _e_hwc_planes_ec_check(E_Client *ec) { - E_Comp_Wl_Client_Data *cdata = e_client_cdata_get(ec); + E_Comp_Wl_Client_Data *cdata = (E_Comp_Wl_Client_Data*)ec->comp_data; E_Output *eout; int minw = 0, minh = 0; int transform; diff --git a/src/bin/e_hwc_window.c b/src/bin/e_hwc_window.c index f2cb599b8b..dc28fefc4c 100644 --- a/src/bin/e_hwc_window.c +++ b/src/bin/e_hwc_window.c @@ -152,7 +152,7 @@ _e_hwc_window_comp_wl_buffer_get(E_Hwc_Window *hwc_window) if (!ec) return NULL; - cdata = e_client_cdata_get(ec); + cdata = ec->comp_data; if (!cdata) return NULL; return cdata->buffer_ref.buffer; @@ -170,7 +170,7 @@ _get_wayland_tbm_client_queue(E_Client *ec) if (!ec) return NULL; - cdata = e_pixmap_cdata_get(ec->pixmap); + cdata = (E_Comp_Wl_Client_Data *)e_pixmap_cdata_get(ec->pixmap); EINA_SAFETY_ON_NULL_RETURN_VAL(cdata, NULL); wl_surface = cdata->wl_surface; @@ -565,8 +565,7 @@ _e_hwc_window_cursor_image_update(E_Hwc_Window *hwc_window) } else { - E_Comp_Wl_Client_Data *cdata = e_client_cdata_get(ec); - EHWERR("unkown buffer type:%d", NULL, hwc_window->hwc, hwc_window, cdata->buffer_ref.buffer->type); + EHWERR("unkown buffer type:%d", NULL, hwc_window->hwc, hwc_window, ec->comp_data->buffer_ref.buffer->type); return EINA_FALSE; } @@ -1875,7 +1874,7 @@ e_hwc_window_device_state_available_update(E_Hwc_Window *hwc_window) goto finish; } - cdata = e_client_cdata_get(ec); + cdata = (E_Comp_Wl_Client_Data*)ec->comp_data; if ((!cdata) || (!cdata->buffer_ref.buffer)) { restriction = E_HWC_WINDOW_RESTRICTION_BUFFER; @@ -2132,7 +2131,7 @@ _e_hwc_window_client_recover(E_Hwc_Window *hwc_window, Eina_Bool *clear_attach) e_hwc_window_name_get(hwc_window)); /* force update */ - if (e_client_cdata_get(ec)) + if (ec->comp_data) e_comp_wl_surface_attach(ec, recover_buffer); else { @@ -2193,7 +2192,7 @@ _e_hwc_window_rendered_window_set(E_Hwc_Window *hwc_window, Eina_Bool set) hwc_window->ec, hwc_window->hwc, hwc_window, e_hwc_window_name_get(hwc_window)); } - if (clear_attach && e_client_cdata_get(ec)) + if (clear_attach && ec->comp_data) e_comp_wl_surface_attach(ec, NULL); } else diff --git a/src/bin/e_hwc_window_queue.c b/src/bin/e_hwc_window_queue.c index 1c82f8575a..eaf9628965 100644 --- a/src/bin/e_hwc_window_queue.c +++ b/src/bin/e_hwc_window_queue.c @@ -116,7 +116,7 @@ _user_cqueue_get(E_Client *ec) if (!ec) return NULL; - cdata = e_pixmap_cdata_get(ec->pixmap); + cdata = (E_Comp_Wl_Client_Data *)e_pixmap_cdata_get(ec->pixmap); if (!cdata) return NULL; wl_surface = cdata->wl_surface; @@ -160,7 +160,7 @@ _comp_wl_buffer_get(E_Client *ec) if (!ec) return NULL; - cdata = e_client_cdata_get(ec); + cdata = ec->comp_data; if (!cdata) return NULL; return cdata->buffer_ref.buffer; @@ -830,8 +830,7 @@ _e_hwc_window_queue_backup_buffer_set(E_Hwc_Window *hwc_window, Eina_Bool attach } else { - E_Comp_Wl_Client_Data *cdata = e_client_cdata_get(ec); - e_comp_wl_buffer_reference(&cdata->buffer_ref, backup_buffer); + e_comp_wl_buffer_reference(&ec->comp_data->buffer_ref, backup_buffer); e_pixmap_resource_set(ec->pixmap, backup_buffer); e_pixmap_dirty(ec->pixmap); e_pixmap_refresh(ec->pixmap); diff --git a/src/bin/e_hwc_windows.c b/src/bin/e_hwc_windows.c index edb7803be7..5ae94c93d3 100644 --- a/src/bin/e_hwc_windows.c +++ b/src/bin/e_hwc_windows.c @@ -88,7 +88,7 @@ _e_hwc_windows_comp_wl_buffer_get(E_Hwc_Window *hwc_window) if (!ec) return NULL; - cdata = e_client_cdata_get(ec); + cdata = ec->comp_data; if (!cdata) return NULL; return cdata->buffer_ref.buffer; @@ -248,14 +248,12 @@ _e_hwc_windows_presentation_feedback_take(E_Hwc_Window *hwc_window) else { E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; ec = hwc_window->ec; if (!ec) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; + if (!ec->comp_data) return; - container = &cdata->presentation_container; + container = &ec->comp_data->presentation_container; } if (!container) return; @@ -1250,17 +1248,15 @@ _e_hwc_windows_target_window_render_flush_post_cb(void *data, Evas *e EINA_UNUSE EINA_LIST_FOREACH(rendered_windows, l, hwc_window) { E_Client *ec = NULL; - E_Comp_Wl_Client_Data *cdata = NULL; hwc_window->on_rendered_target = EINA_FALSE; ec = hwc_window->ec; if (!ec) continue; - cdata = e_client_cdata_get(ec); - if (buffer_comp_info && cdata) + if (buffer_comp_info && ec->comp_data) e_presentation_time_container_feedback_merge(&buffer_comp_info->presentation_container, - &cdata->presentation_container); + &ec->comp_data->presentation_container); buffer = e_pixmap_ref_resource_get(ec->pixmap); if (!buffer) @@ -3031,7 +3027,6 @@ _e_hwc_windows_pp_commit(E_Hwc *hwc) E_Hwc_Windows_Buffer_Comp_Info *pp_buffer_comp_info, *buffer_comp_info; tdm_error terror = TDM_ERROR_NONE; E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; EINA_SAFETY_ON_NULL_RETURN_VAL(hwc, EINA_FALSE); @@ -3080,10 +3075,9 @@ _e_hwc_windows_pp_commit(E_Hwc *hwc) if (hwc->pp_hwc_window) { ec = hwc->pp_hwc_window->ec; - cdata = e_client_cdata_get(ec); - if (ec && cdata) + if ((ec) && (ec->comp_data)) e_presentation_time_container_feedback_merge(&pp_buffer_comp_info->presentation_container, - &cdata->presentation_container); + &ec->comp_data->presentation_container); } else { diff --git a/src/bin/e_info_server.c b/src/bin/e_info_server.c index 4319816b66..55407a8324 100644 --- a/src/bin/e_info_server.c +++ b/src/bin/e_info_server.c @@ -253,10 +253,8 @@ _msg_ecs_append(Eldbus_Message_Iter *iter, Eina_Bool is_visible) Eina_Bool mapped = EINA_FALSE; Eina_Bool transformed = EINA_FALSE; int x = 0, y = 0, w = 0, h = 0; - E_Comp_Wl_Client_Data *cdata = NULL; if (is_visible && e_client_util_ignored_get(ec)) continue; - cdata = e_client_cdata_get(ec); win = e_client_util_win_get(ec); e_comp_layer_name_get(ec->layer, layer_name, sizeof(layer_name)); @@ -269,8 +267,12 @@ _msg_ecs_append(Eldbus_Message_Iter *iter, Eina_Bool is_visible) pid = ec->netwm.pid; if (pid <= 0) { - if (cdata && cdata->surface) - wl_client_get_credentials(wl_resource_get_client(cdata->surface), &pid, NULL, NULL); + if (ec->comp_data) + { + E_Comp_Wl_Client_Data *cdata = (E_Comp_Wl_Client_Data*)ec->comp_data; + if (cdata->surface) + wl_client_get_credentials(wl_resource_get_client(cdata->surface), &pid, NULL, NULL); + } } if (ec->iconic) @@ -283,8 +285,8 @@ _msg_ecs_append(Eldbus_Message_Iter *iter, Eina_Bool is_visible) else iconified = 0; - if (cdata) - mapped = cdata->mapped; + if (ec->comp_data) + mapped = ec->comp_data->mapped; _e_info_server_ec_hwc_info_get(ec, &hwc, &hwc_policy, &pl_zpos); @@ -340,12 +342,10 @@ _msg_clients_append(Eldbus_Message_Iter *iter, Eina_Bool is_visible) Eina_List *list_input_region = NULL; Eina_Bool mapped = EINA_FALSE; Eina_Bool transformed = EINA_FALSE; - E_Comp_Wl_Client_Data *cdata = NULL; ec = evas_object_data_get(o, "E_Client"); if (!ec) continue; if (is_visible && e_client_util_ignored_get(ec)) continue; - cdata = e_client_cdata_get(ec); win = e_client_util_win_get(ec); e_comp_layer_name_get(ec->layer, layer_name, sizeof(layer_name)); @@ -358,8 +358,12 @@ _msg_clients_append(Eldbus_Message_Iter *iter, Eina_Bool is_visible) pid = ec->netwm.pid; if (pid <= 0) { - if (cdata && cdata->surface) - wl_client_get_credentials(wl_resource_get_client(cdata->surface), &pid, NULL, NULL); + if (ec->comp_data) + { + E_Comp_Wl_Client_Data *cdata = (E_Comp_Wl_Client_Data*)ec->comp_data; + if (cdata->surface) + wl_client_get_credentials(wl_resource_get_client(cdata->surface), &pid, NULL, NULL); + } } if (ec->iconic) @@ -372,8 +376,8 @@ _msg_clients_append(Eldbus_Message_Iter *iter, Eina_Bool is_visible) else iconified = 0; - if (cdata) - mapped = cdata->mapped; + if (ec->comp_data) + mapped = ec->comp_data->mapped; _e_info_server_ec_hwc_info_get(ec, &hwc, &hwc_policy, &pl_zpos); @@ -870,13 +874,14 @@ _msg_connected_clients_append(Eldbus_Message_Iter *iter) { Eldbus_Message_Iter *array_of_ec; E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; Evas_Object *o; eldbus_message_iter_arguments_append(iter, "a(ss)", &array_of_ec); Eina_List *l; E_Comp_Connected_Client_Info *cinfo; + + Eldbus_Message_Iter* struct_of_ec; #define __CONNECTED_CLIENTS_ARG_APPEND_TYPE(title, str, x...) ({ \ @@ -898,14 +903,17 @@ _msg_connected_clients_append(Eldbus_Message_Iter *iter) ec = evas_object_data_get(o, "E_Client"); if (!ec) continue; if (e_client_util_ignored_get(ec)) continue; - cdata = e_client_cdata_get(ec); win = e_client_util_win_get(ec); if (ec->pixmap) res_id = e_pixmap_res_id_get(ec->pixmap); - if (cdata && cdata->surface) - wl_client_get_credentials(wl_resource_get_client(cdata->surface), &pid, NULL, NULL); + if (ec->comp_data) + { + E_Comp_Wl_Client_Data *cdata = (E_Comp_Wl_Client_Data*)ec->comp_data; + if (cdata->surface) + wl_client_get_credentials(wl_resource_get_client(cdata->surface), &pid, NULL, NULL); + } if (cinfo->pid == pid) { __CONNECTED_CLIENTS_ARG_APPEND_TYPE("[E_Client Info]", "win:0x%08zx res_id:%5d, name:%20s, geo:(%4d, %4d, %4dx%4d), layer:%5d, visible:%d, argb:%d", @@ -1099,7 +1107,7 @@ fail: static const char* _get_win_prop_Rotation(const Evas_Object *evas_obj) { - E_Client *ec; + const E_Client *ec; char *str = NULL; int i, count; @@ -1154,7 +1162,7 @@ fail: static const char* _get_win_prop_Transform(const Evas_Object *evas_obj) { - E_Client *ec; + const E_Client *ec; char *str = NULL; int i, count; @@ -1212,22 +1220,23 @@ fail: static const char* _get_win_prop_Subsurface_Below_Child_List(const Evas_Object *evas_obj) { - E_Comp_Wl_Client_Data *cdata; - E_Client *ec; + const E_Comp_Wl_Client_Data *cdata; + const E_Client *ec; char *str = NULL; const Eina_List *list; const Eina_List *l; - E_Client *child; + const E_Client *child; ec = evas_object_data_get(evas_obj, "E_Client"); EINA_SAFETY_ON_NULL_RETURN_VAL(ec, NULL); - cdata = e_client_cdata_get(ec); - if (!cdata) + if (!ec->comp_data) return strdup("None"); + cdata = (E_Comp_Wl_Client_Data*)ec->comp_data; list = cdata->sub.below_list; + if (!list) return strdup("None"); @@ -1244,22 +1253,23 @@ fail: static const char* _get_win_prop_Subsurface_Child_List(const Evas_Object *evas_obj) { - E_Comp_Wl_Client_Data *cdata; - E_Client *ec; + const E_Comp_Wl_Client_Data *cdata; + const E_Client *ec; char *str = NULL; const Eina_List *list; const Eina_List *l; - E_Client *child; + const E_Client *child; ec = evas_object_data_get(evas_obj, "E_Client"); EINA_SAFETY_ON_NULL_RETURN_VAL(ec, NULL); - cdata = e_client_cdata_get(ec); - if (!cdata) + if (!ec->comp_data) return strdup("None"); + cdata = (E_Comp_Wl_Client_Data*)ec->comp_data; list = cdata->sub.list; + if (!list) return strdup("None"); @@ -1276,17 +1286,18 @@ fail: static const char* _get_win_prop_Subsurface_Parent(const Evas_Object *evas_obj) { - E_Comp_Wl_Client_Data *cdata; - E_Client *ec; + const E_Comp_Wl_Client_Data *cdata; + const E_Client *ec; char *str = NULL; ec = evas_object_data_get(evas_obj, "E_Client"); EINA_SAFETY_ON_NULL_RETURN_VAL(ec, NULL); - cdata = e_client_cdata_get(ec); - if (!cdata) + if (!ec->comp_data) return strdup("None"); + cdata = (E_Comp_Wl_Client_Data*)ec->comp_data; + if (asprintf(&str, "0x%zx", cdata->sub.data ? e_client_util_win_get(cdata->sub.data->parent) : 0) < 0) return NULL; @@ -1296,20 +1307,21 @@ _get_win_prop_Subsurface_Parent(const Evas_Object *evas_obj) static const char* _get_win_prop_Aux_Hint(const Evas_Object *evas_obj) { - E_Comp_Wl_Client_Data *cdata; + const E_Comp_Wl_Client_Data *cdata; const E_Comp_Wl_Aux_Hint *hint; const Eina_List *l; - E_Client *ec; + const E_Client *ec; char *str = NULL; ec = evas_object_data_get(evas_obj, "E_Client"); EINA_SAFETY_ON_NULL_RETURN_VAL(ec, NULL); - cdata = e_client_cdata_get(ec); - if (!cdata) + if (!ec->comp_data) return strdup("None"); + cdata = (E_Comp_Wl_Client_Data*)ec->comp_data; + if (!cdata->aux_hint.hints) return strdup("None"); @@ -1326,15 +1338,13 @@ fail: static const char* _get_win_prop_Video_Client(const Evas_Object *evas_obj) { - E_Client *ec; - E_Comp_Wl_Client_Data *cdata; + const E_Client *ec; char *str = NULL; ec = evas_object_data_get(evas_obj, "E_Client"); EINA_SAFETY_ON_NULL_RETURN_VAL(ec, NULL); - cdata = e_client_cdata_get(ec); - if (asprintf(&str, "%d", cdata ? (cdata->video_client || e_client_video_hw_composition_check((E_Client *)ec)) : 0) < 0) + if (asprintf(&str, "%d", ec->comp_data ? (ec->comp_data->video_client || e_client_video_hw_composition_check((E_Client *)ec)) : 0) < 0) return NULL; return str; @@ -1343,7 +1353,7 @@ _get_win_prop_Video_Client(const Evas_Object *evas_obj) static const char* _get_win_prop_Ignore_first_unmap(const Evas_Object *evas_obj) { - E_Client *ec; + const E_Client *ec; char *str = NULL; ec = evas_object_data_get(evas_obj, "E_Client"); @@ -1386,7 +1396,6 @@ static const char* _set_win_prop_Ignored(Evas_Object *evas_obj, const char *prop_value) { E_Client *ec = evas_object_data_get(evas_obj, "E_Client"); - EINA_SAFETY_ON_NULL_RETURN_VAL(ec, NULL); if (!ec) { @@ -1503,7 +1512,7 @@ _get_win_prop_Override(const Evas_Object *evas_obj) static const char* _get_win_prop_E_Transient_Policy(const Evas_Object *evas_obj) { - E_Client *ec; + const E_Client *ec; char *str = NULL; ec = evas_object_data_get(evas_obj, "E_Client"); @@ -1518,7 +1527,7 @@ _get_win_prop_E_Transient_Policy(const Evas_Object *evas_obj) static const char* _get_win_prop_E_FullScreen_Policy(const Evas_Object *evas_obj) { - E_Client *ec; + const E_Client *ec; char *str = NULL; ec = evas_object_data_get(evas_obj, "E_Client"); @@ -1533,7 +1542,7 @@ _get_win_prop_E_FullScreen_Policy(const Evas_Object *evas_obj) static const char* _get_win_prop_E_Maximize_Policy(const Evas_Object *evas_obj) { - E_Client *ec; + const E_Client *ec; char *str = NULL; ec = evas_object_data_get(evas_obj, "E_Client"); @@ -1839,7 +1848,7 @@ _set_win_prop_Layer(Evas_Object *evas_obj, const char *prop_value) static const char* _get_win_prop_Layer(const Evas_Object *evas_obj) { - E_Client *ec; + const E_Client *ec; char *str = NULL; char layer_name[48] = {0,}; @@ -1857,7 +1866,7 @@ _get_win_prop_Layer(const Evas_Object *evas_obj) static const char* _get_win_prop_Shape_input(const Evas_Object *evas_obj) { - E_Client *ec; + const E_Client *ec; char *str = NULL; int i = 0; @@ -1881,7 +1890,7 @@ fail: static const char* _get_win_prop_Shape_rects(const Evas_Object *evas_obj) { - E_Client *ec; + const E_Client *ec; char *str = NULL; int i = 0; @@ -1905,10 +1914,10 @@ fail: static const char* _get_win_prop_Transients(const Evas_Object *evas_obj) { - E_Client *ec; + const E_Client *ec; char *str = NULL; - E_Client *child; + const E_Client *child; const Eina_List *l; ec = evas_object_data_get(evas_obj, "E_Client"); @@ -1930,7 +1939,7 @@ fail: static const char* _get_win_prop_ParentWindowID(const Evas_Object *evas_obj) { - E_Client *ec; + const E_Client *ec; char *str = NULL; ec = evas_object_data_get(evas_obj, "E_Client"); @@ -1969,7 +1978,7 @@ _set_win_prop_Geometry(Evas_Object *evas_obj, const char *prop_value) static const char* _get_win_prop_Geometry(const Evas_Object *evas_obj) { - E_Client *ec; + const E_Client *ec; char *str = NULL; ec = evas_object_data_get(evas_obj, "E_Client"); @@ -1994,7 +2003,7 @@ _set_win_prop_Role(Evas_Object *evas_obj, const char *prop_value) static const char* _get_win_prop_Role(const Evas_Object *evas_obj) { - E_Client *ec; + const E_Client *ec; char *str = NULL; ec = evas_object_data_get(evas_obj, "E_Client"); @@ -2026,7 +2035,7 @@ _set_win_prop_Window_Name(Evas_Object *evas_obj, const char *prop_value) static const char* _get_win_prop_Window_Name(const Evas_Object *evas_obj) { - E_Client *ec; + const E_Client *ec; char *str = NULL; ec = evas_object_data_get(evas_obj, "E_Client"); @@ -2040,7 +2049,7 @@ _get_win_prop_Window_Name(const Evas_Object *evas_obj) static const char* _get_win_prop_ResourceID(const Evas_Object *evas_obj) { - E_Client *ec; + const E_Client *ec; char *str = NULL; ec = evas_object_data_get(evas_obj, "E_Client"); @@ -2058,17 +2067,19 @@ _get_win_prop_ResourceID(const Evas_Object *evas_obj) static const char* _get_win_prop_PID(const Evas_Object *evas_obj) { - E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; + const E_Client *ec; char *str = NULL; pid_t pid = -1; ec = evas_object_data_get(evas_obj, "E_Client"); EINA_SAFETY_ON_NULL_RETURN_VAL(ec, NULL); - cdata = e_client_cdata_get(ec); - if (cdata && cdata->surface) - wl_client_get_credentials(wl_resource_get_client(cdata->surface), &pid, NULL, NULL); + if (ec->comp_data) + { + const E_Comp_Wl_Client_Data *cdata = (const E_Comp_Wl_Client_Data*)ec->comp_data; + if (cdata->surface) + wl_client_get_credentials(wl_resource_get_client(cdata->surface), &pid, NULL, NULL); + } if (asprintf(&str, "%d", pid) < 0) return NULL; @@ -2079,7 +2090,7 @@ _get_win_prop_PID(const Evas_Object *evas_obj) static const char* _get_win_prop_Window_ID(const Evas_Object *evas_obj) { - E_Client *ec; + const E_Client *ec; char *str = NULL; ec = evas_object_data_get(evas_obj, "E_Client"); @@ -2519,11 +2530,14 @@ _msg_window_prop_append(const Eldbus_Message *msg, uint32_t mode, const char *va else if (mode == WINDOW_PID_MODE) { pid_t pid = -1; - E_Comp_Wl_Client_Data *cdata = e_client_cdata_get(ec); - - if (cdata && cdata->surface) - wl_client_get_credentials(wl_resource_get_client(cdata->surface), &pid, NULL, NULL); - + if (ec->comp_data) + { + E_Comp_Wl_Client_Data *cdata = (E_Comp_Wl_Client_Data*)ec->comp_data; + if (cdata->surface) + { + wl_client_get_credentials(wl_resource_get_client(cdata->surface), &pid, NULL, NULL); + } + } if (pid == value_number) { window_exists = EINA_TRUE; @@ -2688,7 +2702,6 @@ static void _e_info_server_cb_wins_dump_topvwins(const char *dir, Eldbus_Message { Evas_Object *o; E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; Ecore_Window win; int rotation = 0; char fname[PATH_MAX]; @@ -2720,9 +2733,8 @@ static void _e_info_server_cb_wins_dump_topvwins(const char *dir, Eldbus_Message EINA_LIST_FREE(topvwins, ec) { win = e_client_util_win_get(ec); - cdata = e_client_cdata_get(ec); - if (cdata) - rotation = cdata->scaler.buffer_viewport.buffer.transform * 90; + if (ec->comp_data) + rotation = ec->comp_data->scaler.buffer_viewport.buffer.transform * 90; snprintf(fname, sizeof(fname), "0x%08zx_%d", win, rotation); s_fname = eina_stringshare_add(fname); @@ -2976,7 +2988,6 @@ _e_info_server_cb_subsurface(const Eldbus_Service_Interface *iface EINA_UNUSED, Eldbus_Message_Iter *iter = eldbus_message_iter_get(reply); Eldbus_Message_Iter *array_of_ec; E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; Evas_Object *o; eldbus_message_iter_arguments_append(iter, "a("SIGNATURE_SUBSURFACE")", &array_of_ec); @@ -3008,15 +3019,14 @@ _e_info_server_cb_subsurface(const Eldbus_Service_Interface *iface EINA_UNUSED, } else { - cdata = e_client_cdata_get(ec); - if (e_object_is_del(E_OBJECT(ec)) || !cdata) continue; - if (!cdata->sub.data && - !cdata->sub.list && !cdata->sub.list_pending && - !cdata->sub.below_list && !cdata->sub.below_list_pending) + if (e_object_is_del(E_OBJECT(ec)) || !ec->comp_data) continue; + if (!ec->comp_data->sub.data && + !ec->comp_data->sub.list && !ec->comp_data->sub.list_pending && + !ec->comp_data->sub.below_list && !ec->comp_data->sub.below_list_pending) continue; win = e_client_util_win_get(ec); - if (cdata->sub.data) - parent = e_client_util_win_get(cdata->sub.data->parent); + if (ec->comp_data->sub.data) + parent = e_client_util_win_get(ec->comp_data->sub.data->parent); buffer = e_pixmap_resource_get(ec->pixmap); if (buffer) buf_id = (buffer->resource) ? wl_resource_get_id(buffer->resource) : (WAYLAND_SERVER_RESOURCE_ID_MASK & 99999); @@ -3024,7 +3034,7 @@ _e_info_server_cb_subsurface(const Eldbus_Service_Interface *iface EINA_UNUSED, if (map) { Evas_Coord x1, x2, y1, y2; - E_Comp_Wl_Buffer_Viewport *vp = &cdata->scaler.buffer_viewport; + E_Comp_Wl_Buffer_Viewport *vp = &ec->comp_data->scaler.buffer_viewport; evas_map_point_coord_get(map, 0, &x1, &y1, NULL); evas_map_point_coord_get(map, 2, &x2, &y2, NULL); x = x1, y = y1, w = x2 - x1, h = y2 - y1; @@ -3035,12 +3045,12 @@ _e_info_server_cb_subsurface(const Eldbus_Service_Interface *iface EINA_UNUSED, visible = evas_object_visible_get(o); alpha = e_comp_object_alpha_get(ec->frame); ignore = e_client_util_ignored_get(ec); - if (cdata->sub.below_obj) - bgrect = (Ecore_Window)cdata->sub.below_obj; + if (ec->comp_data->sub.below_obj) + bgrect = (Ecore_Window)ec->comp_data->sub.below_obj; maskobj = e_comp_object_mask_has(ec->frame); - video = (cdata->video_client || e_client_video_hw_composition_check(ec)) ? 1 : 0; - if (cdata->sub.data) - stand = cdata->sub.data->stand_alone; + video = (ec->comp_data->video_client || e_client_video_hw_composition_check(ec)) ? 1 : 0; + if (ec->comp_data->sub.data) + stand = ec->comp_data->sub.data->stand_alone; name = e_client_util_name_get(ec); if (!name) name = "NO NAME"; @@ -4320,7 +4330,6 @@ static Eina_Bool _e_info_server_cb_buffer_change(void *data, int type, void *event) { E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; E_Event_Client *ev = event; Ecore_Window event_win; char fname[PATH_MAX]; @@ -4354,9 +4363,7 @@ _e_info_server_cb_buffer_change(void *data, int type, void *event) buffer = e_pixmap_resource_get(ec->pixmap); if (!buffer) return ECORE_CALLBACK_PASS_ON; - cdata = e_client_cdata_get(ec); - if (!cdata) return ECORE_CALLBACK_PASS_ON; - rotation = cdata->scaler.buffer_viewport.buffer.transform * 90; + rotation = ec->comp_data->scaler.buffer_viewport.buffer.transform * 90; event_win = e_client_util_win_get(ec); switch (buffer->type) @@ -5622,7 +5629,6 @@ static int _e_info_server_ec_kill(uint32_t mode, void *value, Eldbus_Message_Iter *array_of_string) { E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; Evas_Object *o; int count = 0; char result[1024]; @@ -5650,9 +5656,12 @@ _e_info_server_ec_kill(uint32_t mode, void *value, Eldbus_Message_Iter *array_of pid = ec->netwm.pid; if (pid <= 0) { - cdata = e_client_cdata_get(ec); - if (cdata && cdata->surface) - wl_client_get_credentials(wl_resource_get_client(cdata->surface), &pid, NULL, NULL); + if (ec->comp_data) + { + E_Comp_Wl_Client_Data *cdata = (E_Comp_Wl_Client_Data*)ec->comp_data; + if (cdata->surface) + wl_client_get_credentials(wl_resource_get_client(cdata->surface), &pid, NULL, NULL); + } } if (pid != *(pid_t *)value) continue; @@ -5744,7 +5753,6 @@ _e_info_server_cb_get_windows(const Eldbus_Service_Interface *iface EINA_UNUSED, Eldbus_Message_Iter *iter; Eina_Bool res; E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; char *value; uint32_t mode; int count = 0; @@ -5800,9 +5808,12 @@ _e_info_server_cb_get_windows(const Eldbus_Service_Interface *iface EINA_UNUSED, ec_pid = ec->netwm.pid; if (ec_pid <= 0) { - cdata = e_client_cdata_get(ec); - if (cdata && cdata->surface) - wl_client_get_credentials(wl_resource_get_client(cdata->surface), &ec_pid, NULL, NULL); + if (ec->comp_data) + { + E_Comp_Wl_Client_Data *cdata = (E_Comp_Wl_Client_Data*)ec->comp_data; + if (cdata->surface) + wl_client_get_credentials(wl_resource_get_client(cdata->surface), &ec_pid, NULL, NULL); + } } if (ec_pid != pid) continue; @@ -5937,7 +5948,6 @@ _e_info_server_cb_wininfo(const Eldbus_Service_Interface *iface EINA_UNUSED, con Eldbus_Message *reply; Eina_Bool res; E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; uint64_t win; Ecore_Window pwin; uint32_t res_id = 0; @@ -5970,9 +5980,12 @@ _e_info_server_cb_wininfo(const Eldbus_Service_Interface *iface EINA_UNUSED, con pid = ec->netwm.pid; if (pid <= 0) { - cdata = e_client_cdata_get(ec); - if (cdata && cdata->surface) - wl_client_get_credentials(wl_resource_get_client(cdata->surface), &pid, NULL, NULL); + if (ec->comp_data) + { + E_Comp_Wl_Client_Data *cdata = (E_Comp_Wl_Client_Data*)ec->comp_data; + if (cdata->surface) + wl_client_get_credentials(wl_resource_get_client(cdata->surface), &pid, NULL, NULL); + } } _e_info_server_ec_hwc_info_get(ec, &hwc, &hwc_policy, &pl_zpos); @@ -6031,15 +6044,14 @@ _e_info_server_cb_wininfo_size_hints_append(E_Client *ec, Eldbus_Message_Iter *a static void _e_info_server_cb_wininfo_wm_hints_append(E_Client *ec, Eldbus_Message_Iter *array_of_hints) { - E_Comp_Wl_Client_Data *cdata = NULL; Eina_List *l; E_Comp_Wl_Aux_Hint *hint; char temp[512] = {0}; - cdata = e_client_cdata_get(ec); - if (!cdata) return; + if (!ec->comp_data) + return; - EINA_LIST_FOREACH(cdata->aux_hint.hints, l, hint) + EINA_LIST_FOREACH(ec->comp_data->aux_hint.hints, l, hint) { snprintf(temp, sizeof(temp), "%s: %s", hint->hint, hint->val); eldbus_message_iter_arguments_append(array_of_hints, "s", temp); diff --git a/src/bin/e_keyrouter.c b/src/bin/e_keyrouter.c index f19e36b68c..765923b587 100644 --- a/src/bin/e_keyrouter.c +++ b/src/bin/e_keyrouter.c @@ -575,16 +575,13 @@ e_keyrouter_composition_key_del(int *keys, int count) E_API void e_keyrouter_event_surface_send(E_Client *ec, int key) { - E_Comp_Wl_Client_Data *cdata = NULL; - EINA_SAFETY_ON_NULL_RETURN(krt); EINA_SAFETY_ON_NULL_RETURN(ec); - cdata = e_client_cdata_get(ec); - EINA_SAFETY_ON_NULL_RETURN(cdata); - EINA_SAFETY_ON_NULL_RETURN(cdata->surface); + EINA_SAFETY_ON_NULL_RETURN(ec->comp_data); + EINA_SAFETY_ON_NULL_RETURN(ec->comp_data->surface); key = key - 8; - e_keyrouter_wl_event_surface_send(cdata->surface, key, TIZEN_KEYROUTER_MODE_NONE); + e_keyrouter_wl_event_surface_send(ec->comp_data->surface, key, TIZEN_KEYROUTER_MODE_NONE); } E_API int diff --git a/src/bin/e_keyrouter_events.c b/src/bin/e_keyrouter_events.c index fc0123fd23..e17cf36358 100644 --- a/src/bin/e_keyrouter_events.c +++ b/src/bin/e_keyrouter_events.c @@ -870,12 +870,9 @@ _e_keyrouter_send_key_event(int type, struct wl_resource *surface, struct wl_cli struct wl_resource * e_keyrouter_util_get_surface_from_eclient(E_Client *client) { - E_Comp_Wl_Client_Data *cdata = NULL; - if (!client) return NULL; - cdata = e_client_cdata_get(client); - if (!cdata) return NULL; + if (!client || !client->comp_data) return NULL; - return cdata->wl_surface; + return client->comp_data->wl_surface; } int diff --git a/src/bin/e_keyrouter_wl.c b/src/bin/e_keyrouter_wl.c index 23c977be44..57cf32abb3 100644 --- a/src/bin/e_keyrouter_wl.c +++ b/src/bin/e_keyrouter_wl.c @@ -62,7 +62,6 @@ Eina_Bool e_keyrouter_wl_key_send(Ecore_Event_Key *ev, Eina_Bool pressed, struct wl_client *client, struct wl_resource *surface, Eina_Bool focused) { E_Client *ec = NULL; - E_Comp_Wl_Client_Data *cdata = NULL; struct wl_client *wc = NULL; uint32_t keycode; enum wl_keyboard_key_state state; @@ -100,20 +99,16 @@ e_keyrouter_wl_key_send(Ecore_Event_Key *ev, Eina_Bool pressed, struct wl_client if ((!e_client_action_get()) && (!e_comp->input_key_grabs)) { ec = e_client_focused_get(); - if (ec) + if (ec && ec->comp_data && ec->comp_data->surface) { - cdata = e_client_cdata_get(ec); - if (cdata && cdata->surface) + if (e_comp_wl->kbd.focused) { - if (e_comp_wl->kbd.focused) - { - wc = wl_resource_get_client(cdata->surface); - _e_keyrouter_wl_key_send(ev, state, e_comp_wl->kbd.focused, EINA_TRUE, wc, surface); - } - - /* update modifier state */ - e_comp_wl_input_keyboard_state_update(keycode, pressed); + wc = wl_resource_get_client(ec->comp_data->surface); + _e_keyrouter_wl_key_send(ev, state, e_comp_wl->kbd.focused, EINA_TRUE, wc, surface); } + + /* update modifier state */ + e_comp_wl_input_keyboard_state_update(keycode, pressed); } } return !!ec; diff --git a/src/bin/e_output.c b/src/bin/e_output.c index 6710d5a9e9..e84598ccbe 100644 --- a/src/bin/e_output.c +++ b/src/bin/e_output.c @@ -226,7 +226,7 @@ _e_output_zoom_top_visible_ec_get() if (!ec->frame) continue; if (!evas_object_visible_get(ec->frame)) continue; /* if ec is subsurface, skip this */ - cdata = e_client_cdata_get(ec); + cdata = (E_Comp_Wl_Client_Data *)ec->comp_data; if (cdata && cdata->sub.data) continue; return ec; @@ -579,7 +579,7 @@ _e_output_top_visible_ec_get() if (!ec->frame) continue; if (!evas_object_visible_get(ec->frame)) continue; /* if ec is subsurface, skip this */ - cdata = e_client_cdata_get(ec); + cdata = (E_Comp_Wl_Client_Data *)ec->comp_data; if (cdata && cdata->sub.data) continue; return ec; @@ -724,7 +724,7 @@ _e_output_visible_client_check(E_Output *output) if (ec->is_cursor) continue; if (!ec->visible) continue; if (!evas_object_visible_get(ec->frame)) continue; - cdata = e_client_cdata_get(ec); + cdata = (E_Comp_Wl_Client_Data *)ec->comp_data; if (cdata && cdata->sub.data) continue; /* skip subsurface */ if (cdata && !cdata->mapped) continue; if (ec->iconic) continue; @@ -753,18 +753,18 @@ static void _e_output_client_resize(int w, int h) { E_Client *ec = NULL; - E_Comp_Wl_Client_Data *cdata = NULL; + E_Comp_Client_Data *cdata = NULL; E_CLIENT_FOREACH(ec) { if ((ec->visible && !ec->input_only) || (e_client_util_name_get(ec) != NULL && !ec->input_only)) { - cdata = e_client_cdata_get(ec); + cdata = ec->comp_data; if (cdata == NULL) continue; if (cdata->shell.configure_send == NULL) continue; - cdata->shell.configure_send(cdata->shell.surface, 0, w ,h); + cdata->shell.configure_send(ec->comp_data->shell.surface, 0, w ,h); } } } diff --git a/src/bin/e_pixmap.c b/src/bin/e_pixmap.c index 945b733ff0..7b6d3dfdd0 100644 --- a/src/bin/e_pixmap.c +++ b/src/bin/e_pixmap.c @@ -503,47 +503,37 @@ E_API Eina_Bool e_pixmap_size_changed(E_Pixmap *cp, int w, int h) { E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; - EINA_SAFETY_ON_NULL_RETURN_VAL(cp, EINA_FALSE); EINA_SAFETY_ON_NULL_RETURN_VAL(cp->client, EINA_FALSE); if (cp->dirty) return EINA_TRUE; ec = cp->client; - EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE); - - cdata = e_client_cdata_get(ec); - if (!cdata|| e_object_is_del(E_OBJECT(ec))) + if (!ec->comp_data || e_object_is_del(E_OBJECT(ec))) return (w != cp->w) || (h != cp->h); - return (w != cdata->width_from_buffer) || (h != cdata->height_from_buffer); + return (w != ec->comp_data->width_from_buffer) || (h != ec->comp_data->height_from_buffer); } E_API Eina_Bool e_pixmap_size_get(E_Pixmap *cp, int *w, int *h) { E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; - if (w) *w = 0; if (h) *h = 0; EINA_SAFETY_ON_NULL_RETURN_VAL(cp, EINA_FALSE); EINA_SAFETY_ON_NULL_RETURN_VAL(cp->client, EINA_FALSE); ec = cp->client; - EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE); - - cdata = e_client_cdata_get(ec); - if (!cdata || e_object_is_del(E_OBJECT(ec))) + if (!ec->comp_data || e_object_is_del(E_OBJECT(ec))) { if (w) *w = cp->w; if (h) *h = cp->h; return (cp->w > 0) && (cp->h > 0); } - if (w) *w = cdata->width_from_buffer; - if (h) *h = cdata->height_from_buffer; - return (cdata->width_from_buffer > 0) && (cdata->height_from_buffer > 0); + if (w) *w = ec->comp_data->width_from_buffer; + if (h) *h = ec->comp_data->height_from_buffer; + return (ec->comp_data->width_from_buffer > 0) && (ec->comp_data->height_from_buffer > 0); } E_API unsigned int @@ -699,15 +689,13 @@ e_pixmap_image_clear(E_Pixmap *cp, Eina_Bool cache) cp->failures = 0; if (cache) { - E_Comp_Wl_Client_Data *cdata; + E_Comp_Wl_Client_Data *cd; struct wl_resource *cb; Eina_List *l, *ll; - if (!cp->client) return; - cdata = e_client_cdata_get(cp->client); - if ((!cdata)) return; - - EINA_LIST_FOREACH_SAFE(cdata->frames, l, ll, cb) + if ((!cp->client) || (!cp->client->comp_data)) return; + cd = (E_Comp_Wl_Client_Data *)cp->client->comp_data; + EINA_LIST_FOREACH_SAFE(cd->frames, l, ll, cb) { wl_callback_send_done(cb, (unsigned int)(ecore_loop_time_get() * 1000)); wl_resource_destroy(cb); @@ -947,17 +935,19 @@ e_pixmap_cdata_get(E_Pixmap *cp) E_API void e_pixmap_cdata_set(E_Pixmap *cp, E_Comp_Wl_Client_Data *cdata) { + E_Comp_Wl_Client_Data *cd = (E_Comp_Wl_Client_Data*)cdata; + EINA_SAFETY_ON_NULL_RETURN(cp); if (cp->cdata) { if (cp->own_cdata) { - if (cdata) + if (cd) { - cdata->wl_surface = cp->cdata->wl_surface; - cdata->scaler.viewport = cp->cdata->scaler.viewport; - cdata->pending.buffer_viewport = cp->cdata->pending.buffer_viewport; + cd->wl_surface = cp->cdata->wl_surface; + cd->scaler.viewport = cp->cdata->scaler.viewport; + cd->pending.buffer_viewport = cp->cdata->pending.buffer_viewport; } E_FREE(cp->cdata); @@ -965,7 +955,7 @@ e_pixmap_cdata_set(E_Pixmap *cp, E_Comp_Wl_Client_Data *cdata) } } - cp->cdata = cdata; + cp->cdata = cd; } E_API E_Pixmap_Hook * @@ -1026,7 +1016,7 @@ e_pixmap_shutdown(void) static void _e_pixmap_buffer_clear(E_Pixmap *cp, Eina_Bool only_free) { - E_Comp_Wl_Client_Data *cp_cdata; + E_Comp_Wl_Client_Data *cdata; struct wl_resource *cb; Eina_List *l, *ll; @@ -1034,8 +1024,6 @@ _e_pixmap_buffer_clear(E_Pixmap *cp, Eina_Bool only_free) /* if not only free, client should be iconic state */ if (!only_free && !e_policy_visibility_client_is_iconic(cp->client)) return; - cp_cdata = e_client_cdata_get(cp->client); - DBG("PIXMAP: Buffer Flush(%s) '%s'(%p) only_free:%d", cp->shm_flusher ? "SHM" : "NATIVE", cp->client->icccm.name?:"", cp->client, only_free); @@ -1054,7 +1042,7 @@ _e_pixmap_buffer_clear(E_Pixmap *cp, Eina_Bool only_free) } else { - if ((cp->buffer) && (cp_cdata)) + if ((cp->buffer) && (cp->client->comp_data)) { if ((cp->buffer->type == E_COMP_WL_BUFFER_TYPE_TBM) || (cp->buffer->type == E_COMP_WL_BUFFER_TYPE_NATIVE)) @@ -1062,7 +1050,7 @@ _e_pixmap_buffer_clear(E_Pixmap *cp, Eina_Bool only_free) struct wayland_tbm_client_queue * cqueue; cqueue = wayland_tbm_server_client_queue_get(e_comp_wl->tbm.server, - cp_cdata->wl_surface); + cp->client->comp_data->wl_surface); if (!cqueue) return; if (only_free) @@ -1076,19 +1064,20 @@ _e_pixmap_buffer_clear(E_Pixmap *cp, Eina_Bool only_free) if (!only_free) { /* release the helded buffer by e_client */ - if (cp_cdata) + if (cp->client->comp_data) { /* release the helded buffer by e_client */ - e_comp_wl_buffer_reference(&cp_cdata->buffer_ref, NULL); - e_presentation_time_container_feedback_discard(&cp_cdata->presentation_container); + e_comp_wl_buffer_reference(&cp->client->comp_data->buffer_ref, NULL); + e_presentation_time_container_feedback_discard(&cp->client->comp_data->presentation_container); } /* composite object clear */ e_comp_object_clear(cp->client->frame); /* pending frame event callback*/ - if (!cp_cdata) return; - EINA_LIST_FOREACH_SAFE(cp_cdata->frames, l, ll, cb) + if (!cp->client->comp_data) return; + cdata = (E_Comp_Wl_Client_Data *)cp->client->comp_data; + EINA_LIST_FOREACH_SAFE(cdata->frames, l, ll, cb) { wl_callback_send_done(cb, (unsigned int)(ecore_loop_time_get() * 1000)); wl_resource_destroy(cb); diff --git a/src/bin/e_plane.c b/src/bin/e_plane.c index a2ddfb4e0b..8c8d8054de 100644 --- a/src/bin/e_plane.c +++ b/src/bin/e_plane.c @@ -72,7 +72,7 @@ _e_plane_hook_call(E_Plane_Hook_Point hookpoint, E_Plane *plane) static E_Comp_Wl_Buffer * _get_comp_wl_buffer(E_Client *ec) { - E_Comp_Wl_Client_Data *cdata = e_client_cdata_get(ec); + E_Comp_Wl_Client_Data *cdata = (E_Comp_Wl_Client_Data*)ec->comp_data; if (!cdata) return NULL; E_Comp_Wl_Buffer_Ref *buffer_ref = &cdata->buffer_ref; @@ -536,10 +536,9 @@ _e_plane_cursor_surface_acquire(E_Plane *plane) tbm_surface_h tsurface = NULL; E_Plane_Renderer *renderer = plane->renderer; E_Client *ec = plane->ec; - E_Comp_Wl_Client_Data *cdata = e_client_cdata_get(ec); E_Comp_Wl_Buffer *buffer = NULL; - buffer = cdata->buffer_ref.buffer; + buffer = ec->comp_data->buffer_ref.buffer; if (!buffer) return NULL; if (!e_comp_object_hwc_update_exists(ec->frame)) return NULL; diff --git a/src/bin/e_plane_renderer.c b/src/bin/e_plane_renderer.c index aa0b890885..06256522e8 100644 --- a/src/bin/e_plane_renderer.c +++ b/src/bin/e_plane_renderer.c @@ -69,7 +69,7 @@ _get_comp_wl_buffer(E_Client *ec) if (!ec) return NULL; - cdata = e_client_cdata_get(ec); + cdata = (E_Comp_Wl_Client_Data*)ec->comp_data; if (!cdata) return NULL; E_Comp_Wl_Buffer_Ref *buffer_ref = &cdata->buffer_ref; @@ -84,7 +84,7 @@ _get_wl_buffer(E_Client *ec) if (!ec) return NULL; - cdata = e_client_cdata_get(ec); + cdata = (E_Comp_Wl_Client_Data*)ec->comp_data; if (!cdata) return NULL; E_Comp_Wl_Buffer_Ref *buffer_ref = &cdata->buffer_ref; @@ -224,7 +224,7 @@ _e_plane_renderer_wayland_tbm_client_queue_get(E_Client *ec) EINA_SAFETY_ON_NULL_RETURN_VAL(wl_cdata, NULL); - cdata = e_pixmap_cdata_get(ec->pixmap); + cdata = (E_Comp_Wl_Client_Data *)e_pixmap_cdata_get(ec->pixmap); EINA_SAFETY_ON_NULL_RETURN_VAL(cdata, NULL); wl_surface = cdata->wl_surface; @@ -996,7 +996,7 @@ _e_plane_renderer_recover_ec(E_Plane_Renderer *renderer) if (!plane->ec_redirected) return; if (!ec) return; - cdata = e_client_cdata_get(ec); + cdata = ec->comp_data; if (!cdata) return; if (!cdata->mapped) return; @@ -1260,7 +1260,6 @@ e_plane_renderer_cursor_surface_refresh(E_Plane_Renderer *renderer, E_Client *ec tbm_surface_error_e ret = TBM_SURFACE_ERROR_NONE; tbm_surface_info_s tsurface_info; E_Pointer *pointer = NULL; - E_Comp_Wl_Client_Data *cdata = NULL; EINA_SAFETY_ON_NULL_RETURN_VAL(renderer, EINA_FALSE); EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE); @@ -1271,8 +1270,7 @@ e_plane_renderer_cursor_surface_refresh(E_Plane_Renderer *renderer, E_Client *ec output = plane->output; EINA_SAFETY_ON_NULL_RETURN_VAL(output, EINA_FALSE); - cdata = e_client_cdata_get(ec); - buffer = cdata->buffer_ref.buffer; + buffer = ec->comp_data->buffer_ref.buffer; EINA_SAFETY_ON_NULL_RETURN_VAL(buffer, EINA_FALSE); pointer = e_pointer_get(ec); @@ -1295,8 +1293,7 @@ e_plane_renderer_cursor_surface_refresh(E_Plane_Renderer *renderer, E_Client *ec } else { - E_Comp_Wl_Client_Data *cdata = e_client_cdata_get(ec); - ERR("unkown buffer type:%d", cdata->buffer_ref.buffer->type); + ERR("unkown buffer type:%d", ec->comp_data->buffer_ref.buffer->type); return EINA_FALSE; } diff --git a/src/bin/e_pointer.c b/src/bin/e_pointer.c index 59d0bcddd9..97a2355a75 100644 --- a/src/bin/e_pointer.c +++ b/src/bin/e_pointer.c @@ -158,7 +158,6 @@ EINTERN void e_pointer_object_set(E_Pointer *ptr, Evas_Object *obj, int x, int y) { E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; EINA_SAFETY_ON_NULL_RETURN(ptr); @@ -177,11 +176,10 @@ e_pointer_object_set(E_Pointer *ptr, Evas_Object *obj, int x, int y) ec = e_comp_object_client_get(ptr->o_ptr); if ((ec) && (!e_object_is_del(E_OBJECT(ec)))) { - cdata = e_client_cdata_get(ec); ec->hidden = 1; ec->visible = EINA_FALSE; ec->visibility.obscured = E_VISIBILITY_FULLY_OBSCURED; - cdata->mapped = EINA_FALSE; + ec->comp_data->mapped = EINA_FALSE; ec->override = 1; /* ignore the previous cursor_ec */ } @@ -204,12 +202,11 @@ e_pointer_object_set(E_Pointer *ptr, Evas_Object *obj, int x, int y) ec = e_comp_object_client_get(obj); if (ec && e_pixmap_usable_get(ec->pixmap)) { - cdata = e_client_cdata_get(ec); ec->hidden = 0; ec->visible = EINA_TRUE; ec->visibility.obscured = E_VISIBILITY_UNOBSCURED; evas_object_geometry_set(ec->frame, ec->x, ec->y, ec->w, ec->h); - cdata->mapped = EINA_TRUE; + ec->comp_data->mapped = EINA_TRUE; ec->override = 0; /* do not ignore the cursor_ec to set the image object */ if (e_comp_is_on_overlay(ec)) diff --git a/src/bin/e_policy.c b/src/bin/e_policy.c index de93d26c8a..d71cd8ae81 100644 --- a/src/bin/e_policy.c +++ b/src/bin/e_policy.c @@ -1778,12 +1778,10 @@ e_policy_client_is_quickpanel(E_Client *ec) Eina_Bool e_policy_client_is_conformant(E_Client *ec) { - E_Comp_Wl_Client_Data *cdata = NULL; - E_OBJECT_CHECK_RETURN(ec, EINA_FALSE); - cdata = e_client_cdata_get(ec); - EINA_SAFETY_ON_NULL_RETURN_VAL(cdata, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(ec->comp_data, EINA_FALSE); + E_Comp_Wl_Client_Data *cdata = (E_Comp_Wl_Client_Data *)ec->comp_data; if (cdata->conformant == 1) { return EINA_TRUE; @@ -1837,13 +1835,13 @@ e_policy_client_is_noti(E_Client *ec) Eina_Bool e_policy_client_is_subsurface(E_Client *ec) { - E_Comp_Wl_Client_Data *cdata= NULL; + E_Comp_Wl_Client_Data *cd; E_OBJECT_CHECK_RETURN(ec, EINA_FALSE); E_OBJECT_TYPE_CHECK_RETURN(ec, E_CLIENT_TYPE, EINA_FALSE); - cdata = e_client_cdata_get(ec); - if (cdata && cdata->sub.data) + cd = (E_Comp_Wl_Client_Data *)ec->comp_data; + if (cd && cd->sub.data) return EINA_TRUE; return EINA_FALSE; @@ -2059,12 +2057,10 @@ e_policy_event_simple(E_Client *ec, int type) E_API Eina_Bool e_policy_aux_message_use_get(E_Client *ec) { - E_Comp_Wl_Client_Data *cdata = NULL; - E_OBJECT_CHECK_RETURN(ec, EINA_FALSE); - cdata = e_client_cdata_get(ec); - EINA_SAFETY_ON_NULL_RETURN_VAL(cdata, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(ec->comp_data, EINA_FALSE); + E_Comp_Wl_Client_Data *cdata = (E_Comp_Wl_Client_Data *)ec->comp_data; if (cdata->aux_hint.use_msg) { return EINA_TRUE; diff --git a/src/bin/e_policy_conformant.c b/src/bin/e_policy_conformant.c index e7d31c9cbe..c9a580a76e 100644 --- a/src/bin/e_policy_conformant.c +++ b/src/bin/e_policy_conformant.c @@ -130,7 +130,6 @@ _conf_state_update(Conformant_Type type, Eina_Bool visible, int x, int y, int w, { Conformant_Client *cfc; Conformant_Wl_Res *cres; - E_Comp_Wl_Client_Data *cfc_cdata = NULL; uint32_t conf_type; Eina_List *l; Eina_Bool wait_ack = EINA_FALSE; @@ -193,11 +192,10 @@ _conf_state_update(Conformant_Type type, Eina_Bool visible, int x, int y, int w, cres->ack_done = EINA_FALSE; if (!cres->use_ack) { - cfc_cdata = e_client_cdata_get(cfc->ec); cres->ack_done = EINA_TRUE; tizen_policy_send_conformant_area (cres->res, - cfc_cdata->surface, + cfc->ec->comp_data->surface, conf_type, (unsigned int)visible, x, y, w, h); } @@ -205,11 +203,10 @@ _conf_state_update(Conformant_Type type, Eina_Bool visible, int x, int y, int w, { uint32_t serial; serial = wl_display_next_serial(e_comp_wl->wl.disp); - cfc_cdata = e_client_cdata_get(cfc->ec); tizen_policy_send_conformant_region (cres->res, - cfc_cdata->surface, + cfc->ec->comp_data->surface, conf_type, (unsigned int)visible, x, y, w, h, serial); diff --git a/src/bin/e_policy_visibility.c b/src/bin/e_policy_visibility.c index cef4dbf279..bd00d7f77a 100644 --- a/src/bin/e_policy_visibility.c +++ b/src/bin/e_policy_visibility.c @@ -167,7 +167,6 @@ _e_policy_check_transient_child_visible(E_Client *ancestor_ec, E_Client *ec) Eina_Bool visible = EINA_FALSE; Eina_List *list = NULL; E_Client *child_ec = NULL; - E_Comp_Wl_Client_Data *child_cdata = NULL; int anc_x, anc_y, anc_w, anc_h; int child_x, child_y, child_w, child_h; @@ -180,9 +179,8 @@ _e_policy_check_transient_child_visible(E_Client *ancestor_ec, E_Client *ec) { if (visible == EINA_TRUE) continue; - child_cdata = e_client_cdata_get(child_ec); - if (!child_cdata) continue; - if (!child_cdata->mapped && !child_ec->use_splash) continue; + if (!child_ec->comp_data) continue; + if (!child_ec->comp_data->mapped && !child_ec->use_splash) continue; if (child_ec->transient_policy == E_TRANSIENT_BELOW) continue; if ((child_ec->exp_iconify.skip_iconify == EINA_TRUE) || @@ -235,7 +233,6 @@ static Eina_Bool _e_policy_check_above_alpha_opaque(E_Client *ec) { E_Client *above_ec; - E_Comp_Wl_Client_Data *above_cdata = NULL; Evas_Object *o; Eina_Bool alpha_opaque = EINA_FALSE; int ex, ey, ew, eh; @@ -248,8 +245,7 @@ _e_policy_check_above_alpha_opaque(E_Client *ec) above_ec = evas_object_data_get(o, "E_Client"); if (!above_ec) continue; if (e_client_util_ignored_get(above_ec)) continue; - above_cdata = e_client_cdata_get(above_ec); - if (above_cdata && !above_cdata->mapped) continue; + if (above_ec->comp_data && !above_ec->comp_data->mapped) continue; e_client_geometry_get(above_ec, &ax, &ay, &aw, &ah); if (!E_CONTAINS(ax, ay, aw, ah, ex, ey, ew, eh)) continue; @@ -268,7 +264,7 @@ _e_policy_check_above_alpha_opaque(E_Client *ec) { if (!above_ec->iconic) { - if (above_cdata && above_cdata->mapped) + if (above_ec->comp_data && above_ec->comp_data->mapped) alpha_opaque = EINA_TRUE; } } @@ -292,7 +288,7 @@ _e_policy_client_iconify_by_visibility(E_Client *ec) if (ec->exp_iconify.skip_iconify) return; if (ec->exp_iconify.skip_by_remote) return; - E_Comp_Wl_Client_Data *cdata = e_client_cdata_get(ec); + E_Comp_Wl_Client_Data *cdata = (E_Comp_Wl_Client_Data *)ec->comp_data; if (cdata && !cdata->mapped) return; if (e_config->transient.iconify) @@ -450,7 +446,7 @@ _e_policy_client_uniconify_by_visibility(E_Client *ec) if (ec->exp_iconify.skip_iconify) return; if (ec->exp_iconify.skip_by_remote) return; - E_Comp_Wl_Client_Data *cdata = e_client_cdata_get(ec); + E_Comp_Wl_Client_Data *cdata = (E_Comp_Wl_Client_Data *)ec->comp_data; if (cdata && !cdata->mapped) return; _e_policy_client_ancestor_uniconify(ec); @@ -1314,7 +1310,6 @@ _e_vis_client_check_obscured_by_same_layer(E_Client *ec) { Eina_Bool obscured = EINA_FALSE; E_Client *above = NULL; - E_Comp_Wl_Client_Data *above_cdata = NULL; int ex, ey, ew, eh; int ax, ay, aw, ah; @@ -1327,8 +1322,7 @@ _e_vis_client_check_obscured_by_same_layer(E_Client *ec) if (e_object_is_del(E_OBJECT(above))) continue; if (above->iconic && above->exp_iconify.by_client) continue; if (above->bg_state) continue; - above_cdata = e_client_cdata_get(above); - if (above_cdata && !above_cdata->mapped) continue; + if (above->comp_data && !above->comp_data->mapped) continue; e_client_geometry_get(above, &ax, &ay, &aw, &ah); if (!E_CONTAINS(ax, ay, aw, ah, ex, ey, ew, eh)) continue; @@ -1362,7 +1356,6 @@ _e_vis_client_check_obscured_by_above_layers(E_Client *ec) { Eina_Bool obscured = EINA_FALSE; E_Client *above = NULL; - E_Comp_Wl_Client_Data *above_cdata = NULL; int ex, ey, ew, eh; int ax, ay, aw, ah; @@ -1375,8 +1368,7 @@ _e_vis_client_check_obscured_by_above_layers(E_Client *ec) if (e_object_is_del(E_OBJECT(above))) continue; if (above->iconic && above->exp_iconify.by_client) continue; if (above->bg_state) continue; - above_cdata = e_client_cdata_get(above); - if (above_cdata && !above_cdata->mapped) continue; + if (above->comp_data && !above->comp_data->mapped) continue; e_client_geometry_get(above, &ax, &ay, &aw, &ah); if (!E_CONTAINS(ax, ay, aw, ah, ex, ey, ew, eh)) continue; @@ -1455,7 +1447,6 @@ static Eina_Bool _e_vis_client_add_uniconify_render_pending(E_Vis_Client *vc, E_Vis_Job_Type type, Eina_Bool raise, Eina_Bool force_send) { E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; Eina_Bool send_vis_event = EINA_TRUE; ec = vc->ec; @@ -1466,8 +1457,7 @@ _e_vis_client_add_uniconify_render_pending(E_Vis_Client *vc, E_Vis_Job_Type type return EINA_FALSE; } - cdata = e_client_cdata_get(ec); - if (cdata && !cdata->mapped) + if (ec->comp_data && !ec->comp_data->mapped) { ELOGF("POL_VIS", "Not mapped. no need to uniconify render.", ec); return EINA_FALSE; @@ -1556,7 +1546,6 @@ _e_vis_ec_activity_check(E_Client *ec, Eina_Bool check_alpha, Eina_Bool check_fu int x, y, w, h; E_Comp_Object_Content_Type type = E_COMP_OBJECT_CONTENT_TYPE_NONE; int check_mapped = 1; - E_Comp_Wl_Client_Data *cdata = NULL; /* check if ignored */ if (e_client_util_ignored_get(ec)) return EINA_FALSE; @@ -1570,8 +1559,7 @@ _e_vis_ec_activity_check(E_Client *ec, Eina_Bool check_alpha, Eina_Bool check_fu (type == E_COMP_OBJECT_CONTENT_TYPE_EXT_EDJE)) check_mapped = 0; /* check unmapped client */ - cdata = e_client_cdata_get(ec); - if (check_mapped && cdata && !cdata->mapped) return EINA_FALSE; + if (check_mapped && ec->comp_data && !ec->comp_data->mapped) return EINA_FALSE; /* check iconify window by client */ if ((ec->iconic) && (ec->exp_iconify.by_client)) return EINA_FALSE; /* check background state */ @@ -1685,7 +1673,6 @@ static E_Pol_Vis_Type _e_vis_ec_above_visible_type(E_Client *ec, Eina_Bool check_child) { E_Client *above; - E_Comp_Wl_Client_Data *above_cdata = NULL; E_Pol_Vis_Type above_vis_type = E_POL_VIS_TYPE_ALPHA; int ex, ey, ew, eh; int ax, ay, aw, ah; @@ -1717,8 +1704,7 @@ _e_vis_ec_above_visible_type(E_Client *ec, Eina_Bool check_child) if (check_child && (above->parent == ec)) continue; if (above->first_mapped) { - above_cdata = e_client_cdata_get(above); - if (above_cdata && !above_cdata->mapped) + if (above->comp_data && !above->comp_data->mapped) continue; } @@ -1769,8 +1755,7 @@ _e_vis_client_check_obscure_below(E_Client *ec) if (e_object_is_del(E_OBJECT(ec))) return EINA_FALSE; if (ec->iconic && ec->exp_iconify.by_client) return EINA_FALSE; if (ec->bg_state) return EINA_FALSE; - E_Comp_Wl_Client_Data *cdata = e_client_cdata_get(ec); - if (cdata && !cdata->mapped) return EINA_FALSE; + if (ec->comp_data && !ec->comp_data->mapped) return EINA_FALSE; if ((ec->argb) && (ec->visibility.opaque <= 0)) return EINA_FALSE; if (ec->visibility.obscured != E_VISIBILITY_UNOBSCURED) return EINA_FALSE; if (!ec->visible) return EINA_FALSE; @@ -2348,14 +2333,12 @@ e_policy_visibility_client_raise(E_Client *ec) E_API Eina_Bool e_policy_visibility_client_lower(E_Client *ec) { - E_Comp_Wl_Client_Data *cdata = NULL; E_Pol_Vis_Type above_vis_type; Eina_Bool ret = EINA_TRUE; E_VIS_CLIENT_GET_OR_RETURN_VAL(vc, ec, EINA_FALSE); - cdata = e_client_cdata_get(ec); - if ((cdata) && (!cdata->mapped)) + if ((ec->comp_data) && (!ec->comp_data->mapped)) { VS_DBG(ec, "client Unmapped."); return EINA_FALSE; diff --git a/src/bin/e_policy_wl.c b/src/bin/e_policy_wl.c index 0649f9e714..b053b6ce99 100644 --- a/src/bin/e_policy_wl.c +++ b/src/bin/e_policy_wl.c @@ -807,8 +807,8 @@ _e_policy_wl_tzsh_extension_get(const char *name) static E_Policy_Wl_Surface * _e_policy_wl_surf_add(E_Client *ec, struct wl_resource *res_tzpol) { - E_Comp_Wl_Client_Data *cdata = NULL; E_Policy_Wl_Surface *psurf = NULL; + E_Policy_Wl_Tzpol *tzpol; tzpol = _e_policy_wl_tzpol_get(res_tzpol); @@ -825,9 +825,8 @@ _e_policy_wl_surf_add(E_Client *ec, struct wl_resource *res_tzpol) psurf->ec = ec; psurf->pid = ec->netwm.pid; - cdata = e_client_cdata_get(ec); - if (wl_resource_get_client(cdata->surface) == wl_resource_get_client(res_tzpol)) - psurf->surf = cdata->surface; + if (wl_resource_get_client(ec->comp_data->surface) == wl_resource_get_client(res_tzpol)) + psurf->surf = ec->comp_data->surface; tzpol->psurfs = eina_list_append(tzpol->psurfs, psurf); @@ -1023,7 +1022,6 @@ _tzpol_iface_cb_vis_get(struct wl_client *client, struct wl_resource *res_tzpol, void e_policy_wl_visibility_send(E_Client *ec, int vis) { - E_Comp_Wl_Client_Data *cdata = NULL; E_Policy_Wl_Tzpol *tzpol; E_Policy_Wl_Surface *psurf; struct wl_resource *res_tzvis; @@ -1083,8 +1081,7 @@ e_policy_wl_visibility_send(E_Client *ec, int vis) sent_vis = -3; } - cdata = e_client_cdata_get(ec); - if (cdata && cdata->mapped) + if (ec->comp_data && ec->comp_data->mapped) { _launch_effect_hide(ec->netwm.pid); } @@ -1096,7 +1093,7 @@ e_policy_wl_visibility_send(E_Client *ec, int vis) res_tzvis, ver, sent_vis, - ec->netwm.pid, cdata, ec->icccm.title, ec->netwm.name); + ec->netwm.pid, ec->comp_data, ec->icccm.title, ec->netwm.name); sent = EINA_TRUE; } } @@ -1361,7 +1358,6 @@ static void _tzpol_iface_cb_activate(struct wl_client *client EINA_UNUSED, struct wl_resource *res_tzpol EINA_UNUSED, struct wl_resource *surf) { E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; ec = wl_resource_get_user_data(surf); EINA_SAFETY_ON_NULL_RETURN(ec); @@ -1375,8 +1371,7 @@ _tzpol_iface_cb_activate(struct wl_client *client EINA_UNUSED, struct wl_resourc e_policy_hook_call(E_POLICY_HOOK_CLIENT_ACTIVE_REQ, ec); ec->post_lower = EINA_FALSE; - cdata = e_client_cdata_get(ec); - if (cdata && !cdata->mapped) + if (ec->comp_data && !ec->comp_data->mapped) ec->post_raise = EINA_TRUE; e_policy_wl_activate(ec); } @@ -1431,7 +1426,6 @@ _tzpol_iface_cb_activate_below_by_res_id(struct wl_client *client EINA_UNUSED, s E_Client *below_ec = NULL; E_Client *parent_ec = NULL; E_Client *focus_ec = NULL; - E_Comp_Wl_Client_Data *cdata = NULL; Eina_Bool check_ancestor = EINA_FALSE; Eina_Bool intercepted = EINA_FALSE; @@ -1479,8 +1473,7 @@ _tzpol_iface_cb_activate_below_by_res_id(struct wl_client *client EINA_UNUSED, s e_policy_stack_below(ec, below_ec); - cdata = e_client_cdata_get(ec); - if (cdata && !cdata->mapped) + if ((ec->comp_data) && (!ec->comp_data->mapped)) { ELOGF("TZPOL", "POST_RAISE_LOWER SET... raise:%d, lower:%d", ec, EINA_FALSE, EINA_FALSE); e_client_post_raise_lower_set(ec, EINA_FALSE, EINA_FALSE); @@ -1498,7 +1491,6 @@ static void _tzpol_iface_cb_activate_above_by_res_id(struct wl_client *client EINA_UNUSED, struct wl_resource *res_tzpol, uint32_t res_id, uint32_t above_res_id) { E_Client *ec = NULL; - E_Comp_Wl_Client_Data *cdata = NULL; E_Client *above_ec = NULL; E_Client *parent_ec = NULL; Eina_Bool check_ancestor = EINA_FALSE; @@ -1549,8 +1541,7 @@ _tzpol_iface_cb_activate_above_by_res_id(struct wl_client *client EINA_UNUSED, s e_policy_stack_above(ec, above_ec); - cdata = e_client_cdata_get(ec); - if (cdata && !cdata->mapped) + if ((ec->comp_data) && (!ec->comp_data->mapped)) { ELOGF("TZPOL", "POST_RAISE_LOWER SET... raise:%d, lower:%d", ec, EINA_FALSE, EINA_FALSE); e_client_post_raise_lower_set(ec, EINA_FALSE, EINA_FALSE); @@ -1561,7 +1552,6 @@ static void _tzpol_iface_cb_raise(struct wl_client *client EINA_UNUSED, struct wl_resource *res_tzpol EINA_UNUSED, struct wl_resource *surf) { E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; ec = wl_resource_get_user_data(surf); EINA_SAFETY_ON_NULL_RETURN(ec); @@ -1576,8 +1566,7 @@ _tzpol_iface_cb_raise(struct wl_client *client EINA_UNUSED, struct wl_resource * e_client_raise(ec); - cdata = e_client_cdata_get(ec); - if (cdata && !cdata->mapped) + if ((ec->comp_data) && (!ec->comp_data->mapped)) { ELOGF("TZPOL", "POST_RAISE_LOWER SET... raise:%d, lower:%d", ec, EINA_TRUE, EINA_FALSE); e_client_post_raise_lower_set(ec, EINA_TRUE, EINA_FALSE); @@ -1590,7 +1579,6 @@ static void _tzpol_iface_cb_lower(struct wl_client *client EINA_UNUSED, struct wl_resource *res_tzpol EINA_UNUSED, struct wl_resource *surf) { E_Client *ec = NULL; - E_Comp_Wl_Client_Data *cdata = NULL; ec = wl_resource_get_user_data(surf); EINA_SAFETY_ON_NULL_RETURN(ec); @@ -1606,8 +1594,7 @@ _tzpol_iface_cb_lower(struct wl_client *client EINA_UNUSED, struct wl_resource * if (e_policy_visibility_client_lower(ec)) return; - cdata = e_client_cdata_get(ec); - if (cdata && !cdata->mapped) + if ((ec->comp_data) && (!ec->comp_data->mapped)) { ELOGF("TZPOL", "POST_RAISE_LOWER SET... raise:%d, lower:%d", ec, EINA_FALSE, EINA_TRUE); e_client_post_raise_lower_set(ec, EINA_FALSE, EINA_TRUE); @@ -1623,7 +1610,6 @@ static void _tzpol_iface_cb_lower_by_res_id(struct wl_client *client EINA_UNUSED, struct wl_resource *res_tzpol, uint32_t res_id) { E_Client *ec = NULL; - E_Comp_Wl_Client_Data *cdata = NULL; ec = e_pixmap_find_client_by_res_id(res_id); EINA_SAFETY_ON_NULL_RETURN(ec); @@ -1636,8 +1622,7 @@ _tzpol_iface_cb_lower_by_res_id(struct wl_client *client EINA_UNUSED, struct wl_ e_client_lower(ec); - cdata = e_client_cdata_get(ec); - if (cdata && !cdata->mapped) + if ((ec->comp_data) && (!ec->comp_data->mapped)) { ELOGF("TZPOL", "POST_RAISE_LOWER SET... raise:%d, lower:%d", ec, EINA_FALSE, EINA_TRUE); e_client_post_raise_lower_set(ec, EINA_FALSE, EINA_TRUE); @@ -1676,7 +1661,6 @@ static void _tzpol_iface_cb_role_set(struct wl_client *client EINA_UNUSED, struct wl_resource *res_tzpol EINA_UNUSED, struct wl_resource *surf, const char *role) { E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; EINA_SAFETY_ON_NULL_RETURN(role); @@ -1700,9 +1684,8 @@ _tzpol_iface_cb_role_set(struct wl_client *client EINA_UNUSED, struct wl_resourc } else if (!e_util_strcmp("cbhm", role)) { - cdata = e_client_cdata_get(ec); - if (!cdata) return; - e_comp_wl->selection.cbhm = cdata->surface; + if (!ec->comp_data) return; + e_comp_wl->selection.cbhm = ec->comp_data->surface; } else if (!e_util_strcmp("wl_pointer-cursor", role)) { @@ -1950,7 +1933,6 @@ static void _tzpol_iface_cb_transient_for_set(struct wl_client *client EINA_UNUSED, struct wl_resource *res_tzpol, uint32_t child_id, uint32_t parent_id) { E_Client *ec, *pc; - E_Comp_Wl_Client_Data *cdata = NULL, *pc_cdata = NULL; struct wl_resource *parent_surf; ELOGF("TZPOL", @@ -1959,14 +1941,12 @@ _tzpol_iface_cb_transient_for_set(struct wl_client *client EINA_UNUSED, struct w ec = e_pixmap_find_client_by_res_id(child_id); EINA_SAFETY_ON_NULL_RETURN(ec); - cdata = e_client_cdata_get(ec); pc = e_pixmap_find_client_by_res_id(parent_id); EINA_SAFETY_ON_NULL_RETURN(pc); - pc_cdata = e_client_cdata_get(pc); - EINA_SAFETY_ON_NULL_RETURN(pc_cdata); + EINA_SAFETY_ON_NULL_RETURN(pc->comp_data); - parent_surf = pc_cdata->surface; + parent_surf = pc->comp_data->surface; _e_policy_wl_parent_surf_set(ec, parent_surf); @@ -1980,7 +1960,7 @@ _tzpol_iface_cb_transient_for_set(struct wl_client *client EINA_UNUSED, struct w " |win:0x%08zx|child |s:%8p", ec, e_client_util_win_get(ec), - (cdata ? cdata->surface : NULL)); + (ec->comp_data ? ec->comp_data->surface : NULL)); tizen_policy_send_transient_for_done(res_tzpol, child_id); @@ -2060,30 +2040,26 @@ _tzpol_iface_cb_subsurf_place_below_parent(struct wl_client *client EINA_UNUSED, { E_Client *ec; E_Client *epc; - E_Comp_Wl_Client_Data *cdata = NULL, *epc_cdata = NULL;; E_Comp_Wl_Subsurf_Data *sdata; ec = wl_resource_get_user_data(subsurf); EINA_SAFETY_ON_NULL_RETURN(ec); - cdata = e_client_cdata_get(ec); - EINA_SAFETY_ON_NULL_RETURN(cdata); + EINA_SAFETY_ON_NULL_RETURN(ec->comp_data); - sdata = cdata->sub.data; + sdata = ec->comp_data->sub.data; EINA_SAFETY_ON_NULL_RETURN(sdata); epc = sdata->parent; EINA_SAFETY_ON_NULL_RETURN(epc); - epc_cdata = e_client_cdata_get(epc); - EINA_SAFETY_ON_NULL_RETURN(epc_cdata); /* check if a subsurface has already placed below a parent */ - if (eina_list_data_find(epc_cdata->sub.below_list, ec)) return; + if (eina_list_data_find(epc->comp_data->sub.below_list, ec)) return; ELOGF("TZPOL", "SUBSURF|BELOW_PARENT", ec); - epc_cdata->sub.list = eina_list_remove(epc_cdata->sub.list, ec); - epc_cdata->sub.list_pending = eina_list_remove(epc_cdata->sub.list_pending, ec); - epc_cdata->sub.below_list = eina_list_append(epc_cdata->sub.below_list, ec); - epc_cdata->sub.list_changed = EINA_TRUE; + epc->comp_data->sub.list = eina_list_remove(epc->comp_data->sub.list, ec); + epc->comp_data->sub.list_pending = eina_list_remove(epc->comp_data->sub.list_pending, ec); + epc->comp_data->sub.below_list = eina_list_append(epc->comp_data->sub.below_list, ec); + epc->comp_data->sub.list_changed = EINA_TRUE; /* NOTE * The stacking order of sub-surface should be actually updated when state @@ -2100,15 +2076,13 @@ static void _tzpol_iface_cb_subsurf_stand_alone_set(struct wl_client *client EINA_UNUSED, struct wl_resource *res_tzpol EINA_UNUSED, struct wl_resource *subsurf) { E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; E_Comp_Wl_Subsurf_Data *sdata; ec = wl_resource_get_user_data(subsurf); EINA_SAFETY_ON_NULL_RETURN(ec); - cdata = e_client_cdata_get(ec); - EINA_SAFETY_ON_NULL_RETURN(cdata); + EINA_SAFETY_ON_NULL_RETURN(ec->comp_data); - sdata = cdata->sub.data; + sdata = ec->comp_data->sub.data; EINA_SAFETY_ON_NULL_RETURN(sdata); ELOGF("TZPOL", "SUBSURF|STAND_ALONE", ec); @@ -2119,7 +2093,6 @@ static void _tzpol_iface_cb_subsurface_get(struct wl_client *client, struct wl_resource *resource, uint32_t id, struct wl_resource *surface, uint32_t parent_id) { E_Client *ec, *epc; - E_Comp_Wl_Client_Data *cdata = NULL; ELOGF("TZPOL", "SUBSURF |wl_surface@%d|parent_id:%d", @@ -2136,9 +2109,8 @@ _tzpol_iface_cb_subsurface_get(struct wl_client *client, struct wl_resource *res if (e_object_is_del(E_OBJECT(ec))) return; - cdata = e_client_cdata_get(ec); /* check if this surface is already a sub-surface */ - if (cdata && cdata->sub.data) + if ((ec->comp_data) && (ec->comp_data->sub.data)) { wl_resource_post_error(resource, WL_SUBCOMPOSITOR_ERROR_BAD_SURFACE, @@ -2157,8 +2129,8 @@ _tzpol_iface_cb_subsurface_get(struct wl_client *client, struct wl_resource *res } /* ec's parent comes from another process */ - if (cdata) - cdata->has_extern_parent = EINA_TRUE; + if (ec->comp_data) + ec->comp_data->has_extern_parent = EINA_TRUE; } static void @@ -2269,15 +2241,13 @@ _e_policy_wl_allowed_aux_hint_send(struct wl_resource *res_tzpol, struct wl_reso static void _e_policy_wl_aux_hint_apply(E_Client *ec) { - E_Comp_Wl_Client_Data *cdata = NULL; E_Comp_Wl_Aux_Hint *hint; Eina_List *l; - cdata = e_client_cdata_get(ec); - if (!cdata) return; - if (!cdata->aux_hint.changed) return; + if (!ec->comp_data) return; + if (!ec->comp_data->aux_hint.changed) return; - EINA_LIST_FOREACH(cdata->aux_hint.hints, l, hint) + EINA_LIST_FOREACH(ec->comp_data->aux_hint.hints, l, hint) { if (!hint->changed) continue; EC_CHANGED(ec); @@ -2399,16 +2369,16 @@ _e_policy_wl_aux_hint_apply(E_Client *ec) else if (!strcmp(hint->hint, hint_names[E_POLICY_HINT_MSG_USE])) { if ((hint->deleted) || (!strcmp(hint->val, "0"))) - cdata->aux_hint.use_msg = EINA_FALSE; + ec->comp_data->aux_hint.use_msg = EINA_FALSE; else if (!strcmp(hint->val, "1")) - cdata->aux_hint.use_msg = EINA_TRUE; + ec->comp_data->aux_hint.use_msg = EINA_TRUE; } else if (!strcmp(hint->hint, hint_names[E_COMP_HINT_ALWAYS_SELECTIVE])) { if ((hint->deleted) || (!strcmp(hint->val, "0"))) - cdata->never_hwc = EINA_FALSE; + ec->comp_data->never_hwc = EINA_FALSE; else if (!strcmp(hint->val, "1")) - cdata->never_hwc = EINA_TRUE; + ec->comp_data->never_hwc = EINA_TRUE; e_comp_render_queue(); } @@ -2864,7 +2834,6 @@ _e_policy_wl_dpy_surf_add(E_Client *ec, struct wl_resource *res_tz_dpy_pol) { E_Policy_Wl_Tz_Dpy_Pol *tz_dpy_pol = NULL; E_Policy_Wl_Dpy_Surface *dpy_surf = NULL; - E_Comp_Wl_Client_Data *cdata = NULL; tz_dpy_pol = _e_policy_wl_tz_dpy_pol_get(res_tz_dpy_pol); EINA_SAFETY_ON_NULL_RETURN_VAL(tz_dpy_pol, NULL); @@ -2876,9 +2845,7 @@ _e_policy_wl_dpy_surf_add(E_Client *ec, struct wl_resource *res_tz_dpy_pol) dpy_surf = E_NEW(E_Policy_Wl_Dpy_Surface, 1); EINA_SAFETY_ON_NULL_RETURN_VAL(dpy_surf, NULL); - cdata = e_client_cdata_get(ec); - EINA_SAFETY_ON_NULL_RETURN_VAL(cdata, NULL); - dpy_surf->surf = cdata->surface; + dpy_surf->surf = ec->comp_data->surface; dpy_surf->tz_dpy_pol = tz_dpy_pol; dpy_surf->ec = ec; dpy_surf->brightness = -1; @@ -3111,14 +3078,11 @@ static void _tzpol_iface_cb_subsurf_watcher_destroy(struct wl_resource *resource) { E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; if (!(ec = wl_resource_get_user_data(resource))) return; - if (e_object_is_del(E_OBJECT(ec))) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; + if (e_object_is_del(E_OBJECT(ec)) || !ec->comp_data) return; - cdata->sub.watcher = NULL; + ec->comp_data->sub.watcher = NULL; } static void @@ -3136,13 +3100,10 @@ static void _tzpol_iface_cb_subsurf_watcher_get(struct wl_client *client, struct wl_resource *res_tzpol, uint32_t id, struct wl_resource *surface) { E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; struct wl_resource *res; if (!(ec = wl_resource_get_user_data(surface))) return; if (e_object_is_del(E_OBJECT(ec))) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; if (!(res = wl_resource_create(client, &tizen_subsurface_watcher_interface, 1, id))) { @@ -3150,7 +3111,7 @@ _tzpol_iface_cb_subsurf_watcher_get(struct wl_client *client, struct wl_resource return; } - cdata->sub.watcher = res; + ec->comp_data->sub.watcher = res; wl_resource_set_implementation(res, &_tzpol_subsurf_watcher_iface, @@ -3162,7 +3123,6 @@ static void _tzpol_iface_cb_parent_set(struct wl_client *client, struct wl_resource *res_tzpol, struct wl_resource *child, struct wl_resource *parent) { E_Client *ec, *pc; - E_Comp_Wl_Client_Data *cdata = NULL, *pc_cdata = NULL; struct wl_resource *parent_surf; ELOGF("TZPOL", @@ -3179,10 +3139,9 @@ _tzpol_iface_cb_parent_set(struct wl_client *client, struct wl_resource *res_tzp } else { - pc_cdata = e_client_cdata_get(pc); - EINA_SAFETY_ON_NULL_RETURN(pc_cdata); + EINA_SAFETY_ON_NULL_RETURN(pc->comp_data); - parent_surf = pc_cdata->surface; + parent_surf = pc->comp_data->surface; _e_policy_wl_parent_surf_set(ec, parent_surf); ELOGF("TZPOL", @@ -3191,12 +3150,11 @@ _tzpol_iface_cb_parent_set(struct wl_client *client, struct wl_resource *res_tzp e_client_util_win_get(pc), parent_surf); - cdata = e_client_cdata_get(ec); ELOGF("TZPOL", " |win:0x%08zx|child |s:%8p", ec, e_client_util_win_get(ec), - (cdata ? cdata->surface : NULL)); + (ec->comp_data ? ec->comp_data->surface : NULL)); } EC_CHANGED(ec); @@ -3222,17 +3180,14 @@ static void _tzpol_iface_cb_has_video(struct wl_client *client, struct wl_resource *res_tzpol, struct wl_resource *surface, uint32_t has) { E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; if (!(ec = wl_resource_get_user_data(surface))) return; if (e_object_is_del(E_OBJECT(ec))) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; - if (cdata->has_video_client == has) return; + if (ec->comp_data->has_video_client == has) return; ELOGF("TZPOL", "video client has(%d)", ec, has); - cdata->has_video_client = has; + ec->comp_data->has_video_client = has; } static void @@ -4452,7 +4407,7 @@ _e_tzsh_indicator_find_topvisible_client(E_Zone *zone) continue; /* if ec is subsurface, skip this */ - cdata = e_client_cdata_get(ec); + cdata = (E_Comp_Wl_Client_Data *)ec->comp_data; if (cdata && cdata->sub.data) continue; e_client_geometry_get(ec, &ex, &ey, &ew, &eh); @@ -7183,16 +7138,14 @@ err: void e_policy_wl_indicator_flick_send(E_Client *ec) { - E_Comp_Wl_Client_Data *cdata = NULL; E_Policy_Wl_Tz_Indicator *tz_indicator; struct wl_resource *surf; tz_indicator = _e_policy_wl_tz_indicator_get_from_client(ec); EINA_SAFETY_ON_NULL_RETURN(tz_indicator); - cdata = e_client_cdata_get(ec); - if (cdata) - surf = cdata->surface; + if (ec->comp_data) + surf = ec->comp_data->surface; else surf = NULL; @@ -7321,7 +7274,6 @@ _tz_clipboard_cb_data_only_set(struct wl_client *client, struct wl_resource *res Eina_Bool res; Eina_List *clients; E_Client *ec, *found = NULL; - E_Comp_Wl_Client_Data *cdata = NULL; tz_clipboard = wl_resource_get_user_data(res_tz_clipboard); EINA_SAFETY_ON_NULL_RETURN(tz_clipboard); @@ -7350,10 +7302,9 @@ _tz_clipboard_cb_data_only_set(struct wl_client *client, struct wl_resource *res EINA_LIST_FREE(clients, ec) { if (found) continue; - cdata = e_client_cdata_get(ec); - if (cdata && cdata->surface) + if (ec->comp_data && ec->comp_data->surface) { - _wc = wl_resource_get_client(cdata->surface); + _wc = wl_resource_get_client(ec->comp_data->surface); if (_wc == client) found = ec; } @@ -7442,7 +7393,6 @@ err: EINTERN void e_policy_wl_clipboard_data_selected_send(E_Client *ec) { - E_Comp_Wl_Client_Data *cdata = NULL; E_Policy_Wl_Tz_Clipboard *tz_clipboard; EINA_SAFETY_ON_NULL_RETURN(ec); @@ -7450,16 +7400,13 @@ e_policy_wl_clipboard_data_selected_send(E_Client *ec) tz_clipboard = _e_policy_wl_tz_clipboard_get_from_client(ec); EINA_SAFETY_ON_NULL_RETURN(tz_clipboard); - cdata = e_client_cdata_get(ec); tizen_clipboard_send_data_selected(tz_clipboard->res_tz_clipboard, - cdata ? cdata->surface : NULL); + ec->comp_data? ec->comp_data->surface : NULL); } static void _e_policy_wl_cb_hook_shell_surface_ready(void *d, E_Client *ec) { - E_Comp_Wl_Client_Data *cdata = NULL; - if (EINA_UNLIKELY(!ec)) return; @@ -7467,9 +7414,8 @@ _e_policy_wl_cb_hook_shell_surface_ready(void *d, E_Client *ec) e_client_base_output_resolution_transform_adjust(ec); - cdata = e_client_cdata_get(ec); - if ((cdata->shell.configure_send) && - (cdata->shell.surface)) + if ((ec->comp_data->shell.configure_send) && + (ec->comp_data->shell.surface)) { int w = 0, h = 0; if (ec->lock_client_size) @@ -7477,7 +7423,8 @@ _e_policy_wl_cb_hook_shell_surface_ready(void *d, E_Client *ec) w = ec->w; h = ec->h; } - cdata->shell.configure_send(cdata->shell.surface, 0, w, h); + ec->comp_data->shell.configure_send(ec->comp_data->shell.surface, + 0, w, h); } } @@ -7536,7 +7483,6 @@ e_policy_wl_aux_message_send(E_Client *ec, const char *val, Eina_List *options) { - E_Comp_Wl_Client_Data *cdata = NULL; E_Policy_Wl_Tzpol *tzpol; E_Policy_Wl_Surface *psurf; Eina_List *l; @@ -7546,10 +7492,10 @@ e_policy_wl_aux_message_send(E_Client *ec, int len; char *p; + if (!ec->comp_data) return; + if (!ec->comp_data->aux_hint.use_msg) return; + if (e_object_is_del(E_OBJECT(ec))) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; - if (!cdata->aux_hint.use_msg) return; wl_array_init(&opt_array); EINA_LIST_FOREACH(options, l, option) diff --git a/src/bin/e_presentation_time.c b/src/bin/e_presentation_time.c index 4a889d99b3..7da3b58869 100644 --- a/src/bin/e_presentation_time.c +++ b/src/bin/e_presentation_time.c @@ -173,14 +173,11 @@ _presentation_feedback(struct wl_client *client, uint32_t callback) { E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; E_Presentation_Time_Feedback *feedback; ec = wl_resource_get_user_data(surface_resource); if (!ec) return; if (e_object_is_del(E_OBJECT(ec))) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; feedback = E_NEW(E_Presentation_Time_Feedback, 1); if (!feedback) @@ -204,7 +201,7 @@ _presentation_feedback(struct wl_client *client, PRSTT_TRACE("feedback:%p Create", NULL, feedback); - e_presentation_time_container_feedback_set(&cdata->pending.presentation_container, + e_presentation_time_container_feedback_set(&ec->comp_data->pending.presentation_container, feedback); } diff --git a/src/bin/e_process.c b/src/bin/e_process.c index 7decb033f5..057d364c93 100644 --- a/src/bin/e_process.c +++ b/src/bin/e_process.c @@ -427,7 +427,6 @@ _e_process_freeze_condition_check(pid_t pid) { E_Process *pinfo = NULL; E_Client *ec = NULL; - E_Comp_Wl_Client_Data *cdata = NULL; Eina_Bool freeze = EINA_TRUE; Eina_List *l; @@ -441,10 +440,9 @@ _e_process_freeze_condition_check(pid_t pid) EINA_LIST_FOREACH(pinfo->ec_list, l, ec) { - cdata = e_client_cdata_get(ec); - if (cdata && - cdata->sub.data && - cdata->sub.data->parent) + if (ec->comp_data && + ec->comp_data->sub.data && + ec->comp_data->sub.data->parent) continue; if (ec->visible && !ec->iconic) diff --git a/src/bin/e_slot.c b/src/bin/e_slot.c index bdfb1da5f1..8d0d5de5a2 100644 --- a/src/bin/e_slot.c +++ b/src/bin/e_slot.c @@ -458,7 +458,7 @@ e_slot_update(Evas_Object *obj) { if (e_object_is_del(E_OBJECT(ec))) continue; if (e_client_util_ignored_get(ec)) continue; - if (!e_client_cdata_get(ec)) continue; + if (!ec->comp_data) continue; slot_client = eina_hash_find(_e_slot_g->hash_slot_clients, &ec); if (!slot_client) continue; @@ -631,7 +631,7 @@ e_slot_client_update(E_Client *ec) { if (e_object_is_del(E_OBJECT(slot_client->ec))) return; if (e_client_util_ignored_get(slot_client->ec)) return; - if (!e_client_cdata_get(slot_client->ec)) return; + if (!slot_client->ec->comp_data) return; e_client_geometry_get(slot_client->ec, &x, &y, &w, &h); diff --git a/src/bin/e_xdg_shell_v6.c b/src/bin/e_xdg_shell_v6.c index cc97f14024..6cb31e889c 100644 --- a/src/bin/e_xdg_shell_v6.c +++ b/src/bin/e_xdg_shell_v6.c @@ -144,13 +144,10 @@ static Eina_Rectangle _e_xdg_positioner_geometry_get(E_Xdg_Positioner *p); static Eina_Bool _e_client_shsurface_assignable_check(E_Client *ec) { - E_Comp_Wl_Client_Data *cdata = NULL; - if (!e_shell_e_client_shell_assignable_check(ec)) { ERR("Could not assign shell", ec); - cdata = e_client_cdata_get(ec); - wl_resource_post_error(cdata->surface, + wl_resource_post_error(ec->comp_data->surface, WL_DISPLAY_ERROR_INVALID_OBJECT, "Could not assign shell surface to wl_surface"); return EINA_FALSE; @@ -162,8 +159,7 @@ _e_client_shsurface_assignable_check(E_Client *ec) static Eina_Bool _e_client_xdg_shell_v6_assigned_check(E_Client *ec) { - E_Comp_Wl_Client_Data *cdata = e_client_cdata_get(ec); - return !!cdata->sh_v6.res_role; + return !!ec->comp_data->sh_v6.res_role; } static void @@ -171,27 +167,17 @@ _e_client_xdg_shell_v6_assign(E_Client *ec, struct wl_resource *resource, E_Comp_Wl_Sh_Surf_Role role) { - E_Comp_Wl_Client_Data *cdata = NULL; - - if (!ec) return; - if (e_object_is_del(E_OBJECT(ec))) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; - - cdata->sh_v6.res_role = resource; - cdata->sh_v6.role = role; + if ((!ec) || (!ec->comp_data) || (e_object_is_del(E_OBJECT(ec)))) + return; + ec->comp_data->sh_v6.res_role = resource; + ec->comp_data->sh_v6.role = role; } static void _e_client_xdg_shell_v6_role_assingment_unset(E_Client *ec) { - E_Comp_Wl_Client_Data *cdata = NULL; - - if (!ec) return; - if (e_object_is_del(E_OBJECT(ec))) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; - + if ((!ec) || (!ec->comp_data) || (e_object_is_del(E_OBJECT(ec)))) + return; _e_client_xdg_shell_v6_assign(ec, NULL, E_COMP_WL_SH_SURF_ROLE_NONE); } @@ -218,14 +204,9 @@ _e_xdg_popup_positioner_apply(E_Xdg_Popup *popup, E_Xdg_Positioner *pos) static void _e_xdg_popup_parent_set(E_Xdg_Popup *popup, E_Xdg_Surface *parent) { - E_Comp_Wl_Client_Data *parent_cdata = NULL; - - parent_cdata = e_client_cdata_get(parent->ec); - if (!parent_cdata) return; - popup->parent = parent; /* set this client as a transient for parent */ - e_shell_e_client_parent_set(popup->base.ec, parent_cdata->surface); + e_shell_e_client_parent_set(popup->base.ec, parent->ec->comp_data->surface); } static void @@ -316,7 +297,6 @@ static void _e_xdg_toplevel_committed(E_Xdg_Toplevel *toplevel) { E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; int pw, ph; ec = toplevel->base.ec; @@ -326,10 +306,9 @@ _e_xdg_toplevel_committed(E_Xdg_Toplevel *toplevel) return; } - cdata = e_client_cdata_get(ec); - if (!cdata) + if (!ec->comp_data) { - ERR("E_Client must have E_Comp_Wl_Client_Data", ec); + ERR("E_Client must have E_Comp_Client_Data", ec); return; } @@ -348,8 +327,8 @@ _e_xdg_toplevel_committed(E_Xdg_Toplevel *toplevel) e_pixmap_size_get(ec->pixmap, &pw, &ph); if ((toplevel->next.state.maximized || toplevel->next.state.fullscreen) && - (toplevel->next.size.w != cdata->shell.window.w || - toplevel->next.size.h != cdata->shell.window.h || + (toplevel->next.size.w != ec->comp_data->shell.window.w || + toplevel->next.size.h != ec->comp_data->shell.window.h || toplevel->next.size.w != pw || toplevel->next.size.h != ph)) { @@ -359,7 +338,7 @@ _e_xdg_toplevel_committed(E_Xdg_Toplevel *toplevel) toplevel->next.state.maximized, toplevel->next.state.fullscreen, toplevel->next.size.w, toplevel->next.size.h, - cdata->shell.window.w, cdata->shell.window.h, + ec->comp_data->shell.window.w, ec->comp_data->shell.window.h, pw, ph); /* TODO Disable this part for now, but need to consider enabling it later. * To enable this part, we first need to ensure that do not send configure @@ -591,7 +570,6 @@ _e_xdg_toplevel_cb_parent_set(struct wl_client *client, { E_Xdg_Toplevel *toplevel, *parent; E_Client *pc; - E_Comp_Wl_Client_Data *pc_cdata = NULL; struct wl_resource *parent_wsurface = NULL; toplevel = wl_resource_get_user_data(resource); @@ -621,9 +599,9 @@ _e_xdg_toplevel_cb_parent_set(struct wl_client *client, return; } - pc_cdata = e_client_cdata_get(pc); - if (!pc_cdata) return; - parent_wsurface = pc_cdata->surface; + if (!pc->comp_data) return; + + parent_wsurface = pc->comp_data->surface; } /* set this client as a transient for parent */ @@ -1129,7 +1107,7 @@ _e_xdg_surface_cb_configure_send(void *data) EINA_SAFETY_ON_NULL_GOTO(exsurf, end); EINA_SAFETY_ON_NULL_GOTO(exsurf->ec, end); - EINA_SAFETY_ON_NULL_GOTO(e_client_cdata_get(exsurf->ec), end); + EINA_SAFETY_ON_NULL_GOTO(exsurf->ec->comp_data, end); EINA_SAFETY_ON_NULL_GOTO(exsurf->resource, end); if (e_object_is_del(E_OBJECT(exsurf->ec))) @@ -1610,7 +1588,6 @@ _e_xdg_surface_cb_commit(void *data, int type, void *event) { E_Xdg_Surface *exsurf; E_Event_Client *ev; - E_Comp_Wl_Client_Data *exsurf_cdata; exsurf = (E_Xdg_Surface *)data; ev = (E_Event_Client *)event; @@ -1630,8 +1607,7 @@ _e_xdg_surface_cb_commit(void *data, int type, void *event) if (exsurf->has_window_geometry) { exsurf->has_window_geometry = EINA_FALSE; - exsurf_cdata = e_client_cdata_get(exsurf->ec); - EINA_RECTANGLE_SET(&exsurf_cdata->shell.window, + EINA_RECTANGLE_SET(&exsurf->ec->comp_data->shell.window, exsurf->window_geometry.x, exsurf->window_geometry.y, exsurf->window_geometry.w, diff --git a/src/bin/services/e_service_cbhm.c b/src/bin/services/e_service_cbhm.c index e84ebb5c8c..13ebc39f78 100644 --- a/src/bin/services/e_service_cbhm.c +++ b/src/bin/services/e_service_cbhm.c @@ -35,7 +35,6 @@ _cbhm_cb_evas_show(void *d, Evas *evas EINA_UNUSED, Evas_Object *obj, void *even { E_Policy_Cbhm *cbhm; E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; cbhm = d; if (EINA_UNLIKELY(!cbhm)) @@ -48,8 +47,8 @@ _cbhm_cb_evas_show(void *d, Evas *evas EINA_UNUSED, Evas_Object *obj, void *even if (ec->frame != obj) return; - cdata = e_client_cdata_get(ec); - if ((!cbhm->show_block) && (cdata->mapped)) + if ((!cbhm->show_block) && + (ec->comp_data->mapped)) cbhm->show_block = EINA_TRUE; } @@ -172,7 +171,6 @@ EINTERN void e_service_cbhm_client_set(E_Client *ec) { E_Policy_Cbhm *cbhm; - E_Comp_Wl_Client_Data *cdata = NULL; if (EINA_UNLIKELY(!ec)) { @@ -209,8 +207,7 @@ e_service_cbhm_client_set(E_Client *ec) // set skip iconify ec->exp_iconify.skip_iconify = 1; - cdata = e_client_cdata_get(ec); - e_comp_wl->selection.cbhm = cdata->surface; + e_comp_wl->selection.cbhm = ec->comp_data->surface; e_client_window_role_set(ec, "cbhm"); e_policy_conformant_part_add(ec); diff --git a/src/bin/services/e_service_launcher.c b/src/bin/services/e_service_launcher.c index 4c64a84121..b0d13fde29 100644 --- a/src/bin/services/e_service_launcher.c +++ b/src/bin/services/e_service_launcher.c @@ -1231,18 +1231,17 @@ _launcher_cb_launching(struct wl_client *client EINA_UNUSED, static void _launcher_target_ec_queue_flush(E_Service_Launcher *lc) { - E_Comp_Wl_Client_Data *target_cdata = NULL; struct wayland_tbm_client_queue *cqueue; if (!e_comp_wl) return; if (!lc) return; if (!lc->target.ec) return; - target_cdata = e_client_cdata_get(lc->target.ec); - if (!target_cdata) return; - if (!target_cdata->wl_surface) return; + if (!lc->target.ec->comp_data) return; + if (!lc->target.ec->comp_data->wl_surface) return; if (e_object_is_del(E_OBJECT(lc->target.ec))) return; - cqueue = wayland_tbm_server_client_queue_get(e_comp_wl->tbm.server, target_cdata->wl_surface); + cqueue = wayland_tbm_server_client_queue_get(e_comp_wl->tbm.server, + lc->target.ec->comp_data->wl_surface); if (cqueue) wayland_tbm_server_client_queue_flush(cqueue); } @@ -1327,8 +1326,7 @@ _launcher_cb_launch_done(struct wl_client *client EINA_UNUSED, if (target_ec->first_mapped) { - E_Comp_Wl_Client_Data *target_cdata = e_client_cdata_get(target_ec); - ELOGF("LAUNCH", "SHOW real win (target->frame:%p, map:%d) by launcher service (win:0x%08zx, ec:%p).", target_ec, target_ec->frame, target_cdata->mapped, e_client_util_win_get(lc->ec), lc->ec); + ELOGF("LAUNCH", "SHOW real win (target->frame:%p, map:%d) by launcher service (win:0x%08zx, ec:%p).", target_ec, target_ec->frame, target_ec->comp_data->mapped, e_client_util_win_get(lc->ec), lc->ec); e_comp_object_signal_emit(target_ec->frame, "e,action,launch_real,done", "e"); } e_comp_object_signal_emit(target_ec->frame, "e,action,launch,done", "e"); @@ -1385,7 +1383,6 @@ static E_Client * _launcher_handler_rsm_provider_client_find(E_Client *rsm_consumer_ec) { E_Client *prov_ec = NULL; - E_Comp_Wl_Client_Data *prov_cdata = NULL; Eina_List *tzrs_provs, *l; E_Service_Launcher *lc; @@ -1400,8 +1397,7 @@ _launcher_handler_rsm_provider_client_find(E_Client *rsm_consumer_ec) if (!prov_ec->remote_surface.provider) continue; if (prov_ec->visible) continue; if (evas_object_visible_get(prov_ec->frame)) continue; - prov_cdata = e_client_cdata_get(prov_ec); - if (prov_cdata->mapped) continue; + if (prov_ec->comp_data->mapped) continue; if (!(lc = _launcher_handler_launcher_find(prov_ec))) continue; if (!lc->launched_ec) continue; diff --git a/src/bin/services/e_service_volume.c b/src/bin/services/e_service_volume.c index 53f3b3b508..1dc8c11f9e 100644 --- a/src/bin/services/e_service_volume.c +++ b/src/bin/services/e_service_volume.c @@ -52,11 +52,10 @@ _volume_region_obj_cb_mouse_down(void *data EINA_UNUSED, Evas *evas EINA_UNUSED, { Evas_Event_Mouse_Down *e = event; 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); wl_touch_send_down(_volume_wl_touch, serial, e->timestamp, - volume_cdata->surface, 0, + _volume_ec->comp_data->surface, 0, wl_fixed_from_int(e->canvas.x - _volume_ec->client.x), wl_fixed_from_int(e->canvas.y - _volume_ec->client.y)); } @@ -76,11 +75,10 @@ _volume_region_obj_cb_multi_down(void *data EINA_UNUSED, Evas *evas EINA_UNUSED, { Evas_Event_Multi_Down *e = event; 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); wl_touch_send_down(_volume_wl_touch, serial, e->timestamp, - volume_cdata->surface, e->device, + _volume_ec->comp_data->surface, e->device, wl_fixed_from_int(e->canvas.x - _volume_ec->client.x), wl_fixed_from_int(e->canvas.y - _volume_ec->client.y)); } @@ -410,11 +408,10 @@ _volume_wl_touch_resource_get(void) Eina_List *l; struct wl_client *wc; struct wl_resource *res; - 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); + + wc = wl_resource_get_client(_volume_ec->comp_data->surface); EINA_LIST_FOREACH(e_comp_wl->touch.resources, l, res) { if (wl_resource_get_client(res) != wc) continue; diff --git a/src/bin/video/e_client_video.c b/src/bin/video/e_client_video.c index d40c91cd1e..db789f2b9c 100644 --- a/src/bin/video/e_client_video.c +++ b/src/bin/video/e_client_video.c @@ -237,23 +237,20 @@ static E_Client * _e_client_video_ec_offscreen_parent_get(E_Client *ec) { E_Client *parent = NULL; - E_Comp_Wl_Client_Data *cdata = NULL, *parent_cdate = NULL; - cdata = e_client_cdata_get(ec); - if (!cdata || !cdata->sub.data) + if (!ec->comp_data || !ec->comp_data->sub.data) return NULL; - parent = cdata->sub.data->parent; + parent = ec->comp_data->sub.data->parent; while (parent) { - parent_cdate = e_client_cdata_get(parent); - if (!parent_cdate || !parent_cdate->sub.data) + if (!parent->comp_data || !parent->comp_data->sub.data) return NULL; - if (parent_cdate->sub.data->remote_surface.offscreen_parent) - return parent_cdate->sub.data->remote_surface.offscreen_parent; + if (parent->comp_data->sub.data->remote_surface.offscreen_parent) + return parent->comp_data->sub.data->remote_surface.offscreen_parent; - parent = parent_cdate->sub.data->parent; + parent = parent->comp_data->sub.data->parent; } return NULL; diff --git a/src/bin/video/e_comp_wl_video.c b/src/bin/video/e_comp_wl_video.c index c5c1b8ef73..0e340a9deb 100644 --- a/src/bin/video/e_comp_wl_video.c +++ b/src/bin/video/e_comp_wl_video.c @@ -329,13 +329,11 @@ _e_comp_wl_video_handle_viewport_get(struct wl_client *client, struct wl_resource *surface) { E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; if (!(ec = wl_resource_get_user_data(surface))) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; + if (!ec->comp_data) return; - if (cdata->scaler.viewport) + if (ec->comp_data && ec->comp_data->scaler.viewport) { wl_resource_post_error(resource, TIZEN_VIDEO_ERROR_VIEWPORT_EXISTS, diff --git a/src/bin/video/e_comp_wl_video_buffer.c b/src/bin/video/e_comp_wl_video_buffer.c index 1bf9e7de08..812a38d0d1 100644 --- a/src/bin/video/e_comp_wl_video_buffer.c +++ b/src/bin/video/e_comp_wl_video_buffer.c @@ -923,9 +923,8 @@ e_comp_wl_video_buffer_size_get(E_Client *ec, int *bw, int *bh) EINTERN void e_comp_wl_video_buffer_transform_scale_size_get(E_Client *ec, int *bw, int *bh) { - E_Comp_Wl_Client_Data *cdata = e_client_cdata_get(ec); E_Comp_Wl_Buffer *buffer = e_pixmap_resource_get(ec->pixmap); - E_Comp_Wl_Buffer_Viewport *vp = &cdata->scaler.buffer_viewport; + E_Comp_Wl_Buffer_Viewport *vp = &ec->comp_data->scaler.buffer_viewport; int w, h, transform; if (bw) *bw = 0; diff --git a/src/bin/video/iface/e_video_hwc.c b/src/bin/video/iface/e_video_hwc.c index 1cd1ae309c..8c5c674c12 100644 --- a/src/bin/video/iface/e_video_hwc.c +++ b/src/bin/video/iface/e_video_hwc.c @@ -54,23 +54,20 @@ static E_Client * _e_video_hwc_client_offscreen_parent_get(E_Client *ec) { E_Client *parent = NULL; - E_Comp_Wl_Client_Data *cdata = NULL, *parent_cdata = NULL; - cdata = e_client_cdata_get(ec); - if (!cdata || !cdata->sub.data) + if (!ec->comp_data || !ec->comp_data->sub.data) return NULL; - parent = cdata->sub.data->parent; + parent = ec->comp_data->sub.data->parent; while (parent) { - parent_cdata = e_client_cdata_get(parent); - if (!parent_cdata || !parent_cdata->sub.data) + if (!parent->comp_data || !parent->comp_data->sub.data) return NULL; - if (parent_cdata->sub.data->remote_surface.offscreen_parent) - return parent_cdata->sub.data->remote_surface.offscreen_parent; + if (parent->comp_data->sub.data->remote_surface.offscreen_parent) + return parent->comp_data->sub.data->remote_surface.offscreen_parent; - parent = parent_cdata->sub.data->parent; + parent = parent->comp_data->sub.data->parent; } return NULL; @@ -80,7 +77,6 @@ static Eina_Bool _e_video_hwc_client_visible_get(E_Client *ec) { E_Client *offscreen_parent; - E_Comp_Wl_Client_Data *cdata = NULL; if (e_object_is_del(E_OBJECT(ec))) return EINA_FALSE; @@ -90,8 +86,7 @@ _e_video_hwc_client_visible_get(E_Client *ec) return EINA_FALSE; } - cdata = e_client_cdata_get(ec); - if (cdata->sub.data && cdata->sub.data->stand_alone) + if (ec->comp_data->sub.data && ec->comp_data->sub.data->stand_alone) return EINA_TRUE; offscreen_parent = _e_video_hwc_client_offscreen_parent_get(ec); @@ -221,10 +216,9 @@ _e_video_hwc_input_buffer_get(E_Video_Hwc *evh, E_Comp_Wl_Buffer *comp_buffer) evh->input_buffer_list = eina_list_append(evh->input_buffer_list, vbuf); e_comp_wl_video_buffer_free_func_add(vbuf, _e_video_hwc_input_buffer_cb_free, evh); - E_Comp_Wl_Client_Data *cdata = e_client_cdata_get(evh->ec); DBG("Client(%s):PID(%d) RscID(%d), Buffer(%p) created", e_client_util_name_get(evh->ec) ?: "No Name" , evh->ec->netwm.pid, - wl_resource_get_id(cdata->surface), vbuf); + wl_resource_get_id(evh->ec->comp_data->surface), vbuf); end: vbuf->content_r = evh->geo.input_r; return vbuf; @@ -393,10 +387,9 @@ _e_video_hwc_pp_input_buffer_get(E_Video_Hwc *evh, E_Comp_Wl_Buffer *comp_buffer evh->input_buffer_list = eina_list_append(evh->input_buffer_list, vbuf); e_comp_wl_video_buffer_free_func_add(vbuf, _e_video_hwc_input_buffer_cb_free, evh); - E_Comp_Wl_Client_Data *cdata = e_client_cdata_get(evh->ec); DBG("Client(%s):PID(%d) RscID(%d), Buffer(%p) created", e_client_util_name_get(evh->ec) ?: "No Name" , evh->ec->netwm.pid, - wl_resource_get_id(cdata->surface), vbuf); + wl_resource_get_id(evh->ec->comp_data->surface), vbuf); end: vbuf->content_r = evh->geo.input_r; return vbuf; @@ -1118,7 +1111,6 @@ _e_video_hwc_transform_merge_with_buffer_viewport(E_Comp_Wl_Buffer_Viewport *vp, static Eina_Bool _e_video_hwc_geometry_map_apply(E_Client *ec, E_Video_Hwc_Geometry *out) { - E_Comp_Wl_Client_Data *cdata = NULL; const Evas_Map *m; Evas_Point p[4]; Eina_Rectangle output_r; @@ -1148,13 +1140,12 @@ _e_video_hwc_geometry_map_apply(E_Client *ec, E_Video_Hwc_Geometry *out) return EINA_FALSE; } - cdata = e_client_cdata_get(ec); /* NOTE Merge transform value from evas_map with E_Comp_Wl_Buffer_Viewport's one. * Since buffer.transform isn't applied using evas_map, * it has to be taken into account here to apply buffer.transform * and rotation of e_client_transform together. */ transform = - _e_video_hwc_transform_merge_with_buffer_viewport(&cdata->scaler.buffer_viewport, + _e_video_hwc_transform_merge_with_buffer_viewport(&ec->comp_data->scaler.buffer_viewport, transform); if ((!memcmp(&out->output_r, &output_r, sizeof(Eina_Rectangle))) && @@ -1412,9 +1403,8 @@ _e_video_hwc_geometry_input_rect_get_with_viewport(tbm_surface_h tbm_surf, E_Com static E_Comp_Wl_Subsurf_Data * _e_video_hwc_client_subsurface_data_get(E_Client *ec) { - E_Comp_Wl_Client_Data *cdata = e_client_cdata_get(ec); - if (cdata && cdata->sub.data) - return cdata->sub.data; + if (ec->comp_data && ec->comp_data->sub.data) + return ec->comp_data->sub.data; return NULL; } @@ -1423,7 +1413,6 @@ static void _e_video_hwc_geometry_output_rect_get(E_Client *ec, Eina_Rectangle *out) { E_Comp_Wl_Subsurf_Data *sdata; - E_Comp_Wl_Client_Data *cdata = NULL; sdata = _e_video_hwc_client_subsurface_data_get(ec); if (sdata) @@ -1445,10 +1434,9 @@ _e_video_hwc_geometry_output_rect_get(E_Client *ec, Eina_Rectangle *out) out->y = ec->y; } - cdata = e_client_cdata_get(ec); - out->w = cdata->width_from_viewport; + out->w = ec->comp_data->width_from_viewport; out->w = (out->w + 1) & ~1; - out->h = cdata->height_from_viewport; + out->h = ec->comp_data->height_from_viewport; e_comp_object_frame_xy_unadjust(ec->frame, out->x, out->y, &out->x, &out->y); e_comp_object_frame_wh_unadjust(ec->frame, out->w, out->h, &out->w, &out->h); @@ -1458,7 +1446,6 @@ _e_video_hwc_geometry_output_rect_get(E_Client *ec, Eina_Rectangle *out) static Eina_Bool _e_video_hwc_geometry_viewport_apply(E_Client *ec, E_Video_Hwc_Geometry *out) { - E_Comp_Wl_Client_Data *cdata = NULL; E_Comp_Wl_Buffer_Viewport *vp; tbm_surface_h tbm_surf; @@ -1472,8 +1459,7 @@ _e_video_hwc_geometry_viewport_apply(E_Client *ec, E_Video_Hwc_Geometry *out) return EINA_FALSE; } - cdata = e_client_cdata_get(ec); - vp = &cdata->scaler.buffer_viewport; + vp = &ec->comp_data->scaler.buffer_viewport; _e_video_hwc_geometry_input_rect_get_with_viewport(tbm_surf, vp, &out->input_r); _e_video_hwc_geometry_output_rect_get(ec, &out->output_r); @@ -1643,21 +1629,17 @@ static E_Client * _e_video_hwc_child_client_get(E_Client *ec) { E_Client *subc = NULL; - E_Comp_Wl_Client_Data *cdata = NULL, *subc_cdata = NULL; Eina_List *l; - if (!ec) return NULL; if (e_object_is_del(E_OBJECT(ec))) return NULL; - cdata = e_client_cdata_get(ec); - if (!cdata) return NULL; + if (!ec->comp_data) return NULL; if (e_client_video_hw_composition_check(ec)) return ec; - EINA_LIST_FOREACH(cdata->sub.below_list, l, subc) + EINA_LIST_FOREACH(ec->comp_data->sub.below_list, l, subc) { E_Client *temp= NULL; - subc_cdata = e_client_cdata_get(subc); - if (!subc_cdata || e_object_is_del(E_OBJECT(subc))) continue; + if (!subc->comp_data || e_object_is_del(E_OBJECT(subc))) continue; temp = _e_video_hwc_child_client_get(subc); if(temp) return temp; } @@ -1677,7 +1659,7 @@ _e_video_hwc_cb_client_show(void *data, int type, void *event) EINA_SAFETY_ON_NULL_RETURN_VAL(ev->ec, ECORE_CALLBACK_PASS_ON); ec = ev->ec; - if (!e_client_cdata_get(ec)) return ECORE_CALLBACK_PASS_ON; + if (!ec->comp_data) return ECORE_CALLBACK_PASS_ON; video_ec = _e_video_hwc_child_client_get(ec); if (!video_ec) return ECORE_CALLBACK_PASS_ON; @@ -1731,7 +1713,6 @@ _e_video_hwc_cb_evas_show(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA { E_Video_Hwc *evh; E_Client *ec; - E_Comp_Wl_Client_Data *cdata = NULL; evh = data; ec = evh->ec; @@ -1745,9 +1726,8 @@ _e_video_hwc_cb_evas_show(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA _e_video_hwc_render_queue(evh); } - cdata = e_client_cdata_get(ec); /* if stand_alone is true, not show */ - if (cdata->sub.data && cdata->sub.data->stand_alone) + if (ec->comp_data->sub.data && ec->comp_data->sub.data->stand_alone) return; if (evh->current_fb) @@ -1769,13 +1749,11 @@ _e_video_hwc_cb_surface_viewport(struct wl_listener *listener, void *data) static void _e_video_hwc_client_event_init(E_Video_Hwc *evh) { - E_Comp_Wl_Client_Data *cdata = e_client_cdata_get(evh->ec); - /* In order to try to redraw video whenever viewport changes. */ evh->surface_viewport_listener.notify = _e_video_hwc_cb_surface_viewport; - if (cdata) + if (evh->ec->comp_data) { - wl_signal_add(&cdata->apply_viewport_signal, + wl_signal_add(&evh->ec->comp_data->apply_viewport_signal, &evh->surface_viewport_listener); } @@ -1795,10 +1773,8 @@ _e_video_hwc_client_event_init(E_Video_Hwc *evh) static void _e_video_hwc_client_event_deinit(E_Video_Hwc *evh) { - E_Comp_Wl_Client_Data *cdata = e_client_cdata_get(evh->ec); - - /* links for listener have to be removed only in case cdata is valid. */ - if (cdata) + /* links for listener have to be removed only in case comp_data is valid. */ + if (evh->ec->comp_data) wl_list_remove(&evh->surface_viewport_listener.link); evas_object_event_callback_del_full(evh->ec->frame, EVAS_CALLBACK_SHOW, @@ -2023,7 +1999,6 @@ EINTERN void e_video_hwc_client_mask_update(E_Video_Hwc *evh) { E_Client *topmost; - E_Comp_Wl_Client_Data *topmost_cdata = NULL; Eina_Bool punch = EINA_FALSE; int bw, bh; @@ -2031,9 +2006,8 @@ e_video_hwc_client_mask_update(E_Video_Hwc *evh) punch = EINA_TRUE; else if ((topmost = e_comp_wl_topmost_parent_get(evh->ec))) { - topmost_cdata = e_client_cdata_get(topmost); /* if it's laid above main surface */ - if (eina_list_data_find(topmost_cdata->sub.list, evh->ec)) + if (eina_list_data_find(topmost->comp_data->sub.list, evh->ec)) punch = EINA_TRUE; /* if it's laid under main surface and main surface is transparent */ else if (topmost->argb) diff --git a/src/bin/video/iface/e_video_hwc_planes.c b/src/bin/video/iface/e_video_hwc_planes.c index 6692ee4941..8bc935c0f9 100644 --- a/src/bin/video/iface/e_video_hwc_planes.c +++ b/src/bin/video/iface/e_video_hwc_planes.c @@ -595,12 +595,11 @@ _e_video_hwc_planes_buffer_commit(E_Video_Hwc_Planes *evhp, E_Comp_Wl_Video_Buf e_video_hwc_client_mask_update((E_Video_Hwc *)evhp); - E_Comp_Wl_Client_Data *base_cdata = e_client_cdata_get(evhp->base.ec); DBG("Client(%s):PID(%d) RscID(%d), Buffer(%p, refcnt:%d) is shown." "Geometry details are : buffer size(%dx%d) src(%d,%d, %dx%d)" " dst(%d,%d, %dx%d), transform(%d)", e_client_util_name_get(evhp->base.ec) ?: "No Name" , evhp->base.ec->netwm.pid, - wl_resource_get_id(base_cdata->surface), vbuf, vbuf->ref_cnt, + wl_resource_get_id(evhp->base.ec->comp_data->surface), vbuf, vbuf->ref_cnt, info->src_config.size.h, info->src_config.size.v, info->src_config.pos.x, info->src_config.pos.y, info->src_config.pos.w, info->src_config.pos.h, info->dst_pos.x, info->dst_pos.y, info->dst_pos.w, info->dst_pos.h, info->transform); @@ -644,14 +643,11 @@ static void _e_video_hwc_planes_cb_evas_hide(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { E_Video_Hwc_Planes *evhp = data; - E_Comp_Wl_Client_Data *base_cdata = NULL; if (e_object_is_del(E_OBJECT(evhp->base.ec))) return; - base_cdata = e_client_cdata_get(evhp->base.ec); - if (!base_cdata) return; /* if stand_alone is true, not hide */ - if (base_cdata->sub.data && base_cdata->sub.data->stand_alone) + if (evhp->base.ec->comp_data->sub.data && evhp->base.ec->comp_data->sub.data->stand_alone) return; VIN("evas hide", evhp->base.ec); diff --git a/src/bin/video/iface/e_video_hwc_windows.c b/src/bin/video/iface/e_video_hwc_windows.c index 094a087be4..c5ce0b5f87 100644 --- a/src/bin/video/iface/e_video_hwc_windows.c +++ b/src/bin/video/iface/e_video_hwc_windows.c @@ -70,14 +70,12 @@ _e_video_hwc_windows_commit_data_set(E_Video_Hwc_Windows *evhw, E_Comp_Wl_Video_ * frame buffer. */ evhw->commit_data.wait_release = EINA_TRUE; - E_Comp_Wl_Client_Data *base_ec_cdata = e_client_cdata_get(evhw->base.ec); - DBG("Client(%s):PID(%d) RscID(%d), Buffer(%p, refcnt:%d) is shown." "Geometry details are : buffer size(%dx%d) src(%d,%d, %dx%d)" " dst(%d,%d, %dx%d), transform(%d)", e_client_util_name_get(evhw->base.ec) ?: "No Name" , evhw->base.ec->netwm.pid, - wl_resource_get_id(base_ec_cdata->surface), + wl_resource_get_id(evhw->base.ec->comp_data->surface), vbuf, vbuf->ref_cnt, evhw->commit_data.info.src_config.size.h, evhw->commit_data.info.src_config.size.v, -- 2.34.1