aboutsummaryrefslogtreecommitdiff
path: root/include/wlr
diff options
context:
space:
mode:
authorTony Crisci <tony@dubstepdish.com>2017-12-08 09:22:44 -0500
committerTony Crisci <tony@dubstepdish.com>2017-12-08 09:22:44 -0500
commit35188834db182db43b407b58db167950fab05477 (patch)
tree4ce63cc7f7f01f1e7cf7fb0f6994c4306ae4cad2 /include/wlr
parente3542d879d50d6239ad4ca24b4d30520fef40a87 (diff)
parent381a646d2fbcb1b488e1551438444ac267f39138 (diff)
Merge branch 'master' into feature/xwm-selection
Diffstat (limited to 'include/wlr')
-rw-r--r--include/wlr/types/wlr_output.h11
-rw-r--r--include/wlr/types/wlr_server_decoration.h27
-rw-r--r--include/wlr/types/wlr_surface.h8
-rw-r--r--include/wlr/types/wlr_wl_shell.h11
-rw-r--r--include/wlr/types/wlr_xdg_shell_v6.h37
-rw-r--r--include/wlr/util/edges.h12
-rw-r--r--include/wlr/xcursor.h6
-rw-r--r--include/wlr/xwayland.h20
8 files changed, 94 insertions, 38 deletions
diff --git a/include/wlr/types/wlr_output.h b/include/wlr/types/wlr_output.h
index cf000019..895536e1 100644
--- a/include/wlr/types/wlr_output.h
+++ b/include/wlr/types/wlr_output.h
@@ -16,6 +16,7 @@ struct wlr_output_cursor {
struct wlr_output *output;
double x, y;
bool enabled;
+ bool visible;
uint32_t width, height;
int32_t hotspot_x, hotspot_y;
struct wl_list link;
@@ -64,6 +65,10 @@ struct wlr_output {
struct wl_signal destroy;
} events;
+ struct wlr_surface *fullscreen_surface;
+ struct wl_listener fullscreen_surface_commit;
+ struct wl_listener fullscreen_surface_destroy;
+
struct wl_list cursors; // wlr_output_cursor::link
struct wlr_output_cursor *hardware_cursor;
@@ -81,6 +86,7 @@ bool wlr_output_set_mode(struct wlr_output *output,
void wlr_output_transform(struct wlr_output *output,
enum wl_output_transform transform);
void wlr_output_set_position(struct wlr_output *output, int32_t lx, int32_t ly);
+void wlr_output_set_scale(struct wlr_output *output, uint32_t scale);
void wlr_output_destroy(struct wlr_output *output);
void wlr_output_effective_resolution(struct wlr_output *output,
int *width, int *height);
@@ -89,8 +95,13 @@ void wlr_output_swap_buffers(struct wlr_output *output);
void wlr_output_set_gamma(struct wlr_output *output,
uint32_t size, uint16_t *r, uint16_t *g, uint16_t *b);
uint32_t wlr_output_get_gamma_size(struct wlr_output *output);
+void wlr_output_set_fullscreen_surface(struct wlr_output *output,
+ struct wlr_surface *surface);
struct wlr_output_cursor *wlr_output_cursor_create(struct wlr_output *output);
+/**
+ * Sets the cursor image. The image must be already scaled for the output.
+ */
bool wlr_output_cursor_set_image(struct wlr_output_cursor *cursor,
const uint8_t *pixels, int32_t stride, uint32_t width, uint32_t height,
int32_t hotspot_x, int32_t hotspot_y);
diff --git a/include/wlr/types/wlr_server_decoration.h b/include/wlr/types/wlr_server_decoration.h
index b4cac5b7..474a9386 100644
--- a/include/wlr/types/wlr_server_decoration.h
+++ b/include/wlr/types/wlr_server_decoration.h
@@ -3,12 +3,35 @@
#include <wayland-server.h>
+/**
+ * Possible values to use in request_mode and the event mode. Same as
+ * org_kde_kwin_server_decoration_manager_mode.
+ */
+enum wlr_server_decoration_manager_mode {
+ /**
+ * Undecorated: The surface is not decorated at all, neither server nor
+ * client-side. An example is a popup surface which should not be
+ * decorated.
+ */
+ WLR_SERVER_DECORATION_MANAGER_MODE_NONE = 0,
+ /**
+ * Client-side decoration: The decoration is part of the surface and the
+ * client.
+ */
+ WLR_SERVER_DECORATION_MANAGER_MODE_CLIENT = 1,
+ /**
+ * Server-side decoration: The server embeds the surface into a decoration
+ * frame.
+ */
+ WLR_SERVER_DECORATION_MANAGER_MODE_SERVER = 2,
+};
+
struct wlr_server_decoration_manager {
struct wl_global *wl_global;
struct wl_list wl_resources;
struct wl_list decorations; // wlr_server_decoration::link
- uint32_t default_mode; // enum org_kde_kwin_server_decoration_manager_mode
+ uint32_t default_mode; // enum wlr_server_decoration_manager_mode
struct {
struct wl_signal new_decoration;
@@ -22,7 +45,7 @@ struct wlr_server_decoration {
struct wlr_surface *surface;
struct wl_list link;
- uint32_t mode; // enum org_kde_kwin_server_decoration_manager_mode
+ uint32_t mode; // enum wlr_server_decoration_manager_mode
struct {
struct wl_signal destroy;
diff --git a/include/wlr/types/wlr_surface.h b/include/wlr/types/wlr_surface.h
index cea53109..c8e3761a 100644
--- a/include/wlr/types/wlr_surface.h
+++ b/include/wlr/types/wlr_surface.h
@@ -1,9 +1,10 @@
#ifndef WLR_TYPES_WLR_SURFACE_H
#define WLR_TYPES_WLR_SURFACE_H
-#include <wayland-server.h>
-#include <pixman.h>
#include <stdint.h>
#include <stdbool.h>
+#include <time.h>
+#include <pixman.h>
+#include <wayland-server.h>
#include <wlr/types/wlr_output.h>
struct wlr_frame_callback {
@@ -142,4 +143,7 @@ void wlr_surface_send_enter(struct wlr_surface *surface,
void wlr_surface_send_leave(struct wlr_surface *surface,
struct wlr_output *output);
+void wlr_surface_send_frame_done(struct wlr_surface *surface,
+ const struct timespec *when);
+
#endif
diff --git a/include/wlr/types/wlr_wl_shell.h b/include/wlr/types/wlr_wl_shell.h
index 24936a34..986f92e8 100644
--- a/include/wlr/types/wlr_wl_shell.h
+++ b/include/wlr/types/wlr_wl_shell.h
@@ -77,12 +77,13 @@ struct wlr_wl_shell_surface {
struct {
struct wl_signal destroy;
+ struct wl_signal commit;
struct wl_signal ping_timeout;
struct wl_signal request_move;
struct wl_signal request_resize;
- struct wl_signal request_set_fullscreen;
- struct wl_signal request_set_maximized;
+ struct wl_signal request_fullscreen;
+ struct wl_signal request_maximize;
struct wl_signal set_state;
struct wl_signal set_title;
@@ -93,14 +94,12 @@ struct wlr_wl_shell_surface {
};
struct wlr_wl_shell_surface_move_event {
- struct wl_client *client;
struct wlr_wl_shell_surface *surface;
struct wlr_seat_client *seat;
uint32_t serial;
};
struct wlr_wl_shell_surface_resize_event {
- struct wl_client *client;
struct wlr_wl_shell_surface *surface;
struct wlr_seat_client *seat;
uint32_t serial;
@@ -108,15 +107,13 @@ struct wlr_wl_shell_surface_resize_event {
};
struct wlr_wl_shell_surface_set_fullscreen_event {
- struct wl_client *client;
struct wlr_wl_shell_surface *surface;
enum wl_shell_surface_fullscreen_method method;
uint32_t framerate;
struct wlr_output *output;
};
-struct wlr_wl_shell_surface_set_maximized_event {
- struct wl_client *client;
+struct wlr_wl_shell_surface_maximize_event {
struct wlr_wl_shell_surface *surface;
struct wlr_output *output;
};
diff --git a/include/wlr/types/wlr_xdg_shell_v6.h b/include/wlr/types/wlr_xdg_shell_v6.h
index e3982003..4eb957be 100644
--- a/include/wlr/types/wlr_xdg_shell_v6.h
+++ b/include/wlr/types/wlr_xdg_shell_v6.h
@@ -107,7 +107,9 @@ struct wlr_xdg_surface_v6 {
bool configured;
bool added;
+ uint32_t configure_serial;
struct wl_event_source *configure_idle;
+ uint32_t configure_next_serial;
struct wl_list configure_list;
char *title;
@@ -123,7 +125,6 @@ struct wlr_xdg_surface_v6 {
struct {
struct wl_signal commit;
struct wl_signal destroy;
- struct wl_signal ack_configure;
struct wl_signal ping_timeout;
struct wl_signal request_maximize;
@@ -138,27 +139,29 @@ struct wlr_xdg_surface_v6 {
};
struct wlr_xdg_toplevel_v6_move_event {
- struct wl_client *client;
struct wlr_xdg_surface_v6 *surface;
struct wlr_seat_client *seat;
uint32_t serial;
};
struct wlr_xdg_toplevel_v6_resize_event {
- struct wl_client *client;
struct wlr_xdg_surface_v6 *surface;
struct wlr_seat_client *seat;
uint32_t serial;
uint32_t edges;
};
+struct wlr_xdg_toplevel_v6_set_fullscreen_event {
+ struct wlr_xdg_surface_v6 *surface;
+ bool fullscreen;
+ struct wlr_output *output;
+};
+
struct wlr_xdg_toplevel_v6_show_window_menu_event {
- struct wl_client *client;
struct wlr_xdg_surface_v6 *surface;
struct wlr_seat_client *seat;
uint32_t serial;
- uint32_t x;
- uint32_t y;
+ uint32_t x, y;
};
struct wlr_xdg_shell_v6 *wlr_xdg_shell_v6_create(struct wl_display *display);
@@ -171,37 +174,38 @@ void wlr_xdg_shell_v6_destroy(struct wlr_xdg_shell_v6 *xdg_shell);
void wlr_xdg_surface_v6_ping(struct wlr_xdg_surface_v6 *surface);
/**
- * Request that this toplevel surface be the given size.
+ * Request that this toplevel surface be the given size. Returns the associated
+ * configure serial.
*/
-void wlr_xdg_toplevel_v6_set_size(struct wlr_xdg_surface_v6 *surface,
+uint32_t wlr_xdg_toplevel_v6_set_size(struct wlr_xdg_surface_v6 *surface,
uint32_t width, uint32_t height);
/**
* Request that this toplevel surface show itself in an activated or deactivated
- * state.
+ * state. Returns the associated configure serial.
*/
-void wlr_xdg_toplevel_v6_set_activated(struct wlr_xdg_surface_v6 *surface,
+uint32_t wlr_xdg_toplevel_v6_set_activated(struct wlr_xdg_surface_v6 *surface,
bool activated);
/**
* Request that this toplevel surface consider itself maximized or not
- * maximized.
+ * maximized. Returns the associated configure serial.
*/
-void wlr_xdg_toplevel_v6_set_maximized(struct wlr_xdg_surface_v6 *surface,
+uint32_t wlr_xdg_toplevel_v6_set_maximized(struct wlr_xdg_surface_v6 *surface,
bool maximized);
/**
* Request that this toplevel surface consider itself fullscreen or not
- * fullscreen.
+ * fullscreen. Returns the associated configure serial.
*/
-void wlr_xdg_toplevel_v6_set_fullscreen(struct wlr_xdg_surface_v6 *surface,
+uint32_t wlr_xdg_toplevel_v6_set_fullscreen(struct wlr_xdg_surface_v6 *surface,
bool fullscreen);
/**
* Request that this toplevel surface consider itself to be resizing or not
- * resizing.
+ * resizing. Returns the associated configure serial.
*/
-void wlr_xdg_toplevel_v6_set_resizing(struct wlr_xdg_surface_v6 *surface,
+uint32_t wlr_xdg_toplevel_v6_set_resizing(struct wlr_xdg_surface_v6 *surface,
bool resizing);
/**
@@ -223,4 +227,5 @@ void wlr_xdg_surface_v6_popup_get_position(struct wlr_xdg_surface_v6 *surface,
struct wlr_xdg_surface_v6 *wlr_xdg_surface_v6_popup_at(
struct wlr_xdg_surface_v6 *surface, double sx, double sy,
double *popup_sx, double *popup_sy);
+
#endif
diff --git a/include/wlr/util/edges.h b/include/wlr/util/edges.h
new file mode 100644
index 00000000..53268323
--- /dev/null
+++ b/include/wlr/util/edges.h
@@ -0,0 +1,12 @@
+#ifndef WLR_UTIL_EDGES_H
+#define WLR_UTIL_EDGES_H
+
+enum wlr_edges {
+ WLR_EDGE_NONE = 0,
+ WLR_EDGE_TOP = 1,
+ WLR_EDGE_BOTTOM = 2,
+ WLR_EDGE_LEFT = 4,
+ WLR_EDGE_RIGHT = 8,
+};
+
+#endif
diff --git a/include/wlr/xcursor.h b/include/wlr/xcursor.h
index b6362b06..42fcedb9 100644
--- a/include/wlr/xcursor.h
+++ b/include/wlr/xcursor.h
@@ -32,6 +32,7 @@
#define WLR_XCURSOR_H
#include <stdint.h>
+#include <wlr/util/edges.h>
struct wlr_xcursor_image {
uint32_t width; /* actual width */
@@ -65,4 +66,9 @@ struct wlr_xcursor *wlr_xcursor_theme_get_cursor(
int wlr_xcursor_frame(struct wlr_xcursor *cursor, uint32_t time);
+/**
+ * Get the name of the resize cursor image for the given edges.
+ */
+const char *wlr_xcursor_get_resize_name(enum wlr_edges edges);
+
#endif
diff --git a/include/wlr/xwayland.h b/include/wlr/xwayland.h
index 351c6cd1..523dda67 100644
--- a/include/wlr/xwayland.h
+++ b/include/wlr/xwayland.h
@@ -155,21 +155,19 @@ void wlr_xwayland_set_cursor(struct wlr_xwayland *wlr_xwayland,
uint8_t *pixels, uint32_t stride, uint32_t width, uint32_t height,
int32_t hotspot_x, int32_t hotspot_y);
-void wlr_xwayland_surface_activate(struct wlr_xwayland *wlr_xwayland,
- struct wlr_xwayland_surface *surface, bool activated);
+void wlr_xwayland_surface_activate(struct wlr_xwayland_surface *surface,
+ bool activated);
-void wlr_xwayland_surface_configure(struct wlr_xwayland *wlr_xwayland,
- struct wlr_xwayland_surface *surface, int16_t x, int16_t y,
- uint16_t width, uint16_t height);
+void wlr_xwayland_surface_configure(struct wlr_xwayland_surface *surface,
+ int16_t x, int16_t y, uint16_t width, uint16_t height);
-void wlr_xwayland_surface_close(struct wlr_xwayland *wlr_xwayland,
- struct wlr_xwayland_surface *surface);
+void wlr_xwayland_surface_close(struct wlr_xwayland_surface *surface);
-void wlr_xwayland_surface_set_maximized(struct wlr_xwayland *wlr_xwayland,
- struct wlr_xwayland_surface *surface, bool maximized);
+void wlr_xwayland_surface_set_maximized(struct wlr_xwayland_surface *surface,
+ bool maximized);
-void wlr_xwayland_surface_set_fullscreen(struct wlr_xwayland *wlr_xwayland,
- struct wlr_xwayland_surface *surface, bool fullscreen);
+void wlr_xwayland_surface_set_fullscreen(struct wlr_xwayland_surface *surface,
+ bool fullscreen);
void wlr_xwayland_set_seat(struct wlr_xwayland *xwayland,
struct wlr_seat *seat);