ecore_wl2: Auto generate www protocol

Needed to copy the protocol file from Enlightenment.
This commit is contained in:
Derek Foreman 2017-01-18 10:45:22 -06:00
parent 2aa8b5acad
commit f162f47297
6 changed files with 34 additions and 177 deletions

2
.gitignore vendored
View File

@ -79,6 +79,8 @@ Session.vim
/src/bin/ecore_con/efl_net_proxy_helper
#Once all protocols are generated these will use wildcards
/src/lib/ecore_wl2/www-client-protocol.h
/src/lib/ecore_wl2/www-protocol.c
/src/lib/ecore_wl2/teamwork-client-protocol.h
/src/lib/ecore_wl2/teamwork-protocol.c
/src/lib/ecore_wl2/linux-dmabuf-unstable-v1-client-protocol.h

View File

@ -14,7 +14,7 @@ lib/ecore_wl2/session-recovery-client-protocol.h \
lib/ecore_wl2/session-recovery-protocol.c \
lib/ecore_wl2/xdg-shell-unstable-v5-client-protocol.h \
lib/ecore_wl2/xdg-shell-unstable-v5-protocol.c \
lib/ecore_wl2/www-protocol.h \
lib/ecore_wl2/www-client-protocol.h \
lib/ecore_wl2/www-protocol.c \
lib/ecore_wl2/linux-dmabuf-unstable-v1-protocol.c \
lib/ecore_wl2/linux-dmabuf-unstable-v1-client-protocol.h \
@ -36,6 +36,8 @@ lib_ecore_wl2_libecore_wl2_la_DEPENDENCIES = @ECORE_WL2_INTERNAL_LIBS@
lib_ecore_wl2_libecore_wl2_la_LDFLAGS = @EFL_LTLIBRARY_FLAGS@
BUILT_SOURCES += \
lib/ecore_wl2/www-client-protocol.h \
lib/ecore_wl2/www-protocol.c \
lib/ecore_wl2/teamwork-protocol.c \
lib/ecore_wl2/teamwork-client-protocol.h \
lib/ecore_wl2/xdg-shell-unstable-v6-client-protocol.h \

View File

@ -4,7 +4,7 @@
# include <unistd.h>
# include "Ecore_Wl2.h"
# include "Ecore_Input.h"
# include "www-protocol.h"
# include "www-client-protocol.h"
#define EFL_TEAMWORK_VERSION 2
# include "teamwork-client-protocol.h"

View File

@ -1,41 +0,0 @@
#include <stdlib.h>
#include <stdint.h>
#include "wayland-util.h"
extern const struct wl_interface wl_surface_interface;
extern const struct wl_interface www_surface_interface;
static const struct wl_interface *types[] = {
NULL,
NULL,
NULL,
&www_surface_interface,
&wl_surface_interface,
};
static const struct wl_message www_requests[] = {
{ "create", "no", types + 3 },
};
WL_EXPORT const struct wl_interface www_interface = {
"www", 1,
1, www_requests,
0, NULL,
};
static const struct wl_message www_surface_requests[] = {
{ "destroy", "", types + 0 },
};
static const struct wl_message www_surface_events[] = {
{ "status", "iiu", types + 0 },
{ "start_drag", "", types + 0 },
{ "end_drag", "", types + 0 },
};
WL_EXPORT const struct wl_interface www_surface_interface = {
"www_surface", 1,
1, www_surface_requests,
3, www_surface_events,
};

View File

@ -1,134 +0,0 @@
#ifndef ZWP_WWW_CLIENT_PROTOCOL_H
#define ZWP_WWW_CLIENT_PROTOCOL_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <stddef.h>
#include "wayland-client.h"
struct wl_client;
struct wl_resource;
struct wl_surface;
struct www;
struct www_surface;
extern const struct wl_interface www_interface;
extern const struct wl_interface www_surface_interface;
#define WWW_CREATE 0
#define WWW_CREATE_SINCE_VERSION 1
static inline void
www_set_user_data(struct www *www, void *user_data)
{
wl_proxy_set_user_data((struct wl_proxy *) www, user_data);
}
static inline void *
www_get_user_data(struct www *www)
{
return wl_proxy_get_user_data((struct wl_proxy *) www);
}
static inline uint32_t
www_get_version(struct www *www)
{
return wl_proxy_get_version((struct wl_proxy *) www);
}
static inline void
www_destroy(struct www *www)
{
wl_proxy_destroy((struct wl_proxy *) www);
}
static inline struct www_surface *
www_create(struct www *www, struct wl_surface *surface)
{
struct wl_proxy *id;
id = wl_proxy_marshal_constructor((struct wl_proxy *) www,
WWW_CREATE, &www_surface_interface, NULL, surface);
return (struct www_surface *) id;
}
struct www_surface_listener {
/**
* status - Status update on a www_surface
* @x_rel: (none)
* @y_rel: (none)
* @timestamp: (none)
*
*
*/
void (*status)(void *data,
struct www_surface *www_surface,
int32_t x_rel,
int32_t y_rel,
uint32_t timestamp);
/**
* start_drag - Drag has started
*
*
*/
void (*start_drag)(void *data,
struct www_surface *www_surface);
/**
* end_drag - Drag has ended
*
*
*/
void (*end_drag)(void *data,
struct www_surface *www_surface);
};
static inline int
www_surface_add_listener(struct www_surface *www_surface,
const struct www_surface_listener *listener, void *data)
{
return wl_proxy_add_listener((struct wl_proxy *) www_surface,
(void (**)(void)) listener, data);
}
#define WWW_SURFACE_DESTROY 0
#define WWW_SURFACE_DESTROY_SINCE_VERSION 1
static inline void
www_surface_set_user_data(struct www_surface *www_surface, void *user_data)
{
wl_proxy_set_user_data((struct wl_proxy *) www_surface, user_data);
}
static inline void *
www_surface_get_user_data(struct www_surface *www_surface)
{
return wl_proxy_get_user_data((struct wl_proxy *) www_surface);
}
static inline uint32_t
www_surface_get_version(struct www_surface *www_surface)
{
return wl_proxy_get_version((struct wl_proxy *) www_surface);
}
static inline void
www_surface_destroy(struct www_surface *www_surface)
{
wl_proxy_marshal((struct wl_proxy *) www_surface,
WWW_SURFACE_DESTROY);
wl_proxy_destroy((struct wl_proxy *) www_surface);
}
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,28 @@
<protocol name="zwp_www">
<interface name="www" version="1">
<request name="create">
<description summary="Create an object for WWW notifications">
</description>
<arg name="id" type="new_id" interface="www_surface"/>
<arg name="surface" type="object" interface="wl_surface"/>
</request>
</interface>
<interface name="www_surface" version="1">
<event name="status">
<description summary="Status update on a www_surface"></description>
<arg name="x_rel" type="int"/>
<arg name="y_rel" type="int"/>
<arg name="timestamp" type="uint"/>
</event>
<event name="start_drag">
<description summary="Drag has started"></description>
</event>
<event name="end_drag">
<description summary="Drag has ended"></description>
</event>
<request name="destroy" type="destructor">
<description summary="Destroy a www_surface">
</description>
</request>
</interface>
</protocol>