aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/rootston/desktop.h3
-rw-r--r--include/rootston/input.h13
-rw-r--r--include/rootston/view.h4
-rw-r--r--include/wlr/types/wlr_surface.h49
-rw-r--r--include/wlr/xwayland.h3
5 files changed, 66 insertions, 6 deletions
diff --git a/include/rootston/desktop.h b/include/rootston/desktop.h
index 392b0271..91ac87b7 100644
--- a/include/rootston/desktop.h
+++ b/include/rootston/desktop.h
@@ -52,7 +52,8 @@ struct roots_desktop *desktop_create(struct roots_server *server,
void desktop_destroy(struct roots_desktop *desktop);
void view_destroy(struct roots_view *view);
-struct roots_view *view_at(struct roots_desktop *desktop, int x, int y);
+struct roots_view *view_at(struct roots_desktop *desktop, double lx, double ly,
+ struct wlr_surface **surface, double *sx, double *sy);
void view_activate(struct roots_view *view, bool activate);
void output_add_notify(struct wl_listener *listener, void *data);
diff --git a/include/rootston/input.h b/include/rootston/input.h
index aeab9c0d..ecd53f3b 100644
--- a/include/rootston/input.h
+++ b/include/rootston/input.h
@@ -53,6 +53,13 @@ enum roots_cursor_mode {
ROOTS_CURSOR_ROTATE = 3,
};
+enum roots_cursor_resize_edge {
+ ROOTS_CURSOR_RESIZE_EDGE_TOP = 1,
+ ROOTS_CURSOR_RESIZE_EDGE_BOTTOM = 2,
+ ROOTS_CURSOR_RESIZE_EDGE_LEFT = 4,
+ ROOTS_CURSOR_RESIZE_EDGE_RIGHT = 8,
+};
+
struct roots_input_event {
uint32_t serial;
struct wlr_cursor *cursor;
@@ -71,6 +78,8 @@ struct roots_input {
enum roots_cursor_mode mode;
struct roots_view *active_view;
int offs_x, offs_y;
+ int view_x, view_y, view_width, view_height;
+ uint32_t resize_edges;
// Ring buffer of input events that could trigger move/resize/rotate
int input_events_idx;
@@ -100,6 +109,8 @@ void pointer_add(struct wlr_input_device *device, struct roots_input *input);
void pointer_remove(struct wlr_input_device *device, struct roots_input *input);
void keyboard_add(struct wlr_input_device *device, struct roots_input *input);
void keyboard_remove(struct wlr_input_device *device, struct roots_input *input);
+void tablet_tool_add(struct wlr_input_device *device, struct roots_input *input);
+void tablet_tool_remove(struct wlr_input_device *device, struct roots_input *input);
void cursor_initialize(struct roots_input *input);
void cursor_load_config(struct roots_config *config,
@@ -110,5 +121,7 @@ const struct roots_input_event *get_input_event(struct roots_input *input,
uint32_t serial);
void view_begin_move(struct roots_input *input, struct wlr_cursor *cursor,
struct roots_view *view);
+void view_begin_resize(struct roots_input *input, struct wlr_cursor *cursor,
+ struct roots_view *view, uint32_t edges);
#endif
diff --git a/include/rootston/view.h b/include/rootston/view.h
index 2bd71104..39ff80db 100644
--- a/include/rootston/view.h
+++ b/include/rootston/view.h
@@ -61,11 +61,15 @@ struct roots_view {
// configure event from the xdg_shell
// If not then this should follow the typical type/impl pattern we use
// elsewhere
+ void (*get_size)(struct roots_view *view, struct wlr_box *box);
void (*get_input_bounds)(struct roots_view *view, struct wlr_box *box);
void (*activate)(struct roots_view *view, bool active);
+ void (*resize)(struct roots_view *view, uint32_t width, uint32_t height);
};
+void view_get_size(struct roots_view *view, struct wlr_box *box);
void view_get_input_bounds(struct roots_view *view, struct wlr_box *box);
void view_activate(struct roots_view *view, bool active);
+void view_resize(struct roots_view *view, uint32_t width, uint32_t height);
#endif
diff --git a/include/wlr/types/wlr_surface.h b/include/wlr/types/wlr_surface.h
index 87d421e3..ae278815 100644
--- a/include/wlr/types/wlr_surface.h
+++ b/include/wlr/types/wlr_surface.h
@@ -18,6 +18,8 @@ struct wlr_frame_callback {
#define WLR_SURFACE_INVALID_INPUT_REGION 16
#define WLR_SURFACE_INVALID_TRANSFORM 32
#define WLR_SURFACE_INVALID_SCALE 64
+#define WLR_SURFACE_INVALID_SUBSURFACE_POSITION 128
+#define WLR_SURFACE_INVALID_FRAME_CALLBACK_LIST 256
struct wlr_surface_state {
uint32_t invalid;
@@ -29,13 +31,36 @@ struct wlr_surface_state {
int32_t scale;
int width, height;
int buffer_width, buffer_height;
+
+ struct {
+ int32_t x, y;
+ } subsurface_position;
+
+ struct wl_list frame_callback_list; // wl_surface.frame
+};
+
+struct wlr_subsurface {
+ struct wl_resource *resource;
+ struct wlr_surface *surface;
+ struct wlr_surface *parent;
+
+ struct wlr_surface_state *cached;
+ bool has_cache;
+
+ bool synchronized;
+ bool reordered;
+
+ struct wl_list parent_link;
+ struct wl_list parent_pending_link;
+
+ struct wl_listener parent_destroy_listener;
};
struct wlr_surface {
struct wl_resource *resource;
struct wlr_renderer *renderer;
struct wlr_texture *texture;
- struct wlr_surface_state current, pending;
+ struct wlr_surface_state *current, *pending;
const char *role; // the lifetime-bound role or null
float buffer_to_surface_matrix[16];
@@ -47,11 +72,16 @@ struct wlr_surface {
struct wl_signal destroy;
} signals;
- struct wl_list frame_callback_list; // wl_surface.frame
-
- struct wl_listener compositor_listener; // destroy listener used by compositor
+ // destroy listener used by compositor
+ struct wl_listener compositor_listener;
void *compositor_data;
+ // subsurface properties
+ struct wlr_subsurface *subsurface;
+ struct wl_list subsurface_list; // wlr_subsurface::parent_link
+
+ // wlr_subsurface::parent_pending_link
+ struct wl_list subsurface_pending_list;
void *data;
};
@@ -80,4 +110,15 @@ void wlr_surface_get_matrix(struct wlr_surface *surface,
int wlr_surface_set_role(struct wlr_surface *surface, const char *role,
struct wl_resource *error_resource, uint32_t error_code);
+/**
+ * Create the subsurface implementation for this surface.
+ */
+void wlr_surface_make_subsurface(struct wlr_surface *surface,
+ struct wlr_surface *parent, uint32_t id);
+
+/**
+ * Get the top of the subsurface tree for this surface.
+ */
+struct wlr_surface *wlr_surface_get_main_surface(struct wlr_surface *surface);
+
#endif
diff --git a/include/wlr/xwayland.h b/include/wlr/xwayland.h
index 43133567..3525ff3b 100644
--- a/include/wlr/xwayland.h
+++ b/include/wlr/xwayland.h
@@ -81,7 +81,8 @@ struct wlr_xwayland *wlr_xwayland_create(struct wl_display *wl_display,
void wlr_xwayland_surface_activate(struct wlr_xwayland *wlr_xwayland,
struct wlr_xwayland_surface *surface);
void wlr_xwayland_surface_configure(struct wlr_xwayland *wlr_xwayland,
- struct wlr_xwayland_surface *surface);
+ 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);