tizen 2.4 release
[framework/uifw/libeom.git] / src / wayland / protocol / xdg-shell-protocol.c
1 /*
2  * Copyright © 2008-2013 Kristian Høgsberg
3  * Copyright © 2013      Rafael Antognolli
4  * Copyright © 2013      Jasper St. Pierre
5  * Copyright © 2010-2013 Intel Corporation
6  *
7  * Permission to use, copy, modify, distribute, and sell this
8  * software and its documentation for any purpose is hereby granted
9  * without fee, provided that the above copyright notice appear in
10  * all copies and that both that copyright notice and this permission
11  * notice appear in supporting documentation, and that the name of
12  * the copyright holders not be used in advertising or publicity
13  * pertaining to distribution of the software without specific,
14  * written prior permission.  The copyright holders make no
15  * representations about the suitability of this software for any
16  * purpose.  It is provided "as is" without express or implied
17  * warranty.
18  *
19  * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
20  * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
21  * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
22  * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
23  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
24  * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
25  * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
26  * THIS SOFTWARE.
27  */
28
29 #include <stdlib.h>
30 #include <stdint.h>
31 #include "wayland-util.h"
32
33 extern const struct wl_interface wl_output_interface;
34 extern const struct wl_interface wl_seat_interface;
35 extern const struct wl_interface wl_surface_interface;
36 extern const struct wl_interface xdg_popup_interface;
37 extern const struct wl_interface xdg_surface_interface;
38
39 static const struct wl_interface *types[] = {
40         NULL,
41         NULL,
42         NULL,
43         NULL,
44         &xdg_surface_interface,
45         &wl_surface_interface,
46         &xdg_popup_interface,
47         &wl_surface_interface,
48         &wl_surface_interface,
49         &wl_seat_interface,
50         NULL,
51         NULL,
52         NULL,
53         NULL,
54         &wl_surface_interface,
55         &wl_seat_interface,
56         NULL,
57         NULL,
58         NULL,
59         &wl_seat_interface,
60         NULL,
61         &wl_seat_interface,
62         NULL,
63         NULL,
64         &wl_output_interface,
65 };
66
67 static const struct wl_message xdg_shell_requests[] = {
68         { "use_unstable_version", "i", types + 0 },
69         { "get_xdg_surface", "no", types + 4 },
70         { "get_xdg_popup", "nooouiiu", types + 6 },
71         { "pong", "u", types + 0 },
72 };
73
74 static const struct wl_message xdg_shell_events[] = {
75         { "ping", "u", types + 0 },
76 };
77
78 WL_EXPORT const struct wl_interface xdg_shell_interface = {
79         "xdg_shell", 1,
80         4, xdg_shell_requests,
81         1, xdg_shell_events,
82 };
83
84 static const struct wl_message xdg_surface_requests[] = {
85         { "destroy", "", types + 0 },
86         { "set_parent", "?o", types + 14 },
87         { "set_title", "s", types + 0 },
88         { "set_app_id", "s", types + 0 },
89         { "show_window_menu", "ouii", types + 15 },
90         { "move", "ou", types + 19 },
91         { "resize", "ouu", types + 21 },
92         { "ack_configure", "u", types + 0 },
93         { "set_window_geometry", "iiii", types + 0 },
94         { "set_maximized", "", types + 0 },
95         { "unset_maximized", "", types + 0 },
96         { "set_fullscreen", "?o", types + 24 },
97         { "unset_fullscreen", "", types + 0 },
98         { "set_minimized", "", types + 0 },
99 };
100
101 static const struct wl_message xdg_surface_events[] = {
102         { "configure", "iiau", types + 0 },
103         { "close", "", types + 0 },
104 };
105
106 WL_EXPORT const struct wl_interface xdg_surface_interface = {
107         "xdg_surface", 1,
108         14, xdg_surface_requests,
109         2, xdg_surface_events,
110 };
111
112 static const struct wl_message xdg_popup_requests[] = {
113         { "destroy", "", types + 0 },
114 };
115
116 static const struct wl_message xdg_popup_events[] = {
117         { "popup_done", "u", types + 0 },
118 };
119
120 WL_EXPORT const struct wl_interface xdg_popup_interface = {
121         "xdg_popup", 1,
122         1, xdg_popup_requests,
123         1, xdg_popup_events,
124 };
125