Package version up to 0.8.8
[platform/core/uifw/wayland-tbm.git] / test / wayland-tbm-test-server-protocol.h
1 /*
2  * Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
3  *
4  * Permission to use, copy, modify, distribute, and sell this
5  * software and its documentation for any purpose is hereby granted
6  * without fee, provided that\n the above copyright notice appear in
7  * all copies and that both that copyright notice and this permission
8  * notice appear in supporting documentation, and that the name of
9  * the copyright holders not be used in advertising or publicity
10  * pertaining to distribution of the software without specific,
11  * written prior permission.  The copyright holders make no
12  * representations about the suitability of this software for any
13  * purpose.  It is provided "as is" without express or implied
14  * warranty.
15  *
16  * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
17  * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
18  * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
19  * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
20  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
21  * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
22  * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
23  * THIS SOFTWARE.
24  */
25
26 #ifndef TBM_TEST_SERVER_PROTOCOL_H
27 #define TBM_TEST_SERVER_PROTOCOL_H
28
29 #ifdef  __cplusplus
30 extern "C" {
31 #endif
32
33 #include <stdint.h>
34 #include <stddef.h>
35 #include "wayland-server.h"
36
37 struct wl_client;
38 struct wl_resource;
39
40 struct wl_buffer;
41 struct wl_callback;
42 struct wl_tbm;
43 struct wl_tbm_test;
44 struct wl_test_remote;
45 struct wl_test_surface;
46
47 extern const struct wl_interface wl_tbm_test_interface;
48 extern const struct wl_interface wl_test_surface_interface;
49 extern const struct wl_interface wl_test_remote_interface;
50
51 struct wl_tbm_test_interface {
52         /**
53          * create_surface - (none)
54          * @surface: (none)
55          */
56         void (*create_surface)(struct wl_client *client,
57                                struct wl_resource *resource,
58                                uint32_t surface);
59         /**
60          * set_active_queue - (none)
61          * @surface: (none)
62          */
63         void (*set_active_queue)(struct wl_client *client,
64                                  struct wl_resource *resource,
65                                  struct wl_resource *surface);
66         /**
67          * set_provider - (none)
68          * @surface: (none)
69          * @name: (none)
70          */
71         void (*set_provider)(struct wl_client *client,
72                              struct wl_resource *resource,
73                              struct wl_resource *surface,
74                              const char *name);
75         /**
76          * create_remote_surface - (none)
77          * @surface: (none)
78          * @name: (none)
79          */
80         void (*create_remote_surface)(struct wl_client *client,
81                                       struct wl_resource *resource,
82                                       uint32_t surface,
83                                       const char *name);
84 };
85
86
87 struct wl_test_surface_interface {
88         /**
89          * destroy - (none)
90          */
91         void (*destroy)(struct wl_client *client,
92                         struct wl_resource *resource);
93         /**
94          * attach - (none)
95          * @buffer: (none)
96          */
97         void (*attach)(struct wl_client *client,
98                        struct wl_resource *resource,
99                        struct wl_resource *buffer);
100         /**
101          * frame - (none)
102          * @callback: (none)
103          */
104         void (*frame)(struct wl_client *client,
105                       struct wl_resource *resource,
106                       uint32_t callback);
107 };
108
109
110 struct wl_test_remote_interface {
111         /**
112          * destroy - (none)
113          */
114         void (*destroy)(struct wl_client *client,
115                         struct wl_resource *resource);
116         /**
117          * release - (none)
118          * @buffer: (none)
119          */
120         void (*release)(struct wl_client *client,
121                         struct wl_resource *resource,
122                         struct wl_resource *buffer);
123         /**
124          * redirect - (none)
125          * @wl_tbm: (none)
126          */
127         void (*redirect)(struct wl_client *client,
128                          struct wl_resource *resource,
129                          struct wl_resource *wl_tbm);
130         /**
131          * unredirect - (none)
132          */
133         void (*unredirect)(struct wl_client *client,
134                            struct wl_resource *resource);
135         /**
136          * bind - (none)
137          * @surface: (none)
138          */
139         void (*bind)(struct wl_client *client,
140                      struct wl_resource *resource,
141                      struct wl_resource *surface);
142 };
143
144 #define WL_TEST_REMOTE_UPDATE   0
145
146 #define WL_TEST_REMOTE_UPDATE_SINCE_VERSION     1
147
148 static inline void
149 wl_test_remote_send_update(struct wl_resource *resource_, struct wl_resource *buffer)
150 {
151         wl_resource_post_event(resource_, WL_TEST_REMOTE_UPDATE, buffer);
152 }
153
154 #ifdef  __cplusplus
155 }
156 #endif
157
158 #endif