Update e_wayland for recent Wayland 1.2 changes

Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2013-07-16 07:40:57 +01:00
parent 101a1f7bea
commit 098c5c5ca0
5 changed files with 42 additions and 24 deletions

View File

@ -24,7 +24,7 @@ struct _E_Buffer
union
{
struct wl_shm_buffer *shm_buffer;
struct wl_buffer *legacy_buffer;
void *legacy_buffer;
};
Evas_Coord w, h;

View File

@ -112,8 +112,8 @@ e_compositor_init(E_Compositor *comp, void *display)
wl_signal_init(&comp->signals.seat);
/* try to add the compositor to the displays global list */
if (!wl_display_add_global(comp->wl.display, &wl_compositor_interface,
comp, _e_comp_cb_bind))
if (!wl_global_create(comp->wl.display, &wl_compositor_interface,
3, comp, _e_comp_cb_bind))
{
ERR("Could not add compositor to globals: %m");
goto global_err;
@ -131,9 +131,8 @@ e_compositor_init(E_Compositor *comp, void *display)
}
/* initialize the data device manager */
if (!wl_display_add_global(comp->wl.display,
&wl_data_device_manager_interface, NULL,
_e_comp_cb_bind_manager))
if (!wl_global_create(comp->wl.display, &wl_data_device_manager_interface,
1, NULL, _e_comp_cb_bind_manager))
{
ERR("Could not add data device manager to globals: %m");
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_Compositor *comp;
struct wl_resource *res;
if (!(comp = data)) return;
/* add the compositor to the client */
wl_client_add_object(client, &wl_compositor_interface,
&_e_compositor_interface, id, comp);
res = wl_resource_create(client, &wl_compositor_interface,
MIN(version, 3), id);
if (res)
wl_resource_set_implementation(res, &_e_compositor_interface, comp, NULL);
}
static void
_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 */
wl_client_add_object(client, &wl_data_device_manager_interface,
&_e_manager_interface, id, NULL);
struct wl_resource *res;
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
@ -413,7 +416,7 @@ _e_comp_cb_surface_create(struct wl_client *client, struct wl_resource *resource
if (!(comp = resource->data)) return;
/* 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);
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;
res = wl_client_add_object(client, &wl_data_device_interface,
&_e_data_device_interface, id, seat);
res = wl_resource_create(client, &wl_data_device_interface, 1, id);
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

View File

@ -1,6 +1,7 @@
#include "e.h"
/* 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_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);
@ -24,13 +25,24 @@ e_region_new(struct wl_client *client, unsigned int id)
pixman_region32_init(&reg->region);
reg->resource =
wl_client_add_object(client, &wl_region_interface,
&_e_region_interface, id, reg);
wl_resource_create(client, &wl_region_interface, 1, id);
wl_resource_set_implementation(reg->resource, &_e_region_interface,
reg, _e_region_destroy);
return reg;
}
/* 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(&reg->region);
E_FREE(reg);
}
static void
_e_region_cb_destroy(struct wl_client *client EINA_UNUSED, struct wl_resource *resource)
{

View File

@ -27,7 +27,7 @@ static const struct wl_surface_interface _e_surface_interface =
};
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;
@ -62,8 +62,10 @@ e_surface_new(struct wl_client *client, unsigned int id)
UINT32_MAX, UINT32_MAX);
es->wl.resource =
wl_client_add_object(client, &wl_surface_interface,
&_e_surface_interface, id, es);
wl_resource_create(client, &wl_surface_interface,
wl_resource_get_version(resource), id);
wl_resource_set_implementation(es->wl.resource,
&_e_surface_interface, es, NULL);
return es;
}
@ -460,9 +462,10 @@ _e_surface_cb_frame(struct wl_client *client, struct wl_resource *resource, unsi
}
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 */
wl_list_insert(es->pending.frames.prev, &cb->link);

View File

@ -77,7 +77,7 @@ struct _E_Surface_Frame
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_unmap(E_Surface *es);
EAPI void e_surface_damage(E_Surface *es);