aboutsummaryrefslogtreecommitdiff
path: root/include/wlr
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-04-05 15:04:49 -0400
committerDrew DeVault <sir@cmpwn.com>2018-04-05 15:04:49 -0400
commit6710de9878a07a185d28f9cec71e3f1b3d3407ab (patch)
treedec44173de7b133fbac0230ac2530af4c4ff0bc7 /include/wlr
parent41fccb8507bcc1b18cff0c785c5697f9f0bdceda (diff)
parent19b576734e75d65ed6e28b13131f20f6444cba48 (diff)
Merge branch 'master' into xwayland-dnd
Diffstat (limited to 'include/wlr')
-rw-r--r--include/wlr/backend.h2
-rw-r--r--include/wlr/types/wlr_compositor.h6
-rw-r--r--include/wlr/types/wlr_cursor.h2
-rw-r--r--include/wlr/types/wlr_input_inhibitor.h25
-rw-r--r--include/wlr/types/wlr_output.h7
-rw-r--r--include/wlr/types/wlr_output_layout.h7
-rw-r--r--include/wlr/types/wlr_seat.h3
-rw-r--r--include/wlr/types/wlr_surface.h22
-rw-r--r--include/wlr/types/wlr_wl_shell.h10
-rw-r--r--include/wlr/types/wlr_xdg_output.h32
-rw-r--r--include/wlr/types/wlr_xdg_shell.h12
-rw-r--r--include/wlr/types/wlr_xdg_shell_v6.h12
12 files changed, 111 insertions, 29 deletions
diff --git a/include/wlr/backend.h b/include/wlr/backend.h
index e3b14add..f5482e04 100644
--- a/include/wlr/backend.h
+++ b/include/wlr/backend.h
@@ -46,6 +46,4 @@ struct wlr_egl *wlr_backend_get_egl(struct wlr_backend *backend);
*/
struct wlr_renderer *wlr_backend_get_renderer(struct wlr_backend *backend);
-uint32_t usec_to_msec(uint64_t usec);
-
#endif
diff --git a/include/wlr/types/wlr_compositor.h b/include/wlr/types/wlr_compositor.h
index 11bfac71..922d7c0f 100644
--- a/include/wlr/types/wlr_compositor.h
+++ b/include/wlr/types/wlr_compositor.h
@@ -4,6 +4,8 @@
#include <wayland-server.h>
#include <wlr/render/wlr_renderer.h>
+struct wlr_surface;
+
struct wlr_compositor {
struct wl_global *wl_global;
struct wl_list wl_resources;
@@ -22,4 +24,8 @@ void wlr_compositor_destroy(struct wlr_compositor *wlr_compositor);
struct wlr_compositor *wlr_compositor_create(struct wl_display *display,
struct wlr_renderer *renderer);
+bool wlr_surface_is_subsurface(struct wlr_surface *surface);
+
+struct wlr_subsurface *wlr_subsurface_from_surface(struct wlr_surface *surface);
+
#endif
diff --git a/include/wlr/types/wlr_cursor.h b/include/wlr/types/wlr_cursor.h
index 0883f3ca..b764e6d2 100644
--- a/include/wlr/types/wlr_cursor.h
+++ b/include/wlr/types/wlr_cursor.h
@@ -54,6 +54,8 @@ struct wlr_cursor {
struct wl_signal tablet_tool_tip;
struct wl_signal tablet_tool_button;
} events;
+
+ void *data;
};
struct wlr_cursor *wlr_cursor_create();
diff --git a/include/wlr/types/wlr_input_inhibitor.h b/include/wlr/types/wlr_input_inhibitor.h
new file mode 100644
index 00000000..4416c18f
--- /dev/null
+++ b/include/wlr/types/wlr_input_inhibitor.h
@@ -0,0 +1,25 @@
+#ifndef WLR_TYPES_INPUT_INHIBITOR_H
+#define WLR_TYPES_INPUT_INHIBITOR_H
+#include <wayland-server.h>
+
+struct wlr_input_inhibit_manager {
+ struct wl_global *wl_global;
+ struct wl_client *active_client;
+ struct wl_resource *active_inhibitor;
+
+ struct wl_listener display_destroy;
+
+ struct {
+ struct wl_signal activate; // struct wlr_input_inhibit_manager *
+ struct wl_signal deactivate; // struct wlr_input_inhibit_manager *
+ } events;
+
+ void *data;
+};
+
+struct wlr_input_inhibit_manager *wlr_input_inhibit_manager_create(
+ struct wl_display *display);
+void wlr_input_inhibit_manager_destroy(
+ struct wlr_input_inhibit_manager *manager);
+
+#endif
diff --git a/include/wlr/types/wlr_output.h b/include/wlr/types/wlr_output.h
index b838a737..cc03452d 100644
--- a/include/wlr/types/wlr_output.h
+++ b/include/wlr/types/wlr_output.h
@@ -112,8 +112,15 @@ struct wlr_surface;
void wlr_output_enable(struct wlr_output *output, bool enable);
void wlr_output_create_global(struct wlr_output *output);
void wlr_output_destroy_global(struct wlr_output *output);
+/**
+ * Sets the output mode.
+ */
bool wlr_output_set_mode(struct wlr_output *output,
struct wlr_output_mode *mode);
+/**
+ * Sets a custom mode on the output. If modes are available, they are preferred.
+ * Setting `refresh` to zero lets the backend pick a preferred value.
+ */
bool wlr_output_set_custom_mode(struct wlr_output *output, int32_t width,
int32_t height, int32_t refresh);
void wlr_output_set_transform(struct wlr_output *output,
diff --git a/include/wlr/types/wlr_output_layout.h b/include/wlr/types/wlr_output_layout.h
index 3c150fc0..ccb2cd61 100644
--- a/include/wlr/types/wlr_output_layout.h
+++ b/include/wlr/types/wlr_output_layout.h
@@ -17,6 +17,8 @@ struct wlr_output_layout {
struct wl_signal change;
struct wl_signal destroy;
} events;
+
+ void *data;
};
struct wlr_output_layout_output_state;
@@ -32,6 +34,11 @@ struct wlr_output_layout_output {
} events;
};
+/**
+ * Creates a wlr_output_layout, which can be used to describing outputs in
+ * physical space relative to one another, and perform various useful operations
+ * on that state.
+ */
struct wlr_output_layout *wlr_output_layout_create();
void wlr_output_layout_destroy(struct wlr_output_layout *layout);
diff --git a/include/wlr/types/wlr_seat.h b/include/wlr/types/wlr_seat.h
index 34105cf0..ff907f97 100644
--- a/include/wlr/types/wlr_seat.h
+++ b/include/wlr/types/wlr_seat.h
@@ -537,6 +537,7 @@ bool wlr_seat_touch_has_grab(struct wlr_seat *seat);
*/
bool wlr_seat_validate_grab_serial(struct wlr_seat *seat, uint32_t serial);
-struct wlr_seat_client *wlr_seat_client_from_resource(struct wl_resource *resource);
+struct wlr_seat_client *wlr_seat_client_from_resource(
+ struct wl_resource *resource);
#endif
diff --git a/include/wlr/types/wlr_surface.h b/include/wlr/types/wlr_surface.h
index 4d03df73..380e5e03 100644
--- a/include/wlr/types/wlr_surface.h
+++ b/include/wlr/types/wlr_surface.h
@@ -122,20 +122,24 @@ 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.
+ * Get the root of the subsurface tree for this surface.
*/
-struct wlr_surface *wlr_surface_get_main_surface(struct wlr_surface *surface);
+struct wlr_surface *wlr_surface_get_root_surface(struct wlr_surface *surface);
/**
- * Find a subsurface within this surface at the surface-local coordinates.
- * Returns the surface and coordinates in the topmost surface coordinate system
- * or NULL if no subsurface is found at that location.
+ * Check if the surface accepts input events at the given surface-local
+ * coordinates. Does not check the surface's subsurfaces.
*/
-struct wlr_subsurface *wlr_surface_subsurface_at(struct wlr_surface *surface,
- double sx, double sy, double *sub_x, double *sub_y);
+bool wlr_surface_point_accepts_input(struct wlr_surface *surface,
+ double sx, double sy);
-bool wlr_surface_point_accepts_input(
- struct wlr_surface *surface, double sx, double sy);
+/**
+ * Find a surface in this surface's tree that accepts input events at the given
+ * surface-local coordinates. Returns the surface and coordinates in the leaf
+ * surface coordinate system or NULL if no surface is found at that location.
+ */
+struct wlr_surface *wlr_surface_surface_at(struct wlr_surface *surface,
+ double sx, double sy, double *sub_x, double *sub_y);
void wlr_surface_send_enter(struct wlr_surface *surface,
struct wlr_output *output);
diff --git a/include/wlr/types/wlr_wl_shell.h b/include/wlr/types/wlr_wl_shell.h
index 63b1a837..89e950c9 100644
--- a/include/wlr/types/wlr_wl_shell.h
+++ b/include/wlr/types/wlr_wl_shell.h
@@ -142,13 +142,13 @@ void wlr_wl_shell_surface_configure(struct wlr_wl_shell_surface *surface,
enum wl_shell_surface_resize edges, int32_t width, int32_t height);
/**
- * Find a popup within this surface at the surface-local coordinates. Returns
- * the popup and coordinates in the topmost surface coordinate system or NULL if
- * no popup is found at that location.
+ * Find a surface within this wl-shell surface tree at the given surface-local
+ * coordinates. Returns the surface and coordinates in the leaf surface
+ * coordinate system or NULL if no surface is found at that location.
*/
-struct wlr_wl_shell_surface *wlr_wl_shell_surface_popup_at(
+struct wlr_surface *wlr_wl_shell_surface_surface_at(
struct wlr_wl_shell_surface *surface, double sx, double sy,
- double *popup_sx, double *popup_sy);
+ double *sub_sx, double *sub_sy);
bool wlr_surface_is_wl_shell_surface(struct wlr_surface *surface);
diff --git a/include/wlr/types/wlr_xdg_output.h b/include/wlr/types/wlr_xdg_output.h
new file mode 100644
index 00000000..27dad2b8
--- /dev/null
+++ b/include/wlr/types/wlr_xdg_output.h
@@ -0,0 +1,32 @@
+#ifndef WLR_TYPES_WLR_XDG_OUTPUT_H
+#define WLR_TYPES_WLR_XDG_OUTPUT_H
+#include <wayland-server.h>
+#include <wlr/types/wlr_output_layout.h>
+
+struct wlr_xdg_output {
+ struct wl_list link;
+ struct wl_list resources;
+
+ struct wlr_xdg_output_manager *manager;
+ struct wlr_output_layout_output *layout_output;
+
+ struct wl_listener destroy;
+};
+
+struct wlr_xdg_output_manager {
+ struct wl_global *global;
+
+ struct wlr_output_layout *layout;
+
+ struct wl_list outputs;
+
+ struct wl_listener layout_add;
+ struct wl_listener layout_change;
+ struct wl_listener layout_destroy;
+};
+
+struct wlr_xdg_output_manager *wlr_xdg_output_manager_create(
+ struct wl_display *display, struct wlr_output_layout *layout);
+void wlr_xdg_output_manager_destroy(struct wlr_xdg_output_manager *manager);
+
+#endif
diff --git a/include/wlr/types/wlr_xdg_shell.h b/include/wlr/types/wlr_xdg_shell.h
index b779017f..29b54dba 100644
--- a/include/wlr/types/wlr_xdg_shell.h
+++ b/include/wlr/types/wlr_xdg_shell.h
@@ -215,19 +215,19 @@ uint32_t wlr_xdg_toplevel_set_resizing(struct wlr_xdg_surface *surface,
void wlr_xdg_surface_send_close(struct wlr_xdg_surface *surface);
/**
- * Compute the popup position in surface-local coordinates.
+ * Compute the popup position in its parent's surface-local coordinate system.
*/
void wlr_xdg_surface_popup_get_position(struct wlr_xdg_surface *surface,
double *popup_sx, double *popup_sy);
/**
- * Find a popup within this surface at the surface-local coordinates. Returns
- * the popup and coordinates in the topmost surface coordinate system or NULL if
- * no popup is found at that location.
+ * Find a surface within this xdg-surface tree at the given surface-local
+ * coordinates. Returns the surface and coordinates in the leaf surface
+ * coordinate system or NULL if no surface is found at that location.
*/
-struct wlr_xdg_surface *wlr_xdg_surface_popup_at(
+struct wlr_surface *wlr_xdg_surface_surface_at(
struct wlr_xdg_surface *surface, double sx, double sy,
- double *popup_sx, double *popup_sy);
+ double *sub_x, double *sub_y);
bool wlr_surface_is_xdg_surface(struct wlr_surface *surface);
diff --git a/include/wlr/types/wlr_xdg_shell_v6.h b/include/wlr/types/wlr_xdg_shell_v6.h
index 04c1f324..b646f3fe 100644
--- a/include/wlr/types/wlr_xdg_shell_v6.h
+++ b/include/wlr/types/wlr_xdg_shell_v6.h
@@ -233,19 +233,19 @@ uint32_t wlr_xdg_toplevel_v6_set_resizing(struct wlr_xdg_surface_v6 *surface,
void wlr_xdg_surface_v6_send_close(struct wlr_xdg_surface_v6 *surface);
/**
- * Compute the popup position in surface-local coordinates.
+ * Compute the popup position in its parent's surface-local coordinate system.
*/
void wlr_xdg_surface_v6_popup_get_position(struct wlr_xdg_surface_v6 *surface,
double *popup_sx, double *popup_sy);
/**
- * Find a popup within this surface at the surface-local coordinates. Returns
- * the popup and coordinates in the topmost surface coordinate system or NULL if
- * no popup is found at that location.
+ * Find a surface within this xdg-surface tree at the given surface-local
+ * coordinates. Returns the surface and coordinates in the leaf surface
+ * coordinate system or NULL if no surface is found at that location.
*/
-struct wlr_xdg_surface_v6 *wlr_xdg_surface_v6_popup_at(
+struct wlr_surface *wlr_xdg_surface_v6_surface_at(
struct wlr_xdg_surface_v6 *surface, double sx, double sy,
- double *popup_sx, double *popup_sy);
+ double *sub_x, double *sub_y);
/**
* Get the geometry for this positioner based on the anchor rect, gravity, and