forked from enlightenment/enlightenment
wl-desktop-shell: Update desktop shell module for new xdg shell protocol
Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
parent
c27ba8b8c2
commit
702e32ea2a
|
@ -4,16 +4,13 @@
|
||||||
|
|
||||||
#pragma GCC diagnostic push
|
#pragma GCC diagnostic push
|
||||||
#pragma GCC diagnostic ignored "-Wredundant-decls"
|
#pragma GCC diagnostic ignored "-Wredundant-decls"
|
||||||
extern const struct wl_interface xdg_surface_interface;
|
|
||||||
|
extern const struct wl_interface wl_output_interface;
|
||||||
|
extern const struct wl_interface wl_seat_interface;
|
||||||
extern const struct wl_interface wl_surface_interface;
|
extern const struct wl_interface wl_surface_interface;
|
||||||
extern const struct wl_interface xdg_popup_interface;
|
extern const struct wl_interface xdg_popup_interface;
|
||||||
extern const struct wl_interface wl_surface_interface;
|
extern const struct wl_interface xdg_surface_interface;
|
||||||
extern const struct wl_interface wl_surface_interface;
|
|
||||||
extern const struct wl_interface wl_seat_interface;
|
|
||||||
extern const struct wl_interface wl_surface_interface;
|
|
||||||
extern const struct wl_interface wl_seat_interface;
|
|
||||||
extern const struct wl_interface wl_seat_interface;
|
|
||||||
extern const struct wl_interface wl_output_interface;
|
|
||||||
#pragma GCC diagnostic pop
|
#pragma GCC diagnostic pop
|
||||||
|
|
||||||
static const struct wl_interface *types[] =
|
static const struct wl_interface *types[] =
|
||||||
|
@ -35,8 +32,12 @@ static const struct wl_interface *types[] =
|
||||||
&wl_surface_interface,
|
&wl_surface_interface,
|
||||||
&wl_seat_interface,
|
&wl_seat_interface,
|
||||||
NULL,
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
&wl_seat_interface,
|
&wl_seat_interface,
|
||||||
NULL,
|
NULL,
|
||||||
|
&wl_seat_interface,
|
||||||
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
&wl_output_interface,
|
&wl_output_interface,
|
||||||
};
|
};
|
||||||
|
@ -64,32 +65,32 @@ WL_EXPORT const struct wl_interface xdg_shell_interface =
|
||||||
static const struct wl_message xdg_surface_requests[] =
|
static const struct wl_message xdg_surface_requests[] =
|
||||||
{
|
{
|
||||||
{ "destroy", "", types + 0 },
|
{ "destroy", "", types + 0 },
|
||||||
{ "set_transient_for", "?o", types + 14 },
|
{ "set_parent", "?o", types + 14 },
|
||||||
{ "set_margin", "iiii", types + 0 },
|
|
||||||
{ "set_title", "s", types + 0 },
|
{ "set_title", "s", types + 0 },
|
||||||
{ "set_app_id", "s", types + 0 },
|
{ "set_app_id", "s", types + 0 },
|
||||||
{ "move", "ou", types + 15 },
|
{ "show_window_menu", "ouii", types + 15 },
|
||||||
{ "resize", "ouu", types + 17 },
|
{ "move", "ou", types + 19 },
|
||||||
{ "set_output", "?o", types + 20 },
|
{ "resize", "ouu", types + 21 },
|
||||||
{ "request_change_state", "uuu", types + 0 },
|
{ "ack_configure", "u", types + 0 },
|
||||||
{ "ack_change_state", "uuu", types + 0 },
|
{ "set_window_geometry", "iiii", types + 0 },
|
||||||
|
{ "set_maximized", "", types + 0 },
|
||||||
|
{ "unset_maximized", "", types + 0 },
|
||||||
|
{ "set_fullscreen", "?o", types + 24 },
|
||||||
|
{ "unset_fullscreen", "", types + 0 },
|
||||||
{ "set_minimized", "", types + 0 },
|
{ "set_minimized", "", types + 0 },
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct wl_message xdg_surface_events[] =
|
static const struct wl_message xdg_surface_events[] =
|
||||||
{
|
{
|
||||||
{ "configure", "ii", types + 0 },
|
{ "configure", "iiau", types + 0 },
|
||||||
{ "change_state", "uuu", types + 0 },
|
|
||||||
{ "activated", "", types + 0 },
|
|
||||||
{ "deactivated", "", types + 0 },
|
|
||||||
{ "close", "", types + 0 },
|
{ "close", "", types + 0 },
|
||||||
};
|
};
|
||||||
|
|
||||||
WL_EXPORT const struct wl_interface xdg_surface_interface =
|
WL_EXPORT const struct wl_interface xdg_surface_interface =
|
||||||
{
|
{
|
||||||
"xdg_surface", 1,
|
"xdg_surface", 1,
|
||||||
11, xdg_surface_requests,
|
14, xdg_surface_requests,
|
||||||
5, xdg_surface_events,
|
2, xdg_surface_events,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct wl_message xdg_popup_requests[] =
|
static const struct wl_message xdg_popup_requests[] =
|
||||||
|
|
|
@ -24,7 +24,7 @@ extern const struct wl_interface xdg_popup_interface;
|
||||||
# define XDG_SHELL_VERSION_ENUM
|
# define XDG_SHELL_VERSION_ENUM
|
||||||
enum xdg_shell_version
|
enum xdg_shell_version
|
||||||
{
|
{
|
||||||
XDG_SHELL_VERSION_CURRENT = 3,
|
XDG_SHELL_VERSION_CURRENT = 4,
|
||||||
};
|
};
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
@ -37,6 +37,8 @@ struct xdg_shell_interface
|
||||||
};
|
};
|
||||||
|
|
||||||
# define XDG_SHELL_PING 0
|
# define XDG_SHELL_PING 0
|
||||||
|
# define XDG_SHELL_PING_SINCE_VERSION 1
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
xdg_shell_send_ping(struct wl_resource *resource_, uint32_t serial)
|
xdg_shell_send_ping(struct wl_resource *resource_, uint32_t serial)
|
||||||
{
|
{
|
||||||
|
@ -65,54 +67,40 @@ enum xdg_surface_state
|
||||||
{
|
{
|
||||||
XDG_SURFACE_STATE_MAXIMIZED = 1,
|
XDG_SURFACE_STATE_MAXIMIZED = 1,
|
||||||
XDG_SURFACE_STATE_FULLSCREEN = 2,
|
XDG_SURFACE_STATE_FULLSCREEN = 2,
|
||||||
|
XDG_SURFACE_STATE_RESIZING = 3,
|
||||||
|
XDG_SURFACE_STATE_ACTIVATED = 4,
|
||||||
};
|
};
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
struct xdg_surface_interface
|
struct xdg_surface_interface
|
||||||
{
|
{
|
||||||
void (*destroy)(struct wl_client *client, struct wl_resource *resource);
|
void (*destroy)(struct wl_client *client, struct wl_resource *resource);
|
||||||
void (*transient_for_set)(struct wl_client *client, struct wl_resource *resource, struct wl_resource *parent_resource);
|
void (*parent_set)(struct wl_client *client, struct wl_resource *resource, struct wl_resource *parent_resource);
|
||||||
void (*margin_set)(struct wl_client *client, struct wl_resource *resource, int32_t l, int32_t r, int32_t t, int32_t b);
|
|
||||||
void (*title_set)(struct wl_client *client, struct wl_resource *resource, const char *title);
|
void (*title_set)(struct wl_client *client, struct wl_resource *resource, const char *title);
|
||||||
void (*app_id_set)(struct wl_client *client, struct wl_resource *resource, const char *id);
|
void (*app_id_set)(struct wl_client *client, struct wl_resource *resource, const char *id);
|
||||||
|
void (*window_menu_show)(struct wl_client *client, struct wl_resource *resource, struct wl_resource *seat, uint32_t serial, int32_t x, int32_t y);
|
||||||
void (*move)(struct wl_client *client, struct wl_resource *resource, struct wl_resource *seat_resource, uint32_t serial);
|
void (*move)(struct wl_client *client, struct wl_resource *resource, struct wl_resource *seat_resource, uint32_t serial);
|
||||||
void (*resize)(struct wl_client *client, struct wl_resource *resource, struct wl_resource *seat_resource, uint32_t serial, uint32_t edges);
|
void (*resize)(struct wl_client *client, struct wl_resource *resource, struct wl_resource *seat_resource, uint32_t serial, uint32_t edges);
|
||||||
void (*output_set)(struct wl_client *client, struct wl_resource *resource, struct wl_resource *output_resource);
|
void (*ack_configure)(struct wl_client *client, struct wl_resource *resource, uint32_t serial);
|
||||||
void (*state_change_request)(struct wl_client *client, struct wl_resource *resource, uint32_t state, uint32_t value, uint32_t serial);
|
void (*window_geometry_set)(struct wl_client *client, struct wl_resource *resource, int32_t x, int32_t y, int32_t w, int32_t h);
|
||||||
void (*state_change_acknowledge)(struct wl_client *client, struct wl_resource *resource, uint32_t state, uint32_t value, uint32_t serial);
|
void (*maximized_set)(struct wl_client *client, struct wl_resource *resource);
|
||||||
void (*minimize)(struct wl_client *client, struct wl_resource *resource);
|
void (*maximized_unset)(struct wl_client *client, struct wl_resource *resource);
|
||||||
|
void (*fullscreen_set)(struct wl_client *client, struct wl_resource *resource, struct wl_resource *output);
|
||||||
|
void (*fullscreen_unset)(struct wl_client *client, struct wl_resource *resource);
|
||||||
|
void (*minimized_set)(struct wl_client *client, struct wl_resource *resource);
|
||||||
};
|
};
|
||||||
|
|
||||||
# define XDG_SURFACE_CONFIGURE 0
|
# define XDG_SURFACE_CONFIGURE 0
|
||||||
# define XDG_SURFACE_CHANGE_STATE 1
|
# define XDG_SURFACE_CLOSE 1
|
||||||
# define XDG_SURFACE_ACTIVATED 2
|
# define XDG_SURFACE_CONFIGURE_SINCE_VERSION 1
|
||||||
# define XDG_SURFACE_DEACTIVATED 3
|
# define XDG_SURFACE_CLOSE_SINCE_VERSION 1
|
||||||
# define XDG_SURFACE_CLOSE 4
|
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
xdg_surface_send_configure(struct wl_resource *resource_, int32_t w, int32_t h)
|
xdg_surface_send_configure(struct wl_resource *resource_, int32_t w, int32_t h, struct wl_array *states, uint32_t serial)
|
||||||
{
|
{
|
||||||
wl_resource_post_event(resource_, XDG_SURFACE_CONFIGURE, w, h);
|
wl_resource_post_event(resource_, XDG_SURFACE_CONFIGURE, w, h, states, serial);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
|
||||||
xdg_surface_send_state_change(struct wl_resource *resource_, uint32_t state, uint32_t value, uint32_t serial)
|
|
||||||
{
|
|
||||||
wl_resource_post_event(resource_, XDG_SURFACE_CHANGE_STATE, state, value, serial);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void
|
|
||||||
xdg_surface_send_activated(struct wl_resource *resource_)
|
|
||||||
{
|
|
||||||
wl_resource_post_event(resource_, XDG_SURFACE_ACTIVATED);
|
|
||||||
};
|
|
||||||
|
|
||||||
static inline void
|
|
||||||
xdg_surface_send_deactivated(struct wl_resource *resource_)
|
|
||||||
{
|
|
||||||
wl_resource_post_event(resource_, XDG_SURFACE_DEACTIVATED);
|
|
||||||
};
|
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
xdg_surface_send_close(struct wl_resource *resource_)
|
xdg_surface_send_close(struct wl_resource *resource_)
|
||||||
{
|
{
|
||||||
|
@ -124,11 +112,13 @@ struct xdg_popup_interface
|
||||||
void (*destroy)(struct wl_client *client, struct wl_resource *resource);
|
void (*destroy)(struct wl_client *client, struct wl_resource *resource);
|
||||||
};
|
};
|
||||||
|
|
||||||
# define XDG_POPUP_DONE 0
|
# define XDG_POPUP_POPUP_DONE 0
|
||||||
|
# define XDG_POPUP_POPUP_DONE_SINCE_VERSION 1
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
xdg_popup_send_done(struct wl_resource *resource_, uint32_t serial)
|
xdg_popup_send_popup_done(struct wl_resource *resource_, uint32_t serial)
|
||||||
{
|
{
|
||||||
wl_resource_post_event(resource_, XDG_POPUP_DONE, serial);
|
wl_resource_post_event(resource_, XDG_POPUP_POPUP_DONE, serial);
|
||||||
};
|
};
|
||||||
|
|
||||||
# ifdef __cplusplus
|
# ifdef __cplusplus
|
||||||
|
|
Loading…
Reference in New Issue