Send status of setting window to clietnt
[platform/core/uifw/e-mod-tizen-eom.git] / protocol / eom-server-protocol.h
1 #ifndef WL_EOM_SERVER_PROTOCOL_H
2 #define WL_EOM_SERVER_PROTOCOL_H
3
4 #ifdef  __cplusplus
5 extern "C" {
6 #endif
7
8 #include <stdint.h>
9 #include <stddef.h>
10 #include "wayland-server.h"
11
12 struct wl_client;
13 struct wl_resource;
14
15 struct wl_eom;
16 struct wl_shell_surface;
17 struct xdg_surface;
18
19 extern const struct wl_interface wl_eom_interface;
20
21 #ifndef WL_EOM_ERROR_ENUM
22 #define WL_EOM_ERROR_ENUM
23 enum wl_eom_error {
24         WL_EOM_ERROR_NONE = 0,
25         WL_EOM_ERROR_NO_OUTPUT = 1,
26         WL_EOM_ERROR_NO_ATTRIBUTE = 2,
27         WL_EOM_ERROR_OUTPUT_OCCUPIED = 3,
28 };
29 #endif /* WL_EOM_ERROR_ENUM */
30
31 #ifndef WL_EOM_TYPE_ENUM
32 #define WL_EOM_TYPE_ENUM
33 /**
34  * wl_eom_type - connector type of the external output
35  * @WL_EOM_TYPE_NONE: none
36  * @WL_EOM_TYPE_VGA: VGA output connector type
37  * @WL_EOM_TYPE_DIVI: VGA output connector type
38  * @WL_EOM_TYPE_DIVD: VGA output connector type
39  * @WL_EOM_TYPE_DIVA: VGA output connector type
40  * @WL_EOM_TYPE_COMPOSITE: VGA output connector type
41  * @WL_EOM_TYPE_SVIDEO: VGA output connector type
42  * @WL_EOM_TYPE_LVDS: VGA output connector type
43  * @WL_EOM_TYPE_COMPONENT: VGA output connector type
44  * @WL_EOM_TYPE_9PINDIN: VGA output connector type
45  * @WL_EOM_TYPE_DISPLAYPORT: VGA output connector type
46  * @WL_EOM_TYPE_HDMIA: VGA output connector type
47  * @WL_EOM_TYPE_HDMIB: VGA output connector type
48  * @WL_EOM_TYPE_TV: VGA output connector type
49  * @WL_EOM_TYPE_EDP: VGA output connector type
50  * @WL_EOM_TYPE_VIRTUAL: VGA output connector type
51  * @WL_EOM_TYPE_DSI: VGA output connector type
52  *
53  * ***** TODO ******
54  */
55 enum wl_eom_type {
56         WL_EOM_TYPE_NONE = 0,
57         WL_EOM_TYPE_VGA = 1,
58         WL_EOM_TYPE_DIVI = 2,
59         WL_EOM_TYPE_DIVD = 3,
60         WL_EOM_TYPE_DIVA = 4,
61         WL_EOM_TYPE_COMPOSITE = 5,
62         WL_EOM_TYPE_SVIDEO = 6,
63         WL_EOM_TYPE_LVDS = 7,
64         WL_EOM_TYPE_COMPONENT = 8,
65         WL_EOM_TYPE_9PINDIN = 9,
66         WL_EOM_TYPE_DISPLAYPORT = 10,
67         WL_EOM_TYPE_HDMIA = 11,
68         WL_EOM_TYPE_HDMIB = 12,
69         WL_EOM_TYPE_TV = 13,
70         WL_EOM_TYPE_EDP = 14,
71         WL_EOM_TYPE_VIRTUAL = 15,
72         WL_EOM_TYPE_DSI = 16,
73 };
74 #endif /* WL_EOM_TYPE_ENUM */
75
76 #ifndef WL_EOM_STATUS_ENUM
77 #define WL_EOM_STATUS_ENUM
78 /**
79  * wl_eom_status - connection status of the external output
80  * @WL_EOM_STATUS_NONE: none
81  * @WL_EOM_STATUS_CONNECTION: output connected
82  * @WL_EOM_STATUS_DISCONNECTION: output disconnected
83  *
84  * ***** TODO ******
85  */
86 enum wl_eom_status {
87         WL_EOM_STATUS_NONE = 0,
88         WL_EOM_STATUS_CONNECTION = 1,
89         WL_EOM_STATUS_DISCONNECTION = 2,
90 };
91 #endif /* WL_EOM_STATUS_ENUM */
92
93 #ifndef WL_EOM_MODE_ENUM
94 #define WL_EOM_MODE_ENUM
95 /**
96  * wl_eom_mode - mode of the external output
97  * @WL_EOM_MODE_NONE: none
98  * @WL_EOM_MODE_MIRROR: mirror mode
99  * @WL_EOM_MODE_PRESENTATION: presentation mode
100  *
101  * ***** TODO ******
102  */
103 enum wl_eom_mode {
104         WL_EOM_MODE_NONE = 0,
105         WL_EOM_MODE_MIRROR = 1,
106         WL_EOM_MODE_PRESENTATION = 2,
107 };
108 #endif /* WL_EOM_MODE_ENUM */
109
110 #ifndef WL_EOM_ATTRIBUTE_ENUM
111 #define WL_EOM_ATTRIBUTE_ENUM
112 /**
113  * wl_eom_attribute - attribute of the external output
114  * @WL_EOM_ATTRIBUTE_NONE: none
115  * @WL_EOM_ATTRIBUTE_NORMAL: nomal attribute
116  * @WL_EOM_ATTRIBUTE_EXCLUSIVE_SHARED: exclusive shared attribute
117  * @WL_EOM_ATTRIBUTE_EXCLUSIVE: exclusive attribute
118  *
119  * ***** TODO ******
120  */
121 enum wl_eom_attribute {
122         WL_EOM_ATTRIBUTE_NONE = 0,
123         WL_EOM_ATTRIBUTE_NORMAL = 1,
124         WL_EOM_ATTRIBUTE_EXCLUSIVE_SHARED = 2,
125         WL_EOM_ATTRIBUTE_EXCLUSIVE = 3,
126 };
127 #endif /* WL_EOM_ATTRIBUTE_ENUM */
128
129 #ifndef WL_EOM_ATTRIBUTE_STATE_ENUM
130 #define WL_EOM_ATTRIBUTE_STATE_ENUM
131 /**
132  * wl_eom_attribute_state - state of the external output attribute
133  * @WL_EOM_ATTRIBUTE_STATE_NONE: none
134  * @WL_EOM_ATTRIBUTE_STATE_ACTIVE: attribute is active on the output
135  * @WL_EOM_ATTRIBUTE_STATE_INACTIVE: attribute is inactive on the output
136  * @WL_EOM_ATTRIBUTE_STATE_LOST: the connection of output is lost
137  *
138  * ***** TODO ******
139  */
140 enum wl_eom_attribute_state {
141         WL_EOM_ATTRIBUTE_STATE_NONE = 0,
142         WL_EOM_ATTRIBUTE_STATE_ACTIVE = 1,
143         WL_EOM_ATTRIBUTE_STATE_INACTIVE = 2,
144         WL_EOM_ATTRIBUTE_STATE_LOST = 3,
145 };
146 #endif /* WL_EOM_ATTRIBUTE_STATE_ENUM */
147
148 /**
149  * wl_eom - an interface to get the information of the external outputs
150  * @set_attribute: (none)
151  * @set_xdg_window: (none)
152  * @set_shell_window: (none)
153  * @get_output_info: (none)
154  *
155  * ***** TODO ******
156  */
157 struct wl_eom_interface {
158         /**
159          * set_attribute - (none)
160          * @output_id: (none)
161          * @attribute: (none)
162          */
163         void (*set_attribute)(struct wl_client *client,
164                               struct wl_resource *resource,
165                               uint32_t output_id,
166                               uint32_t attribute);
167         /**
168          * set_xdg_window - (none)
169          * @output_id: (none)
170          * @surface: (none)
171          */
172         void (*set_xdg_window)(struct wl_client *client,
173                                struct wl_resource *resource,
174                                uint32_t output_id,
175                                struct wl_resource *surface);
176         /**
177          * set_shell_window - (none)
178          * @output_id: (none)
179          * @surface: (none)
180          */
181         void (*set_shell_window)(struct wl_client *client,
182                                  struct wl_resource *resource,
183                                  uint32_t output_id,
184                                  struct wl_resource *surface);
185         /**
186          * get_output_info - (none)
187          * @output_id: (none)
188          */
189         void (*get_output_info)(struct wl_client *client,
190                                 struct wl_resource *resource,
191                                 uint32_t output_id);
192 };
193
194 #define WL_EOM_OUTPUT_COUNT     0
195 #define WL_EOM_OUTPUT_INFO      1
196 #define WL_EOM_OUTPUT_TYPE      2
197 #define WL_EOM_OUTPUT_MODE      3
198 #define WL_EOM_OUTPUT_ATTRIBUTE 4
199 #define WL_EOM_OUTPUT_SET_WINDOW        5
200
201 #define WL_EOM_OUTPUT_COUNT_SINCE_VERSION       1
202 #define WL_EOM_OUTPUT_INFO_SINCE_VERSION        1
203 #define WL_EOM_OUTPUT_TYPE_SINCE_VERSION        1
204 #define WL_EOM_OUTPUT_MODE_SINCE_VERSION        1
205 #define WL_EOM_OUTPUT_ATTRIBUTE_SINCE_VERSION   1
206 #define WL_EOM_OUTPUT_SET_WINDOW_SINCE_VERSION  1
207
208 static inline void
209 wl_eom_send_output_count(struct wl_resource *resource_, uint32_t count)
210 {
211         wl_resource_post_event(resource_, WL_EOM_OUTPUT_COUNT, count);
212 }
213
214 static inline void
215 wl_eom_send_output_info(struct wl_resource *resource_, uint32_t output_id, uint32_t type, uint32_t mode, uint32_t w, uint32_t h, uint32_t w_mm, uint32_t h_mm, uint32_t connection)
216 {
217         wl_resource_post_event(resource_, WL_EOM_OUTPUT_INFO, output_id, type, mode, w, h, w_mm, h_mm, connection);
218 }
219
220 static inline void
221 wl_eom_send_output_type(struct wl_resource *resource_, uint32_t output_id, uint32_t type, uint32_t status)
222 {
223         wl_resource_post_event(resource_, WL_EOM_OUTPUT_TYPE, output_id, type, status);
224 }
225
226 static inline void
227 wl_eom_send_output_mode(struct wl_resource *resource_, uint32_t output_id, uint32_t mode)
228 {
229         wl_resource_post_event(resource_, WL_EOM_OUTPUT_MODE, output_id, mode);
230 }
231
232 static inline void
233 wl_eom_send_output_attribute(struct wl_resource *resource_, uint32_t output_id, uint32_t attribute, uint32_t attribute_state, uint32_t error)
234 {
235         wl_resource_post_event(resource_, WL_EOM_OUTPUT_ATTRIBUTE, output_id, attribute, attribute_state, error);
236 }
237
238 static inline void
239 wl_eom_send_output_set_window(struct wl_resource *resource_, uint32_t output_id, uint32_t error)
240 {
241         wl_resource_post_event(resource_, WL_EOM_OUTPUT_SET_WINDOW, output_id, error);
242 }
243
244 #ifdef  __cplusplus
245 }
246 #endif
247
248 #endif