summaryrefslogtreecommitdiff
path: root/src/lib/ecore_wl2/www-protocol.h
blob: b7d553d795d19b066cb4ee0e8889fa0aab44f270 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
#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