Update e_wayland for recent Wayland 1.2 changes
Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
parent
101a1f7bea
commit
098c5c5ca0
|
@ -24,7 +24,7 @@ struct _E_Buffer
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
struct wl_shm_buffer *shm_buffer;
|
struct wl_shm_buffer *shm_buffer;
|
||||||
struct wl_buffer *legacy_buffer;
|
void *legacy_buffer;
|
||||||
};
|
};
|
||||||
|
|
||||||
Evas_Coord w, h;
|
Evas_Coord w, h;
|
||||||
|
|
|
@ -112,8 +112,8 @@ e_compositor_init(E_Compositor *comp, void *display)
|
||||||
wl_signal_init(&comp->signals.seat);
|
wl_signal_init(&comp->signals.seat);
|
||||||
|
|
||||||
/* try to add the compositor to the displays global list */
|
/* try to add the compositor to the displays global list */
|
||||||
if (!wl_display_add_global(comp->wl.display, &wl_compositor_interface,
|
if (!wl_global_create(comp->wl.display, &wl_compositor_interface,
|
||||||
comp, _e_comp_cb_bind))
|
3, comp, _e_comp_cb_bind))
|
||||||
{
|
{
|
||||||
ERR("Could not add compositor to globals: %m");
|
ERR("Could not add compositor to globals: %m");
|
||||||
goto global_err;
|
goto global_err;
|
||||||
|
@ -131,9 +131,8 @@ e_compositor_init(E_Compositor *comp, void *display)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* initialize the data device manager */
|
/* initialize the data device manager */
|
||||||
if (!wl_display_add_global(comp->wl.display,
|
if (!wl_global_create(comp->wl.display, &wl_data_device_manager_interface,
|
||||||
&wl_data_device_manager_interface, NULL,
|
1, NULL, _e_comp_cb_bind_manager))
|
||||||
_e_comp_cb_bind_manager))
|
|
||||||
{
|
{
|
||||||
ERR("Could not add data device manager to globals: %m");
|
ERR("Could not add data device manager to globals: %m");
|
||||||
goto global_err;
|
goto global_err;
|
||||||
|
@ -385,20 +384,24 @@ static void
|
||||||
_e_comp_cb_bind(struct wl_client *client, void *data, unsigned int version EINA_UNUSED, unsigned int id)
|
_e_comp_cb_bind(struct wl_client *client, void *data, unsigned int version EINA_UNUSED, unsigned int id)
|
||||||
{
|
{
|
||||||
E_Compositor *comp;
|
E_Compositor *comp;
|
||||||
|
struct wl_resource *res;
|
||||||
|
|
||||||
if (!(comp = data)) return;
|
if (!(comp = data)) return;
|
||||||
|
|
||||||
/* add the compositor to the client */
|
res = wl_resource_create(client, &wl_compositor_interface,
|
||||||
wl_client_add_object(client, &wl_compositor_interface,
|
MIN(version, 3), id);
|
||||||
&_e_compositor_interface, id, comp);
|
if (res)
|
||||||
|
wl_resource_set_implementation(res, &_e_compositor_interface, comp, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_e_comp_cb_bind_manager(struct wl_client *client, void *data EINA_UNUSED, unsigned int version EINA_UNUSED, unsigned int id)
|
_e_comp_cb_bind_manager(struct wl_client *client, void *data EINA_UNUSED, unsigned int version EINA_UNUSED, unsigned int id)
|
||||||
{
|
{
|
||||||
/* add the data device manager to the client */
|
struct wl_resource *res;
|
||||||
wl_client_add_object(client, &wl_data_device_manager_interface,
|
|
||||||
&_e_manager_interface, id, NULL);
|
res = wl_resource_create(client, &wl_data_device_manager_interface, 1, id);
|
||||||
|
if (res)
|
||||||
|
wl_resource_set_implementation(res, &_e_manager_interface, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -413,7 +416,7 @@ _e_comp_cb_surface_create(struct wl_client *client, struct wl_resource *resource
|
||||||
if (!(comp = resource->data)) return;
|
if (!(comp = resource->data)) return;
|
||||||
|
|
||||||
/* try to create a new surface */
|
/* try to create a new surface */
|
||||||
if (!(es = e_surface_new(client, id)))
|
if (!(es = e_surface_new(client, resource, id)))
|
||||||
{
|
{
|
||||||
wl_resource_post_no_memory(resource);
|
wl_resource_post_no_memory(resource);
|
||||||
return;
|
return;
|
||||||
|
@ -527,11 +530,11 @@ _e_comp_data_device_cb_get(struct wl_client *client, struct wl_resource *resourc
|
||||||
|
|
||||||
if (!(seat = wl_resource_get_user_data(seat_resource))) return;
|
if (!(seat = wl_resource_get_user_data(seat_resource))) return;
|
||||||
|
|
||||||
res = wl_client_add_object(client, &wl_data_device_interface,
|
res = wl_resource_create(client, &wl_data_device_interface, 1, id);
|
||||||
&_e_data_device_interface, id, seat);
|
|
||||||
|
|
||||||
wl_list_insert(&seat->drag_resources, wl_resource_get_link(res));
|
wl_list_insert(&seat->drag_resources, wl_resource_get_link(res));
|
||||||
wl_resource_set_destructor(res, _e_comp_data_device_cb_unbind);
|
wl_resource_set_implementation(res, &_e_data_device_interface,
|
||||||
|
seat, _e_comp_data_device_cb_unbind);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#include "e.h"
|
#include "e.h"
|
||||||
|
|
||||||
/* local function prototypes */
|
/* local function prototypes */
|
||||||
|
static void _e_region_destroy(struct wl_resource *resource);
|
||||||
static void _e_region_cb_destroy(struct wl_client *client EINA_UNUSED, struct wl_resource *resource);
|
static void _e_region_cb_destroy(struct wl_client *client EINA_UNUSED, struct wl_resource *resource);
|
||||||
static void _e_region_cb_add(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, int x, int y, int w, int h);
|
static void _e_region_cb_add(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, int x, int y, int w, int h);
|
||||||
static void _e_region_cb_subtract(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, int x, int y, int w, int h);
|
static void _e_region_cb_subtract(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, int x, int y, int w, int h);
|
||||||
|
@ -24,13 +25,24 @@ e_region_new(struct wl_client *client, unsigned int id)
|
||||||
pixman_region32_init(®->region);
|
pixman_region32_init(®->region);
|
||||||
|
|
||||||
reg->resource =
|
reg->resource =
|
||||||
wl_client_add_object(client, &wl_region_interface,
|
wl_resource_create(client, &wl_region_interface, 1, id);
|
||||||
&_e_region_interface, id, reg);
|
wl_resource_set_implementation(reg->resource, &_e_region_interface,
|
||||||
|
reg, _e_region_destroy);
|
||||||
|
|
||||||
return reg;
|
return reg;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* local functions */
|
/* local functions */
|
||||||
|
static void
|
||||||
|
_e_region_destroy(struct wl_resource *resource)
|
||||||
|
{
|
||||||
|
E_Region *reg;
|
||||||
|
|
||||||
|
if (!(reg = wl_resource_get_user_data(resource))) return;
|
||||||
|
pixman_region32_fini(®->region);
|
||||||
|
E_FREE(reg);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_e_region_cb_destroy(struct wl_client *client EINA_UNUSED, struct wl_resource *resource)
|
_e_region_cb_destroy(struct wl_client *client EINA_UNUSED, struct wl_resource *resource)
|
||||||
{
|
{
|
||||||
|
|
|
@ -27,7 +27,7 @@ static const struct wl_surface_interface _e_surface_interface =
|
||||||
};
|
};
|
||||||
|
|
||||||
EAPI E_Surface *
|
EAPI E_Surface *
|
||||||
e_surface_new(struct wl_client *client, unsigned int id)
|
e_surface_new(struct wl_client *client, struct wl_resource *resource, unsigned int id)
|
||||||
{
|
{
|
||||||
E_Surface *es;
|
E_Surface *es;
|
||||||
|
|
||||||
|
@ -62,8 +62,10 @@ e_surface_new(struct wl_client *client, unsigned int id)
|
||||||
UINT32_MAX, UINT32_MAX);
|
UINT32_MAX, UINT32_MAX);
|
||||||
|
|
||||||
es->wl.resource =
|
es->wl.resource =
|
||||||
wl_client_add_object(client, &wl_surface_interface,
|
wl_resource_create(client, &wl_surface_interface,
|
||||||
&_e_surface_interface, id, es);
|
wl_resource_get_version(resource), id);
|
||||||
|
wl_resource_set_implementation(es->wl.resource,
|
||||||
|
&_e_surface_interface, es, NULL);
|
||||||
|
|
||||||
return es;
|
return es;
|
||||||
}
|
}
|
||||||
|
@ -460,9 +462,10 @@ _e_surface_cb_frame(struct wl_client *client, struct wl_resource *resource, unsi
|
||||||
}
|
}
|
||||||
|
|
||||||
cb->resource =
|
cb->resource =
|
||||||
wl_client_add_object(client, &wl_callback_interface, NULL, callback, cb);
|
wl_resource_create(client, &wl_callback_interface, 1, callback);
|
||||||
|
|
||||||
wl_resource_set_destructor(cb->resource, _e_surface_frame_cb_destroy);
|
wl_resource_set_implementation(cb->resource, NULL, cb,
|
||||||
|
_e_surface_frame_cb_destroy);
|
||||||
|
|
||||||
/* append the callback to pending frames */
|
/* append the callback to pending frames */
|
||||||
wl_list_insert(es->pending.frames.prev, &cb->link);
|
wl_list_insert(es->pending.frames.prev, &cb->link);
|
||||||
|
|
|
@ -77,7 +77,7 @@ struct _E_Surface_Frame
|
||||||
struct wl_list link;
|
struct wl_list link;
|
||||||
};
|
};
|
||||||
|
|
||||||
EAPI E_Surface *e_surface_new(struct wl_client *client, unsigned int id);
|
EAPI E_Surface *e_surface_new(struct wl_client *client, struct wl_resource *resource, unsigned int id);
|
||||||
EAPI void e_surface_attach(E_Surface *es, E_Buffer *buffer);
|
EAPI void e_surface_attach(E_Surface *es, E_Buffer *buffer);
|
||||||
EAPI void e_surface_unmap(E_Surface *es);
|
EAPI void e_surface_unmap(E_Surface *es);
|
||||||
EAPI void e_surface_damage(E_Surface *es);
|
EAPI void e_surface_damage(E_Surface *es);
|
||||||
|
|
Loading…
Reference in New Issue