diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/sway/commands.h | 2 | ||||
-rw-r--r-- | include/sway/config.h | 2 | ||||
-rw-r--r-- | include/sway/input/cursor.h | 6 | ||||
-rw-r--r-- | include/sway/input/input-manager.h | 4 | ||||
-rw-r--r-- | include/sway/input/seat.h | 86 | ||||
-rw-r--r-- | include/sway/output.h | 8 | ||||
-rw-r--r-- | include/sway/tree/container.h | 2 | ||||
-rw-r--r-- | include/swaybar/bar.h | 1 | ||||
-rw-r--r-- | include/swaybar/config.h | 2 | ||||
-rw-r--r-- | include/swaylock/swaylock.h | 5 |
10 files changed, 86 insertions, 32 deletions
diff --git a/include/sway/commands.h b/include/sway/commands.h index 7d0ff838..04f93ba9 100644 --- a/include/sway/commands.h +++ b/include/sway/commands.h | |||
@@ -198,6 +198,8 @@ sway_cmd bar_cmd_id; | |||
198 | sway_cmd bar_cmd_position; | 198 | sway_cmd bar_cmd_position; |
199 | sway_cmd bar_cmd_separator_symbol; | 199 | sway_cmd bar_cmd_separator_symbol; |
200 | sway_cmd bar_cmd_status_command; | 200 | sway_cmd bar_cmd_status_command; |
201 | sway_cmd bar_cmd_status_edge_padding; | ||
202 | sway_cmd bar_cmd_status_padding; | ||
201 | sway_cmd bar_cmd_pango_markup; | 203 | sway_cmd bar_cmd_pango_markup; |
202 | sway_cmd bar_cmd_strip_workspace_numbers; | 204 | sway_cmd bar_cmd_strip_workspace_numbers; |
203 | sway_cmd bar_cmd_strip_workspace_name; | 205 | sway_cmd bar_cmd_strip_workspace_name; |
diff --git a/include/sway/config.h b/include/sway/config.h index 29c21afe..a667984d 100644 --- a/include/sway/config.h +++ b/include/sway/config.h | |||
@@ -232,6 +232,8 @@ struct bar_config { | |||
232 | bool verbose; | 232 | bool verbose; |
233 | struct side_gaps gaps; | 233 | struct side_gaps gaps; |
234 | pid_t pid; | 234 | pid_t pid; |
235 | int status_padding; | ||
236 | int status_edge_padding; | ||
235 | struct { | 237 | struct { |
236 | char *background; | 238 | char *background; |
237 | char *statusline; | 239 | char *statusline; |
diff --git a/include/sway/input/cursor.h b/include/sway/input/cursor.h index e6477b4a..77aa0ea1 100644 --- a/include/sway/input/cursor.h +++ b/include/sway/input/cursor.h | |||
@@ -50,6 +50,12 @@ struct sway_cursor { | |||
50 | size_t pressed_button_count; | 50 | size_t pressed_button_count; |
51 | }; | 51 | }; |
52 | 52 | ||
53 | struct sway_node; | ||
54 | |||
55 | struct sway_node *node_at_coords( | ||
56 | struct sway_seat *seat, double lx, double ly, | ||
57 | struct wlr_surface **surface, double *sx, double *sy); | ||
58 | |||
53 | void sway_cursor_destroy(struct sway_cursor *cursor); | 59 | void sway_cursor_destroy(struct sway_cursor *cursor); |
54 | struct sway_cursor *sway_cursor_create(struct sway_seat *seat); | 60 | struct sway_cursor *sway_cursor_create(struct sway_seat *seat); |
55 | 61 | ||
diff --git a/include/sway/input/input-manager.h b/include/sway/input/input-manager.h index 08e749dc..8e8bf1f2 100644 --- a/include/sway/input/input-manager.h +++ b/include/sway/input/input-manager.h | |||
@@ -37,6 +37,10 @@ void input_manager_configure_xcursor(void); | |||
37 | 37 | ||
38 | void input_manager_apply_input_config(struct input_config *input_config); | 38 | void input_manager_apply_input_config(struct input_config *input_config); |
39 | 39 | ||
40 | void input_manager_reset_input(struct sway_input_device *input_device); | ||
41 | |||
42 | void input_manager_reset_all_inputs(); | ||
43 | |||
40 | void input_manager_apply_seat_config(struct seat_config *seat_config); | 44 | void input_manager_apply_seat_config(struct seat_config *seat_config); |
41 | 45 | ||
42 | struct sway_seat *input_manager_get_default_seat(void); | 46 | struct sway_seat *input_manager_get_default_seat(void); |
diff --git a/include/sway/input/seat.h b/include/sway/input/seat.h index a3c20346..d2f14895 100644 --- a/include/sway/input/seat.h +++ b/include/sway/input/seat.h | |||
@@ -6,6 +6,17 @@ | |||
6 | #include <wlr/util/edges.h> | 6 | #include <wlr/util/edges.h> |
7 | #include "sway/input/input-manager.h" | 7 | #include "sway/input/input-manager.h" |
8 | 8 | ||
9 | struct sway_seat; | ||
10 | |||
11 | struct sway_seatop_impl { | ||
12 | void (*motion)(struct sway_seat *seat, uint32_t time_msec); | ||
13 | void (*finish)(struct sway_seat *seat); | ||
14 | void (*abort)(struct sway_seat *seat); | ||
15 | void (*unref)(struct sway_seat *seat, struct sway_container *con); | ||
16 | void (*render)(struct sway_seat *seat, struct sway_output *output, | ||
17 | pixman_region32_t *damage); | ||
18 | }; | ||
19 | |||
9 | struct sway_seat_device { | 20 | struct sway_seat_device { |
10 | struct sway_seat *sway_seat; | 21 | struct sway_seat *sway_seat; |
11 | struct sway_input_device *input_device; | 22 | struct sway_input_device *input_device; |
@@ -35,16 +46,6 @@ struct sway_drag_icon { | |||
35 | struct wl_listener destroy; | 46 | struct wl_listener destroy; |
36 | }; | 47 | }; |
37 | 48 | ||
38 | enum sway_seat_operation { | ||
39 | OP_NONE, | ||
40 | OP_DOWN, | ||
41 | OP_MOVE_FLOATING, | ||
42 | OP_MOVE_TILING_THRESHOLD, | ||
43 | OP_MOVE_TILING, | ||
44 | OP_RESIZE_FLOATING, | ||
45 | OP_RESIZE_TILING, | ||
46 | }; | ||
47 | |||
48 | struct sway_seat { | 49 | struct sway_seat { |
49 | struct wlr_seat *wlr_seat; | 50 | struct wlr_seat *wlr_seat; |
50 | struct sway_cursor *cursor; | 51 | struct sway_cursor *cursor; |
@@ -64,19 +65,10 @@ struct sway_seat { | |||
64 | int32_t touch_id; | 65 | int32_t touch_id; |
65 | double touch_x, touch_y; | 66 | double touch_x, touch_y; |
66 | 67 | ||
67 | // Operations (drag and resize) | 68 | // Seat operations (drag and resize) |
68 | enum sway_seat_operation operation; | 69 | const struct sway_seatop_impl *seatop_impl; |
69 | struct sway_container *op_container; | 70 | void *seatop_data; |
70 | struct sway_node *op_target_node; // target for tiling move | 71 | uint32_t seatop_button; |
71 | enum wlr_edges op_target_edge; | ||
72 | struct wlr_box op_drop_box; | ||
73 | enum wlr_edges op_resize_edge; | ||
74 | uint32_t op_button; | ||
75 | bool op_resize_preserve_ratio; | ||
76 | double op_ref_lx, op_ref_ly; // cursor's x/y at start of op | ||
77 | double op_ref_width, op_ref_height; // container's size at start of op | ||
78 | double op_ref_con_lx, op_ref_con_ly; // container's x/y at start of op | ||
79 | bool op_moved; // if the mouse moved during a down op | ||
80 | 72 | ||
81 | uint32_t last_button; | 73 | uint32_t last_button; |
82 | uint32_t last_button_serial; | 74 | uint32_t last_button_serial; |
@@ -100,6 +92,9 @@ void seat_add_device(struct sway_seat *seat, | |||
100 | void seat_configure_device(struct sway_seat *seat, | 92 | void seat_configure_device(struct sway_seat *seat, |
101 | struct sway_input_device *device); | 93 | struct sway_input_device *device); |
102 | 94 | ||
95 | void seat_reset_device(struct sway_seat *seat, | ||
96 | struct sway_input_device *input_device); | ||
97 | |||
103 | void seat_remove_device(struct sway_seat *seat, | 98 | void seat_remove_device(struct sway_seat *seat, |
104 | struct sway_input_device *device); | 99 | struct sway_input_device *device); |
105 | 100 | ||
@@ -181,32 +176,59 @@ bool seat_is_input_allowed(struct sway_seat *seat, struct wlr_surface *surface); | |||
181 | 176 | ||
182 | void drag_icon_update_position(struct sway_drag_icon *icon); | 177 | void drag_icon_update_position(struct sway_drag_icon *icon); |
183 | 178 | ||
184 | void seat_begin_down(struct sway_seat *seat, struct sway_container *con, | 179 | void seatop_begin_down(struct sway_seat *seat, |
185 | uint32_t button, double sx, double sy); | 180 | struct sway_container *con, uint32_t button, int sx, int sy); |
186 | 181 | ||
187 | void seat_begin_move_floating(struct sway_seat *seat, | 182 | void seatop_begin_move_floating(struct sway_seat *seat, |
188 | struct sway_container *con, uint32_t button); | 183 | struct sway_container *con, uint32_t button); |
189 | 184 | ||
190 | void seat_begin_move_tiling_threshold(struct sway_seat *seat, | 185 | void seatop_begin_move_tiling_threshold(struct sway_seat *seat, |
191 | struct sway_container *con, uint32_t button); | 186 | struct sway_container *con, uint32_t button); |
192 | 187 | ||
193 | void seat_begin_move_tiling(struct sway_seat *seat, | 188 | void seatop_begin_move_tiling(struct sway_seat *seat, |
194 | struct sway_container *con, uint32_t button); | 189 | struct sway_container *con, uint32_t button); |
195 | 190 | ||
196 | void seat_begin_resize_floating(struct sway_seat *seat, | 191 | void seatop_begin_resize_floating(struct sway_seat *seat, |
197 | struct sway_container *con, uint32_t button, enum wlr_edges edge); | 192 | struct sway_container *con, uint32_t button, enum wlr_edges edge); |
198 | 193 | ||
199 | void seat_begin_resize_tiling(struct sway_seat *seat, | 194 | void seatop_begin_resize_tiling(struct sway_seat *seat, |
200 | struct sway_container *con, uint32_t button, enum wlr_edges edge); | 195 | struct sway_container *con, uint32_t button, enum wlr_edges edge); |
201 | 196 | ||
202 | struct sway_container *seat_get_focus_inactive_floating(struct sway_seat *seat, | 197 | struct sway_container *seat_get_focus_inactive_floating(struct sway_seat *seat, |
203 | struct sway_workspace *workspace); | 198 | struct sway_workspace *workspace); |
204 | 199 | ||
205 | void seat_end_mouse_operation(struct sway_seat *seat); | ||
206 | |||
207 | void seat_pointer_notify_button(struct sway_seat *seat, uint32_t time_msec, | 200 | void seat_pointer_notify_button(struct sway_seat *seat, uint32_t time_msec, |
208 | uint32_t button, enum wlr_button_state state); | 201 | uint32_t button, enum wlr_button_state state); |
209 | 202 | ||
210 | void seat_consider_warp_to_focus(struct sway_seat *seat); | 203 | void seat_consider_warp_to_focus(struct sway_seat *seat); |
211 | 204 | ||
205 | bool seat_doing_seatop(struct sway_seat *seat); | ||
206 | |||
207 | void seatop_motion(struct sway_seat *seat, uint32_t time_msec); | ||
208 | |||
209 | /** | ||
210 | * End a seatop and apply the affects. | ||
211 | */ | ||
212 | void seatop_finish(struct sway_seat *seat); | ||
213 | |||
214 | /** | ||
215 | * End a seatop without applying the affects. | ||
216 | */ | ||
217 | void seatop_abort(struct sway_seat *seat); | ||
218 | |||
219 | /** | ||
220 | * Instructs the seatop implementation to drop any references to the given | ||
221 | * container (eg. because the container is destroying). | ||
222 | * The seatop may choose to abort itself in response to this. | ||
223 | */ | ||
224 | void seatop_unref(struct sway_seat *seat, struct sway_container *con); | ||
225 | |||
226 | /** | ||
227 | * Instructs a seatop to render anything that it needs to render | ||
228 | * (eg. dropzone for move-tiling) | ||
229 | */ | ||
230 | void seatop_render(struct sway_seat *seat, struct sway_output *output, | ||
231 | pixman_region32_t *damage); | ||
232 | |||
233 | |||
212 | #endif | 234 | #endif |
diff --git a/include/sway/output.h b/include/sway/output.h index f7c5ceba..bdf9614d 100644 --- a/include/sway/output.h +++ b/include/sway/output.h | |||
@@ -146,4 +146,12 @@ enum sway_container_layout output_get_default_layout( | |||
146 | 146 | ||
147 | void output_add_listeners(struct sway_output *output); | 147 | void output_add_listeners(struct sway_output *output); |
148 | 148 | ||
149 | void render_rect(struct wlr_output *wlr_output, | ||
150 | pixman_region32_t *output_damage, const struct wlr_box *_box, | ||
151 | float color[static 4]); | ||
152 | |||
153 | void premultiply_alpha(float color[4], float opacity); | ||
154 | |||
155 | void scale_box(struct wlr_box *box, float scale); | ||
156 | |||
149 | #endif | 157 | #endif |
diff --git a/include/sway/tree/container.h b/include/sway/tree/container.h index 1d0a0ad1..9a432cb2 100644 --- a/include/sway/tree/container.h +++ b/include/sway/tree/container.h | |||
@@ -333,4 +333,6 @@ void container_add_mark(struct sway_container *container, char *mark); | |||
333 | 333 | ||
334 | void container_update_marks_textures(struct sway_container *container); | 334 | void container_update_marks_textures(struct sway_container *container); |
335 | 335 | ||
336 | void container_raise_floating(struct sway_container *con); | ||
337 | |||
336 | #endif | 338 | #endif |
diff --git a/include/swaybar/bar.h b/include/swaybar/bar.h index e377b8de..2d9ba0d9 100644 --- a/include/swaybar/bar.h +++ b/include/swaybar/bar.h | |||
@@ -61,6 +61,7 @@ struct swaybar_output { | |||
61 | struct wl_list hotspots; // swaybar_hotspot::link | 61 | struct wl_list hotspots; // swaybar_hotspot::link |
62 | 62 | ||
63 | char *name; | 63 | char *name; |
64 | char *identifier; | ||
64 | bool focused; | 65 | bool focused; |
65 | 66 | ||
66 | uint32_t width, height; | 67 | uint32_t width, height; |
diff --git a/include/swaybar/config.h b/include/swaybar/config.h index 1f6577bd..add0a1cf 100644 --- a/include/swaybar/config.h +++ b/include/swaybar/config.h | |||
@@ -43,6 +43,8 @@ struct swaybar_config { | |||
43 | struct wl_list outputs; // config_output::link | 43 | struct wl_list outputs; // config_output::link |
44 | bool all_outputs; | 44 | bool all_outputs; |
45 | int height; | 45 | int height; |
46 | int status_padding; | ||
47 | int status_edge_padding; | ||
46 | struct { | 48 | struct { |
47 | int top; | 49 | int top; |
48 | int right; | 50 | int right; |
diff --git a/include/swaylock/swaylock.h b/include/swaylock/swaylock.h index 18af7ab4..516a56f4 100644 --- a/include/swaylock/swaylock.h +++ b/include/swaylock/swaylock.h | |||
@@ -22,6 +22,7 @@ enum auth_state { | |||
22 | struct swaylock_colorset { | 22 | struct swaylock_colorset { |
23 | uint32_t input; | 23 | uint32_t input; |
24 | uint32_t cleared; | 24 | uint32_t cleared; |
25 | uint32_t caps_lock; | ||
25 | uint32_t verifying; | 26 | uint32_t verifying; |
26 | uint32_t wrong; | 27 | uint32_t wrong; |
27 | }; | 28 | }; |
@@ -30,6 +31,8 @@ struct swaylock_colors { | |||
30 | uint32_t background; | 31 | uint32_t background; |
31 | uint32_t bs_highlight; | 32 | uint32_t bs_highlight; |
32 | uint32_t key_highlight; | 33 | uint32_t key_highlight; |
34 | uint32_t caps_lock_bs_highlight; | ||
35 | uint32_t caps_lock_key_highlight; | ||
33 | uint32_t separator; | 36 | uint32_t separator; |
34 | struct swaylock_colorset inside; | 37 | struct swaylock_colorset inside; |
35 | struct swaylock_colorset line; | 38 | struct swaylock_colorset line; |
@@ -45,6 +48,8 @@ struct swaylock_args { | |||
45 | uint32_t thickness; | 48 | uint32_t thickness; |
46 | bool ignore_empty; | 49 | bool ignore_empty; |
47 | bool show_indicator; | 50 | bool show_indicator; |
51 | bool show_caps_lock_text; | ||
52 | bool show_caps_lock_indicator; | ||
48 | bool daemonize; | 53 | bool daemonize; |
49 | }; | 54 | }; |
50 | 55 | ||