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)
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);
}
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))
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))
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;
}
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;
}
{
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;
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;
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
}
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);
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);
}
_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;
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))
EC_CHANGED(ec);
}
- if (!cdata->need_reparent)
+ if (!ec->comp_data->need_reparent)
{
if ((ec->hidden) || (ec->iconic))
{
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
{
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
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();
_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);
}
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;;
}
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;
struct wl_client *wc;
uint32_t serial;
Eina_List *l, *ll;
- E_Comp_Wl_Client_Data *cdata;
EINA_SAFETY_ON_NULL_RETURN(dev);
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);
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;
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;
_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;
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);
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;
}
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)
{
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)
}
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)
{
_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;
_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;
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)
{
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)
{
_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;
}
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)
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
{
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);
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;
_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;
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;
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;
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;
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;
_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;
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;
_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;
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;
_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;
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;
_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;
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;
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;
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);
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 */
/* 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)
{
}
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;
_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;
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))
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;
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);
}
_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))
}
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
_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);
}
_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
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
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
_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)))
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;
}
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;
_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);
_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);
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;
}
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))
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;
}
}
- cdata->scaler.buffer_viewport = state->buffer_viewport;
+ ec->comp_data->scaler.buffer_viewport = state->buffer_viewport;
if (state->new_attach)
{
}
/* 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);
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)
}
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)) ||
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);
}
}
}
- 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();
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);
/* 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
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))
_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)
{
}
}
- 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);
}
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;
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;
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 =
_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;
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;
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)
{
_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;
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});
}
}
_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));
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);
_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)
{
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)
{
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 =
_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);
}
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)
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;
}
_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;
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;
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();
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 */
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))
{
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);
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();
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;
}
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;
/* 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);
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);
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);
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);
}
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))
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;
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;
}
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;
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;
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);
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)
{
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;
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);
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;
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();
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;
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);
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);
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);
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);
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);
{
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);
{
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);
{
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);
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)
{
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));
}
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;
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)
{
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;
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;
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;
}
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)
{
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;
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;
// 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);
}
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)
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);
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;
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;