summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLibravatar emersion <contact@emersion.fr>2018-05-23 22:54:52 +0100
committerLibravatar emersion <contact@emersion.fr>2018-05-23 22:54:52 +0100
commitcd0fca2ebf81c252b3743c4474a5fdbcd3e2afad (patch)
tree595f1e80551b64de0d4e24f5721bae27acc195d9 /include
parentFix output hotplugging (diff)
parentMerge pull request #2022 from RedSoxFan/ipc-get-marks (diff)
downloadsway-cd0fca2ebf81c252b3743c4474a5fdbcd3e2afad.tar.gz
sway-cd0fca2ebf81c252b3743c4474a5fdbcd3e2afad.tar.zst
sway-cd0fca2ebf81c252b3743c4474a5fdbcd3e2afad.zip
Merge branch 'master' into fix-swaylock-hotplugging
Diffstat (limited to 'include')
-rw-r--r--include/sway/input/cursor.h3
-rw-r--r--include/sway/input/seat.h6
-rw-r--r--include/sway/tree/container.h15
-rw-r--r--include/sway/tree/view.h6
-rw-r--r--include/swaylock/swaylock.h26
5 files changed, 47 insertions, 9 deletions
diff --git a/include/sway/input/cursor.h b/include/sway/input/cursor.h
index 20c1c903..42c894a4 100644
--- a/include/sway/input/cursor.h
+++ b/include/sway/input/cursor.h
@@ -29,7 +29,8 @@ struct sway_cursor {
29 29
30void sway_cursor_destroy(struct sway_cursor *cursor); 30void sway_cursor_destroy(struct sway_cursor *cursor);
31struct sway_cursor *sway_cursor_create(struct sway_seat *seat); 31struct sway_cursor *sway_cursor_create(struct sway_seat *seat);
32void cursor_send_pointer_motion(struct sway_cursor *cursor, uint32_t time_msec); 32void cursor_send_pointer_motion(struct sway_cursor *cursor, uint32_t time_msec,
33 bool allow_refocusing);
33void dispatch_cursor_button(struct sway_cursor *cursor, uint32_t time_msec, 34void dispatch_cursor_button(struct sway_cursor *cursor, uint32_t time_msec,
34 uint32_t button, enum wlr_button_state state); 35 uint32_t button, enum wlr_button_state state);
35 36
diff --git a/include/sway/input/seat.h b/include/sway/input/seat.h
index ff76841e..2e4da438 100644
--- a/include/sway/input/seat.h
+++ b/include/sway/input/seat.h
@@ -95,6 +95,12 @@ struct sway_container *seat_get_focus_inactive_view(struct sway_seat *seat,
95 struct sway_container *container); 95 struct sway_container *container);
96 96
97/** 97/**
98 * Return the immediate child of container which was most recently focused.
99 */
100struct sway_container *seat_get_active_child(struct sway_seat *seat,
101 struct sway_container *container);
102
103/**
98 * Iterate over the focus-inactive children of the container calling the 104 * Iterate over the focus-inactive children of the container calling the
99 * function on each. 105 * function on each.
100 */ 106 */
diff --git a/include/sway/tree/container.h b/include/sway/tree/container.h
index ec9e2385..493c70e2 100644
--- a/include/sway/tree/container.h
+++ b/include/sway/tree/container.h
@@ -11,6 +11,12 @@ extern struct sway_container root_container;
11struct sway_view; 11struct sway_view;
12struct sway_seat; 12struct sway_seat;
13 13
14#define TITLEBAR_BORDER_THICKNESS 1
15
16// Padding includes titlebar border
17#define TITLEBAR_H_PADDING 3
18#define TITLEBAR_V_PADDING 4
19
14/** 20/**
15 * Different kinds of containers. 21 * Different kinds of containers.
16 * 22 *
@@ -98,6 +104,8 @@ struct sway_container {
98 // Passed the previous parent 104 // Passed the previous parent
99 struct wl_signal reparent; 105 struct wl_signal reparent;
100 } events; 106 } events;
107
108 struct wl_listener reparent;
101}; 109};
102 110
103struct sway_container *container_create(enum sway_container_type type); 111struct sway_container *container_create(enum sway_container_type type);
@@ -160,7 +168,7 @@ struct sway_container *container_parent(struct sway_container *container,
160 * is a view and the view contains a surface at those coordinates. 168 * is a view and the view contains a surface at those coordinates.
161 */ 169 */
162struct sway_container *container_at(struct sway_container *container, 170struct sway_container *container_at(struct sway_container *container,
163 double lx, double ly, struct wlr_surface **surface, 171 double ox, double oy, struct wlr_surface **surface,
164 double *sx, double *sy); 172 double *sx, double *sy);
165 173
166/** 174/**
@@ -210,4 +218,9 @@ void container_calculate_title_height(struct sway_container *container);
210 218
211void container_notify_child_title_changed(struct sway_container *container); 219void container_notify_child_title_changed(struct sway_container *container);
212 220
221/**
222 * Return the height of a regular title bar.
223 */
224size_t container_titlebar_height(void);
225
213#endif 226#endif
diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h
index 951912d0..0fb8f1b3 100644
--- a/include/sway/tree/view.h
+++ b/include/sway/tree/view.h
@@ -274,4 +274,10 @@ bool view_has_mark(struct sway_view *view, char *mark);
274 274
275void view_update_marks_textures(struct sway_view *view); 275void view_update_marks_textures(struct sway_view *view);
276 276
277/**
278 * Returns true if there's a possibility the view may be rendered on screen.
279 * Intended for damage tracking.
280 */
281bool view_is_visible(struct sway_view *view);
282
277#endif 283#endif
diff --git a/include/swaylock/swaylock.h b/include/swaylock/swaylock.h
index 56ec0afb..27db67cd 100644
--- a/include/swaylock/swaylock.h
+++ b/include/swaylock/swaylock.h
@@ -10,13 +10,13 @@
10#include "wlr-layer-shell-unstable-v1-client-protocol.h" 10#include "wlr-layer-shell-unstable-v1-client-protocol.h"
11 11
12enum auth_state { 12enum auth_state {
13 AUTH_STATE_IDLE, 13 AUTH_STATE_IDLE,
14 AUTH_STATE_CLEAR, 14 AUTH_STATE_CLEAR,
15 AUTH_STATE_INPUT, 15 AUTH_STATE_INPUT,
16 AUTH_STATE_INPUT_NOP, 16 AUTH_STATE_INPUT_NOP,
17 AUTH_STATE_BACKSPACE, 17 AUTH_STATE_BACKSPACE,
18 AUTH_STATE_VALIDATING, 18 AUTH_STATE_VALIDATING,
19 AUTH_STATE_INVALID, 19 AUTH_STATE_INVALID,
20}; 20};
21 21
22struct swaylock_args { 22struct swaylock_args {
@@ -37,12 +37,14 @@ struct swaylock_state {
37 struct zwlr_input_inhibit_manager_v1 *input_inhibit_manager; 37 struct zwlr_input_inhibit_manager_v1 *input_inhibit_manager;
38 struct wl_shm *shm; 38 struct wl_shm *shm;
39 struct wl_list surfaces; 39 struct wl_list surfaces;
40 struct wl_list images;
40 struct swaylock_args args; 41 struct swaylock_args args;
41 cairo_surface_t *background_image; 42 cairo_surface_t *background_image;
42 struct swaylock_password password; 43 struct swaylock_password password;
43 struct swaylock_xkb xkb; 44 struct swaylock_xkb xkb;
44 enum auth_state auth_state; 45 enum auth_state auth_state;
45 bool run_display; 46 bool run_display;
47 struct zxdg_output_manager_v1 *zxdg_output_manager;
46}; 48};
47 49
48struct swaylock_surface { 50struct swaylock_surface {
@@ -50,12 +52,22 @@ struct swaylock_surface {
50 struct swaylock_state *state; 52 struct swaylock_state *state;
51 struct wl_output *output; 53 struct wl_output *output;
52 uint32_t output_global_name; 54 uint32_t output_global_name;
55 struct zxdg_output_v1 *xdg_output;
53 struct wl_surface *surface; 56 struct wl_surface *surface;
54 struct zwlr_layer_surface_v1 *layer_surface; 57 struct zwlr_layer_surface_v1 *layer_surface;
55 struct pool_buffer buffers[2]; 58 struct pool_buffer buffers[2];
56 struct pool_buffer *current_buffer; 59 struct pool_buffer *current_buffer;
57 uint32_t width, height; 60 uint32_t width, height;
58 int32_t scale; 61 int32_t scale;
62 char *output_name;
63 struct wl_list link;
64};
65
66// There is exactly one swaylock_image for each -i argument
67struct swaylock_image {
68 char *path;
69 char *output_name;
70 cairo_surface_t *cairo_surface;
59 struct wl_list link; 71 struct wl_list link;
60}; 72};
61 73