Add start of surface code.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
parent
59db3c7b89
commit
3837e4c442
|
@ -0,0 +1,50 @@
|
|||
#include "e.h"
|
||||
|
||||
/* local function prototypes */
|
||||
static void _e_surface_cb_destroy(struct wl_client *client EINA_UNUSED, struct wl_resource *resource);
|
||||
|
||||
/* local wayland interfaces */
|
||||
static const struct wl_surface_interface _e_surface_interface =
|
||||
{
|
||||
_e_surface_cb_destroy,
|
||||
NULL, // cb_attach
|
||||
NULL, // cb_damage
|
||||
NULL, // cb_frame
|
||||
NULL, // cb_opaque_set
|
||||
NULL, // cb_input_set
|
||||
NULL, // cb_commit
|
||||
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);
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
#ifdef E_TYPEDEFS
|
||||
|
||||
typedef struct _E_Surface E_Surface;
|
||||
|
||||
#else
|
||||
# ifndef E_SURFACE_H
|
||||
# define E_SURFACE_H
|
||||
|
||||
struct _E_Surface
|
||||
{
|
||||
struct
|
||||
{
|
||||
struct wl_surface surface;
|
||||
struct wl_list link;
|
||||
} wl;
|
||||
};
|
||||
|
||||
EAPI E_Surface *e_surface_new(unsigned int id);
|
||||
|
||||
# endif
|
||||
#endif
|
Loading…
Reference in New Issue