From 903f212ea72499a3b17534550cf1065a77f64c0a Mon Sep 17 00:00:00 2001 From: SooChan Lim Date: Tue, 24 Nov 2020 12:17:51 +0900 Subject: [PATCH] Revert "e_comp_wl: use e_client_data_get" This reverts commit f2fdb61ed951aec0441a50c71912af9f731e5a5b. Change-Id: Ic398a6485f0450f209b0571afd2510735a61c1a9 --- src/bin/e_comp_wl.c | 844 ++++++++++++++++++-------------------------- 1 file changed, 344 insertions(+), 500 deletions(-) diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c index 3b489f9d00..e9a3a6504b 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; 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; 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; 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,16 +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 = 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; E_Comp_Wl_Buffer *buffer; int32_t width, height; 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; } @@ -364,26 +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 = 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; int32_t width, height; - 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; } @@ -391,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, *parent_cdata; - 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; @@ -432,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; @@ -457,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 *offscreen_parent_cdata = e_client_cdata_get(offscreen_parent); Eina_Rectangle *rect; Eina_List *l; - EINA_LIST_FOREACH(offscreen_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 @@ -490,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); @@ -504,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); } @@ -554,7 +540,6 @@ 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; Eina_List *l; E_Client *topmost; @@ -563,11 +548,10 @@ _e_comp_wl_evas_cb_show(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EIN if (!ec->override) e_hints_window_visible_set(ec); - cdata = e_client_cdata_get(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)) @@ -576,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)) { @@ -591,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; 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); - /* 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 @@ -635,47 +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, *subc_cdata; 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); - - 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 @@ -685,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; 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(); @@ -725,13 +701,10 @@ static void _e_comp_wl_evas_cb_restack(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { E_Client *ec = (E_Client *)data; - E_Comp_Wl_Client_Data *cdata; - if (!ec) return; + if ((!ec) || (!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; e_comp_wl_subsurface_stack_update(ec); } @@ -775,15 +748,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;; } @@ -793,17 +765,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; @@ -820,7 +791,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; EINA_SAFETY_ON_NULL_RETURN(dev); @@ -829,8 +799,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); @@ -838,7 +807,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; @@ -864,10 +833,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; - 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; @@ -875,7 +842,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; @@ -917,15 +884,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; 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); @@ -941,13 +906,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; } @@ -971,15 +936,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; 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) { @@ -1087,13 +1050,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; 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) @@ -1109,7 +1071,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) { @@ -1118,7 +1080,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; @@ -1129,7 +1091,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; Evas_Event_Mouse_Out *ev; struct wl_resource *res; struct wl_client *wc; @@ -1160,8 +1121,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) { @@ -1177,7 +1138,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) { @@ -1187,7 +1148,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; } @@ -1201,14 +1162,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; 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) @@ -1229,7 +1188,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 { @@ -1249,14 +1208,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; 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); @@ -1275,14 +1232,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; 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; @@ -1321,7 +1276,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; Evas_Event_Mouse_Move *ev; Evas_Device *dev = NULL; const char *dev_name; @@ -1335,8 +1289,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; @@ -1381,12 +1334,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; - 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; @@ -1513,7 +1463,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; struct wl_resource *res; struct wl_client *wc; Eina_List *l; @@ -1531,10 +1480,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; @@ -1547,7 +1495,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; Evas_Event_Mouse_Wheel *ev; ev = event; @@ -1556,8 +1503,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; @@ -1571,7 +1517,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; Evas_Event_Multi_Down *ev = event; Evas_Device *dev = NULL; const char *dev_name; @@ -1580,8 +1525,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; @@ -1609,7 +1553,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; Evas_Event_Multi_Up *ev = event; Evas_Device *dev = NULL; const char *dev_name; @@ -1619,8 +1562,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; @@ -1653,7 +1595,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; Evas_Event_Multi_Move *ev = event; Evas_Device *dev = NULL; const char *dev_name; @@ -1661,8 +1602,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; @@ -1752,7 +1692,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; uint32_t serial; E_Comp_Wl_Key_Data *k; struct wl_resource *res; @@ -1761,10 +1700,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); @@ -1790,15 +1728,12 @@ EINTERN void e_comp_wl_feed_focus_in(E_Client *ec) { E_Client *focused; - E_Comp_Wl_Client_Data *cdata; 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 */ @@ -1808,7 +1743,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) { @@ -1820,10 +1755,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; @@ -1843,7 +1778,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; struct wl_resource *res; uint32_t serial; E_Comp_Wl_Key_Data *k; @@ -1852,10 +1786,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)) @@ -1866,7 +1799,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; @@ -1882,7 +1815,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); } @@ -1892,12 +1825,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; if (!(ec = data)) return; + if ((ec->shading) || (ec->shaded)) return; - cdata = e_client_cdata_get(ec); - 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)) @@ -1943,40 +1875,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; if (e_object_is_del(E_OBJECT(ec))) return; /* check for wayland pixmap */ - cdata = e_client_cdata_get(ec); - 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 = e_client_cdata_get(ec); - cdata->maximize_pre = 1; + ec->comp_data->maximize_pre = 1; } static void @@ -2000,16 +1930,13 @@ static void _e_comp_wl_evas_cb_kill_request(void *data, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED) { E_Client *ec; - E_Comp_Wl_Client_Data *cdata; 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); } @@ -2024,15 +1951,13 @@ static void _e_comp_wl_evas_cb_ping(void *data, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED) { E_Client *ec; - E_Comp_Wl_Client_Data *cdata; if (!(ec = data)) return; - cdata = e_client_cdata_get(ec); - if (!cdata) return; - if (!cdata->shell.ping) return; - if (!cdata->shell.surface) 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 @@ -2127,12 +2052,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; - - 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 @@ -2184,7 +2105,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 @@ -2240,7 +2161,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; /* try to get the client from the object */ if (!(ec = e_comp_object_client_get(ev->comp_object))) @@ -2254,8 +2174,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; } @@ -2268,11 +2187,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; @@ -2307,17 +2225,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; 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); @@ -2329,16 +2245,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; 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); @@ -2365,7 +2279,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; int prev_w, prev_h; Eina_Rectangle *window; @@ -2381,8 +2294,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)) @@ -2481,13 +2393,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; @@ -2526,7 +2437,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) { @@ -2535,8 +2446,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); @@ -2592,10 +2503,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) @@ -2611,37 +2522,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)) || @@ -2652,23 +2563,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); } @@ -2701,7 +2612,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(); @@ -2717,19 +2628,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); @@ -2740,14 +2652,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 @@ -2856,7 +2768,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)) @@ -2885,13 +2797,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; 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) { @@ -2903,10 +2812,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); } @@ -2914,25 +2823,24 @@ _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; Eina_Rectangle *dmg = NULL; if (!(ec = wl_resource_get_user_data(resource))) return; @@ -2940,15 +2848,14 @@ _e_comp_wl_surface_cb_damage(struct wl_client *client EINA_UNUSED, struct wl_res if (!(dmg = eina_rectangle_new(x, y, w, h))) return; - cdata = e_client_cdata_get(ec); - 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; E_Comp_Wl_Subsurf_Data *sdata; if (!(ec = wl_resource_get_user_data(resource))) return; @@ -2957,16 +2864,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 = @@ -2978,7 +2890,6 @@ 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; struct wl_resource *res; if (!(ec = wl_resource_get_user_data(resource))) return; @@ -2994,22 +2905,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 = e_client_cdata_get(ec); - 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; 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->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; @@ -3017,9 +2926,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) { @@ -3046,14 +2955,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; 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->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; @@ -3068,11 +2975,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}); } } @@ -3081,21 +2988,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; 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->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)); @@ -3114,13 +3019,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); @@ -3131,11 +3036,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; 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 (transform < 0 || transform > WL_OUTPUT_TRANSFORM_FLIPPED_270) { @@ -3146,19 +3049,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; 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 (scale < 1) { @@ -3169,24 +3070,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; 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 (!(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 = @@ -3222,26 +3122,24 @@ static void _e_comp_wl_surface_destroy(struct wl_resource *resource) { E_Client *ec; - E_Comp_Wl_Client_Data *cdata; struct wl_resource *res; Eina_List *l, *ll; if (!(ec = wl_resource_get_user_data(resource))) return; - cdata = e_client_cdata_get(ec); 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); @@ -3319,7 +3217,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) @@ -3327,7 +3224,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; } @@ -3614,7 +3511,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; /* make sure this is a wayland client */ if (e_pixmap_type_get(ec->pixmap) != E_PIXMAP_TYPE_WL) return; @@ -3633,17 +3529,17 @@ _e_comp_wl_client_cb_new(void *data EINA_UNUSED, E_Client *ec) return; } - if (!(cdata = e_client_cdata_new(ec))) + if (!(ec->comp_data = E_NEW(E_Comp_Client_Data, 1))) { ERR("Could not allocate new client data structure"); TRACE_DS_END(); return; } - 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; @@ -3658,23 +3554,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(); @@ -3683,7 +3579,7 @@ end: static void _e_comp_wl_client_cb_del(void *data EINA_UNUSED, E_Client *ec) { - E_Comp_Wl_Client_Data *cdata; + /* Eina_Rectangle *dmg; */ struct wl_resource *cb; /* make sure this is a wayland client */ @@ -3691,19 +3587,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)) { @@ -3711,29 +3606,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); @@ -3747,23 +3642,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_client_cdata_free(ec); + E_FREE(ec->comp_data); _e_comp_wl_focus_check(); @@ -3773,39 +3668,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; - if (e_pixmap_type_get(ec->pixmap) != E_PIXMAP_TYPE_WL) return; /* send configure */ - cdata = e_client_cdata_get(ec); - 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; - if (e_pixmap_type_get(ec->pixmap) != E_PIXMAP_TYPE_WL) return; /* send configure */ - cdata = e_client_cdata_get(ec); - 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; } @@ -3870,9 +3759,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; @@ -3893,7 +3781,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); @@ -4443,16 +4331,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; 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); @@ -4460,7 +4346,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); @@ -4474,15 +4360,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; 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); } @@ -4501,36 +4385,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)) @@ -4540,13 +4424,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; @@ -4629,7 +4513,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; struct wl_listener *listener; struct wl_shm_buffer *shmbuff; Eina_Bool res; @@ -4661,8 +4544,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; @@ -4735,8 +4617,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; @@ -4952,7 +4833,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; keycode = (ev->keycode - 8); @@ -4960,9 +4840,8 @@ _e_comp_wl_key_send(Ecore_Event_Key *ev, enum wl_keyboard_key_state state, Eina_ comp_conf = e_comp_config_get(); - cdata = e_client_cdata_get(ec); - if (ec && cdata && 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) { @@ -4984,7 +4863,6 @@ EINTERN Eina_Bool e_comp_wl_key_down(Ecore_Event_Key *ev) { E_Client *ec = NULL; - E_Comp_Wl_Client_Data *cdata; uint32_t keycode; E_Comp_Wl_Key_Data *end, *k; @@ -5023,8 +4901,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(); - cdata = e_client_cdata_get(ec); - if (ec && cdata && 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); @@ -5121,7 +4998,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; if (ec->cur_mouse_action || e_comp_wl->drag) return EINA_FALSE; @@ -5138,13 +5014,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(); @@ -5304,18 +5179,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; 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; @@ -5348,12 +5221,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; 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); @@ -5368,7 +5239,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); @@ -5401,17 +5272,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; 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); @@ -5440,17 +5309,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; 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); @@ -5476,11 +5343,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; - 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); @@ -5493,15 +5357,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; 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); @@ -5523,15 +5385,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; 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); @@ -5551,15 +5411,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; 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); @@ -5578,17 +5436,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; 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) { @@ -5598,7 +5454,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)); } @@ -5609,7 +5465,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; uint32_t serial; struct wl_client *wc; struct wl_resource *res; @@ -5617,13 +5472,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) { @@ -5633,7 +5487,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; @@ -5696,7 +5550,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; struct wl_resource *res; struct wl_client *wc; Eina_List *l; @@ -5713,16 +5566,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; } @@ -5891,9 +5744,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) { @@ -5936,7 +5787,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; @@ -5995,7 +5846,6 @@ ret: EINTERN Eina_Bool e_comp_wl_commit_sync_configure(E_Client *ec) { - E_Comp_Wl_Client_Data *cdata; Eina_List *l; E_Client_Pending_Geometry *geo; E_Client_Demand_Geometry change = 0; @@ -6059,10 +5909,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; - cdata = e_client_cdata_get(ec); - 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); } @@ -6407,17 +6257,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; 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) @@ -6437,9 +6285,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); @@ -6448,7 +6296,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; E_Comp_Wl_Buffer *buffer; E_Comp_Wl_Buffer_Viewport *vp; const Evas_Map *m; @@ -6461,14 +6308,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; -- 2.34.1