summaryrefslogtreecommitdiff
path: root/src/lib/ecore_wl2/teamwork_protocol.h
blob: 129aa2deb4c22a8846173facac179eb3f7111b25 (plain)
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
#ifndef TEAMWORK_CLIENT_PROTOCOL_H
#define TEAMWORK_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 zwp_teamwork;

extern const struct wl_interface zwp_teamwork_interface;

struct zwp_teamwork_listener {
	/**
	 * fetching_uri - (none)
	 * @surface: (none)
	 * @uri: (none)
	 */
	void (*fetching_uri)(void *data,
			     struct zwp_teamwork *zwp_teamwork,
			     struct wl_surface *surface,
			     const char *uri);
	/**
	 * completed_uri - (none)
	 * @surface: (none)
	 * @uri: (none)
	 * @valid: 1 if uri can be displayed, else 0
	 */
	void (*completed_uri)(void *data,
			      struct zwp_teamwork *zwp_teamwork,
			      struct wl_surface *surface,
			      const char *uri,
			      int32_t valid);
	/**
	 * fetch_info - (none)
	 * @surface: (none)
	 * @uri: (none)
	 * @progress: percentage of download
	 */
	void (*fetch_info)(void *data,
			   struct zwp_teamwork *zwp_teamwork,
			   struct wl_surface *surface,
			   const char *uri,
			   uint32_t progress);
};

static inline int
zwp_teamwork_add_listener(struct zwp_teamwork *zwp_teamwork,
			  const struct zwp_teamwork_listener *listener, void *data)
{
	return wl_proxy_add_listener((struct wl_proxy *) zwp_teamwork,
				     (void (**)(void)) listener, data);
}

#define ZWP_TEAMWORK_PRELOAD_URI	0
#define ZWP_TEAMWORK_ACTIVATE_URI	1
#define ZWP_TEAMWORK_DEACTIVATE_URI	2
#define ZWP_TEAMWORK_OPEN_URI	3

#define ZWP_TEAMWORK_PRELOAD_URI_SINCE_VERSION	1
#define ZWP_TEAMWORK_ACTIVATE_URI_SINCE_VERSION	1
#define ZWP_TEAMWORK_DEACTIVATE_URI_SINCE_VERSION	1
#define ZWP_TEAMWORK_OPEN_URI_SINCE_VERSION	1

static inline void
zwp_teamwork_set_user_data(struct zwp_teamwork *zwp_teamwork, void *user_data)
{
	wl_proxy_set_user_data((struct wl_proxy *) zwp_teamwork, user_data);
}

static inline void *
zwp_teamwork_get_user_data(struct zwp_teamwork *zwp_teamwork)
{
	return wl_proxy_get_user_data((struct wl_proxy *) zwp_teamwork);
}

static inline uint32_t
zwp_teamwork_get_version(struct zwp_teamwork *zwp_teamwork)
{
	return wl_proxy_get_version((struct wl_proxy *) zwp_teamwork);
}

static inline void
zwp_teamwork_destroy(struct zwp_teamwork *zwp_teamwork)
{
	wl_proxy_destroy((struct wl_proxy *) zwp_teamwork);
}

static inline void
zwp_teamwork_preload_uri(struct zwp_teamwork *zwp_teamwork, struct wl_surface *surface, const char *uri)
{
	wl_proxy_marshal((struct wl_proxy *) zwp_teamwork,
			 ZWP_TEAMWORK_PRELOAD_URI, surface, uri);
}

static inline void
zwp_teamwork_activate_uri(struct zwp_teamwork *zwp_teamwork, struct wl_surface *surface, const char *uri, wl_fixed_t x, wl_fixed_t y)
{
	wl_proxy_marshal((struct wl_proxy *) zwp_teamwork,
			 ZWP_TEAMWORK_ACTIVATE_URI, surface, uri, x, y);
}

static inline void
zwp_teamwork_deactivate_uri(struct zwp_teamwork *zwp_teamwork, struct wl_surface *surface, const char *uri)
{
	wl_proxy_marshal((struct wl_proxy *) zwp_teamwork,
			 ZWP_TEAMWORK_DEACTIVATE_URI, surface, uri);
}

static inline void
zwp_teamwork_open_uri(struct zwp_teamwork *zwp_teamwork, struct wl_surface *surface, const char *uri)
{
	wl_proxy_marshal((struct wl_proxy *) zwp_teamwork,
			 ZWP_TEAMWORK_OPEN_URI, surface, uri);
}

#ifdef  __cplusplus
}
#endif

#endif