2013-05-03 04:31:42 -07:00
|
|
|
#include "e.h"
|
|
|
|
|
|
|
|
/* local function prototypes */
|
|
|
|
static void _e_surface_cb_destroy(struct wl_client *client EINA_UNUSED, struct wl_resource *resource);
|
2013-05-03 06:37:17 -07:00
|
|
|
static void _e_surface_cb_attach(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, struct wl_resource *buffer_resource, int x, int y);
|
|
|
|
static void _e_surface_cb_damage(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, int x, int y, int w, int h);
|
|
|
|
static void _e_surface_cb_commit(struct wl_client *client EINA_UNUSED, struct wl_resource *resource);
|
2013-05-03 04:31:42 -07:00
|
|
|
|
|
|
|
/* local wayland interfaces */
|
|
|
|
static const struct wl_surface_interface _e_surface_interface =
|
|
|
|
{
|
|
|
|
_e_surface_cb_destroy,
|
2013-05-03 06:37:17 -07:00
|
|
|
_e_surface_cb_attach,
|
|
|
|
_e_surface_cb_damage,
|
2013-05-03 04:31:42 -07:00
|
|
|
NULL, // cb_frame
|
|
|
|
NULL, // cb_opaque_set
|
|
|
|
NULL, // cb_input_set
|
2013-05-03 06:37:17 -07:00
|
|
|
_e_surface_cb_commit,
|
2013-05-03 04:31:42 -07:00
|
|
|
NULL // cb_buffer_transform_set
|
|
|
|
};
|
|
|
|
|
|
|
|
EAPI E_Surface *
|
|
|
|
e_surface_new(unsigned int id)
|
|
|
|
{
|
|
|
|
E_Surface *es;
|
|
|
|
|
|
|
|
/* try to allocate space for a new surface */
|
|
|
|
if (!(es = E_NEW(E_Surface, 1))) return NULL;
|
|
|
|
|
|
|
|
/* initialize the destroy signal */
|
|
|
|
wl_signal_init(&es->wl.surface.resource.destroy_signal);
|
|
|
|
|
|
|
|
/* initialize the link */
|
|
|
|
wl_list_init(&es->wl.link);
|
|
|
|
|
|
|
|
/* TODO: finish me */
|
|
|
|
|
|
|
|
/* setup the surface object */
|
|
|
|
es->wl.surface.resource.object.id = id;
|
|
|
|
es->wl.surface.resource.object.interface = &wl_surface_interface;
|
|
|
|
es->wl.surface.resource.object.implementation =
|
|
|
|
(void (**)(void))&_e_surface_interface;
|
|
|
|
es->wl.surface.resource.data = es;
|
|
|
|
|
|
|
|
return es;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* local functions */
|
|
|
|
static void
|
|
|
|
_e_surface_cb_destroy(struct wl_client *client EINA_UNUSED, struct wl_resource *resource)
|
|
|
|
{
|
|
|
|
wl_resource_destroy(resource);
|
|
|
|
}
|
2013-05-03 06:37:17 -07:00
|
|
|
|
|
|
|
static void
|
|
|
|
_e_surface_cb_attach(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, struct wl_resource *buffer_resource, int x, int y)
|
|
|
|
{
|
|
|
|
E_Surface *es;
|
|
|
|
|
|
|
|
/* try to cast the resource to our surface */
|
|
|
|
if (!(es = resource->data)) return;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_e_surface_cb_damage(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, int x, int y, int w, int h)
|
|
|
|
{
|
|
|
|
E_Surface *es;
|
|
|
|
|
|
|
|
/* try to cast the resource to our surface */
|
|
|
|
if (!(es = resource->data)) return;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_e_surface_cb_commit(struct wl_client *client EINA_UNUSED, struct wl_resource *resource)
|
|
|
|
{
|
|
|
|
E_Surface *es;
|
|
|
|
|
|
|
|
/* try to cast the resource to our surface */
|
|
|
|
if (!(es = resource->data)) return;
|
|
|
|
}
|