Signed-off-by: Derek Foreman <derekf@osg.samsung.com>devs/captainigloo/eglfs_rpi
parent
5c5dc3d9f8
commit
c70054174e
6 changed files with 222 additions and 0 deletions
@ -0,0 +1,41 @@ |
||||
#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, |
||||
}; |
||||
|
@ -0,0 +1,77 @@ |
||||
#ifndef ZWP_WWW_SERVER_PROTOCOL_H |
||||
#define ZWP_WWW_SERVER_PROTOCOL_H |
||||
|
||||
#ifdef __cplusplus |
||||
extern "C" { |
||||
#endif |
||||
|
||||
#include <stdint.h> |
||||
#include <stddef.h> |
||||
#include "wayland-server.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; |
||||
|
||||
struct www_interface { |
||||
/**
|
||||
* create - Create an object for WWW notifications |
||||
* @id: (none) |
||||
* @surface: (none) |
||||
* |
||||
*
|
||||
*/ |
||||
void (*create)(struct wl_client *client, |
||||
struct wl_resource *resource, |
||||
uint32_t id, |
||||
struct wl_resource *surface); |
||||
}; |
||||
|
||||
|
||||
struct www_surface_interface { |
||||
/**
|
||||
* destroy - Destroy a www_surface |
||||
* |
||||
*
|
||||
*/ |
||||
void (*destroy)(struct wl_client *client, |
||||
struct wl_resource *resource); |
||||
}; |
||||
|
||||
#define WWW_SURFACE_STATUS 0 |
||||
#define WWW_SURFACE_START_DRAG 1 |
||||
#define WWW_SURFACE_END_DRAG 2 |
||||
|
||||
#define WWW_SURFACE_STATUS_SINCE_VERSION 1 |
||||
#define WWW_SURFACE_START_DRAG_SINCE_VERSION 1 |
||||
#define WWW_SURFACE_END_DRAG_SINCE_VERSION 1 |
||||
|
||||
static inline void |
||||
www_surface_send_status(struct wl_resource *resource_, int32_t x_rel, int32_t y_rel, uint32_t timestamp) |
||||
{ |
||||
wl_resource_post_event(resource_, WWW_SURFACE_STATUS, x_rel, y_rel, timestamp); |
||||
} |
||||
|
||||
static inline void |
||||
www_surface_send_start_drag(struct wl_resource *resource_) |
||||
{ |
||||
wl_resource_post_event(resource_, WWW_SURFACE_START_DRAG); |
||||
} |
||||
|
||||
static inline void |
||||
www_surface_send_end_drag(struct wl_resource *resource_) |
||||
{ |
||||
wl_resource_post_event(resource_, WWW_SURFACE_END_DRAG); |
||||
} |
||||
|
||||
#ifdef __cplusplus |
||||
} |
||||
#endif |
||||
|
||||
#endif |
Loading…
Reference in new issue