X11 backend: fix window behavior with multiple show() calls
[platform/upstream/libwlmessage.git] / toytoolkit / workspaces-client-protocol.h
1 #ifndef WORKSPACES_CLIENT_PROTOCOL_H
2 #define WORKSPACES_CLIENT_PROTOCOL_H
3
4 #ifdef  __cplusplus
5 extern "C" {
6 #endif
7
8 #include <stdint.h>
9 #include <stddef.h>
10 #include "wayland-client.h"
11
12 struct wl_client;
13 struct wl_resource;
14
15 struct workspace_manager;
16
17 extern const struct wl_interface workspace_manager_interface;
18
19 /**
20  * workspace_manager - workspaces manager
21  * @state: workspace state
22  *
23  * An interface for managing surfaces in workspaces.
24  */
25 struct workspace_manager_listener {
26         /**
27          * state - workspace state
28          * @current: (none)
29          * @count: (none)
30          *
31          * The current workspace state, such as current workspace and
32          * workspace count, has changed.
33          */
34         void (*state)(void *data,
35                       struct workspace_manager *workspace_manager,
36                       uint32_t current,
37                       uint32_t count);
38 };
39
40 static inline int
41 workspace_manager_add_listener(struct workspace_manager *workspace_manager,
42                                const struct workspace_manager_listener *listener, void *data)
43 {
44         return wl_proxy_add_listener((struct wl_proxy *) workspace_manager,
45                                      (void (**)(void)) listener, data);
46 }
47
48 #define WORKSPACE_MANAGER_MOVE_SURFACE  0
49
50 static inline void
51 workspace_manager_set_user_data(struct workspace_manager *workspace_manager, void *user_data)
52 {
53         wl_proxy_set_user_data((struct wl_proxy *) workspace_manager, user_data);
54 }
55
56 static inline void *
57 workspace_manager_get_user_data(struct workspace_manager *workspace_manager)
58 {
59         return wl_proxy_get_user_data((struct wl_proxy *) workspace_manager);
60 }
61
62 static inline void
63 workspace_manager_destroy(struct workspace_manager *workspace_manager)
64 {
65         wl_proxy_destroy((struct wl_proxy *) workspace_manager);
66 }
67
68 static inline void
69 workspace_manager_move_surface(struct workspace_manager *workspace_manager, struct wl_surface *surface, uint32_t workspace)
70 {
71         wl_proxy_marshal((struct wl_proxy *) workspace_manager,
72                          WORKSPACE_MANAGER_MOVE_SURFACE, surface, workspace);
73 }
74
75 #ifdef  __cplusplus
76 }
77 #endif
78
79 #endif