summaryrefslogtreecommitdiff
path: root/src/toytoolkit/xdg-shell-client-protocol.h
diff options
context:
space:
mode:
authorManuel Bachmann <manuel.bachmann@open.eurogiciel.org>2014-11-19 15:23:07 +0100
committerManuel Bachmann <manuel.bachmann@open.eurogiciel.org>2014-11-19 15:23:48 +0100
commit9d65c22f3814f85b6365dd81a5768dcff0bf60a2 (patch)
tree4eb4e1573d38bdb3b243a92cdba3fbaa8d3394f2 /src/toytoolkit/xdg-shell-client-protocol.h
parente59ca4e385774bfd87df4c4e2d70c192bb7644b0 (diff)
downloadweston-common-9d65c22f3814f85b6365dd81a5768dcff0bf60a2.tar.gz
weston-common-9d65c22f3814f85b6365dd81a5768dcff0bf60a2.tar.bz2
weston-common-9d65c22f3814f85b6365dd81a5768dcff0bf60a2.zip
Adapt the XDG-Shell bits for Weston 1.6.0. Change-Id: Ia223a3e12891a14ff451f6db273f4bd6b5e21443 Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
Diffstat (limited to 'src/toytoolkit/xdg-shell-client-protocol.h')
-rw-r--r--src/toytoolkit/xdg-shell-client-protocol.h150
1 files changed, 71 insertions, 79 deletions
diff --git a/src/toytoolkit/xdg-shell-client-protocol.h b/src/toytoolkit/xdg-shell-client-protocol.h
index 6ae0d9d..66dc5d8 100644
--- a/src/toytoolkit/xdg-shell-client-protocol.h
+++ b/src/toytoolkit/xdg-shell-client-protocol.h
@@ -59,7 +59,7 @@ extern const struct wl_interface xdg_popup_interface;
* static_assert to ensure the protocol and implementation versions match.
*/
enum xdg_shell_version {
- XDG_SHELL_VERSION_CURRENT = 3,
+ XDG_SHELL_VERSION_CURRENT = 4,
};
#endif /* XDG_SHELL_VERSION_ENUM */
@@ -195,11 +195,13 @@ enum xdg_surface_resize_edge {
* xdg_surface_state - types of state on the surface
* @XDG_SURFACE_STATE_MAXIMIZED: the surface is maximized
* @XDG_SURFACE_STATE_FULLSCREEN: the surface is fullscreen
+ * @XDG_SURFACE_STATE_RESIZING: (none)
+ * @XDG_SURFACE_STATE_ACTIVATED: (none)
*
* The different state values used on the surface. This is designed for
- * state values like maximized, fullscreen. It is paired with the
- * request_change_state event to ensure that both the client and the
- * compositor setting the state can be synchronized.
+ * state values like maximized, fullscreen. It is paired with the configure
+ * event to ensure that both the client and the compositor setting the
+ * state can be synchronized.
*
* States set in this way are double-buffered. They will get applied on the
* next commit.
@@ -218,15 +220,14 @@ enum xdg_surface_resize_edge {
enum xdg_surface_state {
XDG_SURFACE_STATE_MAXIMIZED = 1,
XDG_SURFACE_STATE_FULLSCREEN = 2,
+ XDG_SURFACE_STATE_RESIZING = 3,
+ XDG_SURFACE_STATE_ACTIVATED = 4,
};
#endif /* XDG_SURFACE_STATE_ENUM */
/**
* xdg_surface - desktop-style metadata interface
- * @configure: suggest resize
- * @change_state: compositor wants to change a surface's state
- * @activated: surface was activated
- * @deactivated: surface was deactivated
+ * @configure: suggest a surface change
* @close: surface wants to be closed
*
* An interface that may be implemented by a wl_surface, for
@@ -242,66 +243,33 @@ enum xdg_surface_state {
*/
struct xdg_surface_listener {
/**
- * configure - suggest resize
+ * configure - suggest a surface change
* @width: (none)
* @height: (none)
+ * @states: (none)
+ * @serial: (none)
*
* The configure event asks the client to resize its surface.
*
- * The size is a hint, in the sense that the client is free to
- * ignore it if it doesn't resize, pick a smaller size (to satisfy
- * aspect ratio or resize in steps of NxM pixels).
+ * The width and height arguments specify a hint to the window
+ * about how its surface should be resized in window geometry
+ * coordinates. The states listed in the event specify how the
+ * width/height arguments should be interpreted.
*
- * The client is free to dismiss all but the last configure event
- * it received.
+ * A client should arrange a new surface, and then send a
+ * ack_configure request with the serial sent in this configure
+ * event before attaching a new surface.
*
- * The width and height arguments specify the size of the window in
- * surface local coordinates.
+ * If the client receives multiple configure events before it can
+ * respond to one, it is free to discard all but the last event it
+ * received.
*/
void (*configure)(void *data,
struct xdg_surface *xdg_surface,
int32_t width,
- int32_t height);
- /**
- * change_state - compositor wants to change a surface's state
- * @state_type: the state to set
- * @value: the value to change the state to
- * @serial: a serial for the compositor's own tracking
- *
- * This event tells the client to change a surface's state. The
- * client should respond with an ack_change_state request to the
- * compositor to guarantee that the compositor knows that the
- * client has seen it.
- */
- void (*change_state)(void *data,
- struct xdg_surface *xdg_surface,
- uint32_t state_type,
- uint32_t value,
- uint32_t serial);
- /**
- * activated - surface was activated
- *
- * The activated_set event is sent when this surface has been
- * activated, which means that the surface has user attention.
- * Window decorations should be updated accordingly. You should not
- * use this event for anything but the style of decorations you
- * display, use wl_keyboard.enter and wl_keyboard.leave for
- * determining keyboard focus.
- */
- void (*activated)(void *data,
- struct xdg_surface *xdg_surface);
- /**
- * deactivated - surface was deactivated
- *
- * The deactivate event is sent when this surface has been
- * deactivated, which means that the surface lost user attention.
- * Window decorations should be updated accordingly. You should not
- * use this event for anything but the style of decorations you
- * display, use wl_keyboard.enter and wl_keyboard.leave for
- * determining keyboard focus.
- */
- void (*deactivated)(void *data,
- struct xdg_surface *xdg_surface);
+ int32_t height,
+ struct wl_array *states,
+ uint32_t serial);
/**
* close - surface wants to be closed
*
@@ -327,16 +295,19 @@ xdg_surface_add_listener(struct xdg_surface *xdg_surface,
}
#define XDG_SURFACE_DESTROY 0
-#define XDG_SURFACE_SET_TRANSIENT_FOR 1
-#define XDG_SURFACE_SET_MARGIN 2
-#define XDG_SURFACE_SET_TITLE 3
-#define XDG_SURFACE_SET_APP_ID 4
+#define XDG_SURFACE_SET_PARENT 1
+#define XDG_SURFACE_SET_TITLE 2
+#define XDG_SURFACE_SET_APP_ID 3
+#define XDG_SURFACE_SHOW_WINDOW_MENU 4
#define XDG_SURFACE_MOVE 5
#define XDG_SURFACE_RESIZE 6
-#define XDG_SURFACE_SET_OUTPUT 7
-#define XDG_SURFACE_REQUEST_CHANGE_STATE 8
-#define XDG_SURFACE_ACK_CHANGE_STATE 9
-#define XDG_SURFACE_SET_MINIMIZED 10
+#define XDG_SURFACE_ACK_CONFIGURE 7
+#define XDG_SURFACE_SET_WINDOW_GEOMETRY 8
+#define XDG_SURFACE_SET_MAXIMIZED 9
+#define XDG_SURFACE_UNSET_MAXIMIZED 10
+#define XDG_SURFACE_SET_FULLSCREEN 11
+#define XDG_SURFACE_UNSET_FULLSCREEN 12
+#define XDG_SURFACE_SET_MINIMIZED 13
static inline void
xdg_surface_set_user_data(struct xdg_surface *xdg_surface, void *user_data)
@@ -360,31 +331,31 @@ xdg_surface_destroy(struct xdg_surface *xdg_surface)
}
static inline void
-xdg_surface_set_transient_for(struct xdg_surface *xdg_surface, struct wl_surface *parent)
+xdg_surface_set_parent(struct xdg_surface *xdg_surface, struct wl_surface *parent)
{
wl_proxy_marshal((struct wl_proxy *) xdg_surface,
- XDG_SURFACE_SET_TRANSIENT_FOR, parent);
+ XDG_SURFACE_SET_PARENT, parent);
}
static inline void
-xdg_surface_set_margin(struct xdg_surface *xdg_surface, int32_t left_margin, int32_t right_margin, int32_t top_margin, int32_t bottom_margin)
+xdg_surface_set_title(struct xdg_surface *xdg_surface, const char *title)
{
wl_proxy_marshal((struct wl_proxy *) xdg_surface,
- XDG_SURFACE_SET_MARGIN, left_margin, right_margin, top_margin, bottom_margin);
+ XDG_SURFACE_SET_TITLE, title);
}
static inline void
-xdg_surface_set_title(struct xdg_surface *xdg_surface, const char *title)
+xdg_surface_set_app_id(struct xdg_surface *xdg_surface, const char *app_id)
{
wl_proxy_marshal((struct wl_proxy *) xdg_surface,
- XDG_SURFACE_SET_TITLE, title);
+ XDG_SURFACE_SET_APP_ID, app_id);
}
static inline void
-xdg_surface_set_app_id(struct xdg_surface *xdg_surface, const char *app_id)
+xdg_surface_show_window_menu(struct xdg_surface *xdg_surface, struct wl_seat *seat, uint32_t serial, int32_t x, int32_t y)
{
wl_proxy_marshal((struct wl_proxy *) xdg_surface,
- XDG_SURFACE_SET_APP_ID, app_id);
+ XDG_SURFACE_SHOW_WINDOW_MENU, seat, serial, x, y);
}
static inline void
@@ -402,24 +373,45 @@ xdg_surface_resize(struct xdg_surface *xdg_surface, struct wl_seat *seat, uint32
}
static inline void
-xdg_surface_set_output(struct xdg_surface *xdg_surface, struct wl_output *output)
+xdg_surface_ack_configure(struct xdg_surface *xdg_surface, uint32_t serial)
+{
+ wl_proxy_marshal((struct wl_proxy *) xdg_surface,
+ XDG_SURFACE_ACK_CONFIGURE, serial);
+}
+
+static inline void
+xdg_surface_set_window_geometry(struct xdg_surface *xdg_surface, int32_t x, int32_t y, int32_t width, int32_t height)
+{
+ wl_proxy_marshal((struct wl_proxy *) xdg_surface,
+ XDG_SURFACE_SET_WINDOW_GEOMETRY, x, y, width, height);
+}
+
+static inline void
+xdg_surface_set_maximized(struct xdg_surface *xdg_surface)
+{
+ wl_proxy_marshal((struct wl_proxy *) xdg_surface,
+ XDG_SURFACE_SET_MAXIMIZED);
+}
+
+static inline void
+xdg_surface_unset_maximized(struct xdg_surface *xdg_surface)
{
wl_proxy_marshal((struct wl_proxy *) xdg_surface,
- XDG_SURFACE_SET_OUTPUT, output);
+ XDG_SURFACE_UNSET_MAXIMIZED);
}
static inline void
-xdg_surface_request_change_state(struct xdg_surface *xdg_surface, uint32_t state_type, uint32_t value, uint32_t serial)
+xdg_surface_set_fullscreen(struct xdg_surface *xdg_surface, struct wl_output *output)
{
wl_proxy_marshal((struct wl_proxy *) xdg_surface,
- XDG_SURFACE_REQUEST_CHANGE_STATE, state_type, value, serial);
+ XDG_SURFACE_SET_FULLSCREEN, output);
}
static inline void
-xdg_surface_ack_change_state(struct xdg_surface *xdg_surface, uint32_t state_type, uint32_t value, uint32_t serial)
+xdg_surface_unset_fullscreen(struct xdg_surface *xdg_surface)
{
wl_proxy_marshal((struct wl_proxy *) xdg_surface,
- XDG_SURFACE_ACK_CHANGE_STATE, state_type, value, serial);
+ XDG_SURFACE_UNSET_FULLSCREEN);
}
static inline void