summaryrefslogtreecommitdiffstats
path: root/include/sway
diff options
context:
space:
mode:
authorLibravatar emersion <contact@emersion.fr>2018-04-02 15:30:58 -0400
committerLibravatar emersion <contact@emersion.fr>2018-04-02 15:30:58 -0400
commita4a241697ae591289d7c14eff972e1ef787216e2 (patch)
treed82d3c3eba2946670aa634a62d03feb7102f0bf8 /include/sway
parentXwayland unmanaged views aren't views anymore (diff)
parentMerge pull request #1699 from acrisci/seat-fixes (diff)
downloadsway-a4a241697ae591289d7c14eff972e1ef787216e2.tar.gz
sway-a4a241697ae591289d7c14eff972e1ef787216e2.tar.zst
sway-a4a241697ae591289d7c14eff972e1ef787216e2.zip
Merge branch 'wlroots' into view-redesign
Diffstat (limited to 'include/sway')
-rw-r--r--include/sway/config.h27
-rw-r--r--include/sway/input/input-manager.h23
-rw-r--r--include/sway/input/seat.h28
-rw-r--r--include/sway/output.h2
-rw-r--r--include/sway/tree/container.h5
-rw-r--r--include/sway/tree/layout.h12
6 files changed, 67 insertions, 30 deletions
diff --git a/include/sway/config.h b/include/sway/config.h
index 03b51948..91f772b5 100644
--- a/include/sway/config.h
+++ b/include/sway/config.h
@@ -377,6 +377,7 @@ void free_config(struct sway_config *config);
377void config_clear_handler_context(struct sway_config *config); 377void config_clear_handler_context(struct sway_config *config);
378 378
379void free_sway_variable(struct sway_variable *var); 379void free_sway_variable(struct sway_variable *var);
380
380/** 381/**
381 * Does variable replacement for a string based on the config's currently loaded variables. 382 * Does variable replacement for a string based on the config's currently loaded variables.
382 */ 383 */
@@ -385,44 +386,68 @@ char *do_var_replacement(char *str);
385struct cmd_results *check_security_config(); 386struct cmd_results *check_security_config();
386 387
387int input_identifier_cmp(const void *item, const void *data); 388int input_identifier_cmp(const void *item, const void *data);
389
388struct input_config *new_input_config(const char* identifier); 390struct input_config *new_input_config(const char* identifier);
391
389void merge_input_config(struct input_config *dst, struct input_config *src); 392void merge_input_config(struct input_config *dst, struct input_config *src);
393
390struct input_config *copy_input_config(struct input_config *ic); 394struct input_config *copy_input_config(struct input_config *ic);
395
391void free_input_config(struct input_config *ic); 396void free_input_config(struct input_config *ic);
397
392void apply_input_config(struct input_config *input); 398void apply_input_config(struct input_config *input);
393 399
394int seat_name_cmp(const void *item, const void *data); 400int seat_name_cmp(const void *item, const void *data);
401
395struct seat_config *new_seat_config(const char* name); 402struct seat_config *new_seat_config(const char* name);
403
396void merge_seat_config(struct seat_config *dst, struct seat_config *src); 404void merge_seat_config(struct seat_config *dst, struct seat_config *src);
405
397struct seat_config *copy_seat_config(struct seat_config *seat); 406struct seat_config *copy_seat_config(struct seat_config *seat);
407
398void free_seat_config(struct seat_config *ic); 408void free_seat_config(struct seat_config *ic);
409
399struct seat_attachment_config *seat_attachment_config_new(); 410struct seat_attachment_config *seat_attachment_config_new();
411
400struct seat_attachment_config *seat_config_get_attachment( 412struct seat_attachment_config *seat_config_get_attachment(
401 struct seat_config *seat_config, char *identifier); 413 struct seat_config *seat_config, char *identifier);
414
402void apply_seat_config(struct seat_config *seat); 415void apply_seat_config(struct seat_config *seat);
403 416
404int output_name_cmp(const void *item, const void *data); 417int output_name_cmp(const void *item, const void *data);
418
405void output_get_identifier(char *identifier, size_t len, 419void output_get_identifier(char *identifier, size_t len,
406 struct sway_output *output); 420 struct sway_output *output);
421
407struct output_config *new_output_config(const char *name); 422struct output_config *new_output_config(const char *name);
423
408void merge_output_config(struct output_config *dst, struct output_config *src); 424void merge_output_config(struct output_config *dst, struct output_config *src);
425
409void apply_output_config(struct output_config *oc, 426void apply_output_config(struct output_config *oc,
410 struct sway_container *output); 427 struct sway_container *output);
428
411void free_output_config(struct output_config *oc); 429void free_output_config(struct output_config *oc);
412 430
413int workspace_output_cmp_workspace(const void *a, const void *b); 431int workspace_output_cmp_workspace(const void *a, const void *b);
414 432
415int sway_binding_cmp(const void *a, const void *b); 433int sway_binding_cmp(const void *a, const void *b);
434
416int sway_binding_cmp_qsort(const void *a, const void *b); 435int sway_binding_cmp_qsort(const void *a, const void *b);
436
417int sway_binding_cmp_keys(const void *a, const void *b); 437int sway_binding_cmp_keys(const void *a, const void *b);
438
418void free_sway_binding(struct sway_binding *sb); 439void free_sway_binding(struct sway_binding *sb);
440
419struct sway_binding *sway_binding_dup(struct sway_binding *sb); 441struct sway_binding *sway_binding_dup(struct sway_binding *sb);
420 442
421/* Bar stuff */
422void load_swaybars(); 443void load_swaybars();
444
423void invoke_swaybar(struct bar_config *bar); 445void invoke_swaybar(struct bar_config *bar);
446
424void terminate_swaybg(pid_t pid); 447void terminate_swaybg(pid_t pid);
448
425struct bar_config *default_bar_config(void); 449struct bar_config *default_bar_config(void);
450
426void free_bar_config(struct bar_config *bar); 451void free_bar_config(struct bar_config *bar);
427 452
428/* Global config singleton. */ 453/* Global config singleton. */
diff --git a/include/sway/input/input-manager.h b/include/sway/input/input-manager.h
index c6c73dba..8e39a4a7 100644
--- a/include/sway/input/input-manager.h
+++ b/include/sway/input/input-manager.h
@@ -14,7 +14,6 @@ extern struct sway_input_manager *input_manager;
14struct sway_input_device { 14struct sway_input_device {
15 char *identifier; 15 char *identifier;
16 struct wlr_input_device *wlr_device; 16 struct wlr_input_device *wlr_device;
17 struct input_config *config;
18 struct wl_list link; 17 struct wl_list link;
19 struct wl_listener device_destroy; 18 struct wl_listener device_destroy;
20}; 19};
@@ -27,30 +26,34 @@ struct sway_input_manager {
27 struct wl_listener new_input; 26 struct wl_listener new_input;
28}; 27};
29 28
30struct sway_input_manager *sway_input_manager_create( 29struct sway_input_manager *input_manager_create(struct sway_server *server);
31 struct sway_server *server);
32 30
33bool sway_input_manager_has_focus(struct sway_input_manager *input, 31bool input_manager_has_focus(struct sway_input_manager *input,
34 struct sway_container *container); 32 struct sway_container *container);
35 33
36void sway_input_manager_set_focus(struct sway_input_manager *input, 34void input_manager_set_focus(struct sway_input_manager *input,
37 struct sway_container *container); 35 struct sway_container *container);
38 36
39void sway_input_manager_configure_xcursor(struct sway_input_manager *input); 37void input_manager_configure_xcursor(struct sway_input_manager *input);
40 38
41void sway_input_manager_apply_input_config(struct sway_input_manager *input, 39void input_manager_apply_input_config(struct sway_input_manager *input,
42 struct input_config *input_config); 40 struct input_config *input_config);
43 41
44void sway_input_manager_apply_seat_config(struct sway_input_manager *input, 42void input_manager_apply_seat_config(struct sway_input_manager *input,
45 struct seat_config *seat_config); 43 struct seat_config *seat_config);
46 44
47struct sway_seat *sway_input_manager_get_default_seat( 45struct sway_seat *input_manager_get_default_seat(
48 struct sway_input_manager *input); 46 struct sway_input_manager *input);
49 47
50struct sway_seat *input_manager_get_seat(struct sway_input_manager *input, 48struct sway_seat *input_manager_get_seat(struct sway_input_manager *input,
51 const char *seat_name); 49 const char *seat_name);
52 50
53/** Gets the last seat the user interacted with */ 51/**
52 * Gets the last seat the user interacted with
53 */
54struct sway_seat *input_manager_current_seat(struct sway_input_manager *input); 54struct sway_seat *input_manager_current_seat(struct sway_input_manager *input);
55 55
56struct input_config *input_device_get_config(struct sway_input_device *device);
57
58
56#endif 59#endif
diff --git a/include/sway/input/seat.h b/include/sway/input/seat.h
index 31210a5a..5c3c2c4f 100644
--- a/include/sway/input/seat.h
+++ b/include/sway/input/seat.h
@@ -8,7 +8,6 @@ struct sway_seat_device {
8 struct sway_seat *sway_seat; 8 struct sway_seat *sway_seat;
9 struct sway_input_device *input_device; 9 struct sway_input_device *input_device;
10 struct sway_keyboard *keyboard; 10 struct sway_keyboard *keyboard;
11 struct seat_attachment_config *attachment_config;
12 struct wl_list link; // sway_seat::devices 11 struct wl_list link; // sway_seat::devices
13}; 12};
14 13
@@ -23,7 +22,6 @@ struct sway_seat_container {
23 22
24struct sway_seat { 23struct sway_seat {
25 struct wlr_seat *wlr_seat; 24 struct wlr_seat *wlr_seat;
26 struct seat_config *config;
27 struct sway_cursor *cursor; 25 struct sway_cursor *cursor;
28 struct sway_input_manager *input; 26 struct sway_input_manager *input;
29 27
@@ -38,28 +36,28 @@ struct sway_seat {
38 struct wl_list link; // input_manager::seats 36 struct wl_list link; // input_manager::seats
39}; 37};
40 38
41struct sway_seat *sway_seat_create(struct sway_input_manager *input, 39struct sway_seat *seat_create(struct sway_input_manager *input,
42 const char *seat_name); 40 const char *seat_name);
43 41
44void sway_seat_destroy(struct sway_seat *seat); 42void seat_destroy(struct sway_seat *seat);
45 43
46void sway_seat_add_device(struct sway_seat *seat, 44void seat_add_device(struct sway_seat *seat,
47 struct sway_input_device *device); 45 struct sway_input_device *device);
48 46
49void sway_seat_configure_device(struct sway_seat *seat, 47void seat_configure_device(struct sway_seat *seat,
50 struct sway_input_device *device); 48 struct sway_input_device *device);
51 49
52void sway_seat_remove_device(struct sway_seat *seat, 50void seat_remove_device(struct sway_seat *seat,
53 struct sway_input_device *device); 51 struct sway_input_device *device);
54 52
55void sway_seat_configure_xcursor(struct sway_seat *seat); 53void seat_configure_xcursor(struct sway_seat *seat);
56 54
57void sway_seat_set_focus(struct sway_seat *seat, struct sway_container *container); 55void seat_set_focus(struct sway_seat *seat, struct sway_container *container);
58 56
59void sway_seat_set_focus_warp(struct sway_seat *seat, 57void seat_set_focus_warp(struct sway_seat *seat,
60 struct sway_container *container, bool warp); 58 struct sway_container *container, bool warp);
61 59
62struct sway_container *sway_seat_get_focus(struct sway_seat *seat); 60struct sway_container *seat_get_focus(struct sway_seat *seat);
63 61
64/** 62/**
65 * Return the last container to be focused for the seat (or the most recently 63 * Return the last container to be focused for the seat (or the most recently
@@ -70,12 +68,14 @@ struct sway_container *sway_seat_get_focus(struct sway_seat *seat);
70 * is destroyed, or focus moves to a container with children and we need to 68 * is destroyed, or focus moves to a container with children and we need to
71 * descend into the next leaf in focus order. 69 * descend into the next leaf in focus order.
72 */ 70 */
73struct sway_container *sway_seat_get_focus_inactive(struct sway_seat *seat, 71struct sway_container *seat_get_focus_inactive(struct sway_seat *seat,
74 struct sway_container *container); 72 struct sway_container *container);
75 73
76struct sway_container *sway_seat_get_focus_by_type(struct sway_seat *seat, 74struct sway_container *seat_get_focus_by_type(struct sway_seat *seat,
77 enum sway_container_type type); 75 enum sway_container_type type);
78 76
79void sway_seat_set_config(struct sway_seat *seat, struct seat_config *seat_config); 77void seat_apply_config(struct sway_seat *seat, struct seat_config *seat_config);
78
79struct seat_config *seat_get_config(struct sway_seat *seat);
80 80
81#endif 81#endif
diff --git a/include/sway/output.h b/include/sway/output.h
index cfe7502b..98d0f83f 100644
--- a/include/sway/output.h
+++ b/include/sway/output.h
@@ -37,4 +37,6 @@ void output_damage_whole(struct sway_output *output);
37void output_damage_whole_view(struct sway_output *output, 37void output_damage_whole_view(struct sway_output *output,
38 struct sway_view *view); 38 struct sway_view *view);
39 39
40struct sway_container *output_by_name(const char *name);
41
40#endif 42#endif
diff --git a/include/sway/tree/container.h b/include/sway/tree/container.h
index 423c0a22..bd02197c 100644
--- a/include/sway/tree/container.h
+++ b/include/sway/tree/container.h
@@ -85,9 +85,14 @@ struct sway_container {
85 85
86 struct { 86 struct {
87 struct wl_signal destroy; 87 struct wl_signal destroy;
88 // Raised after the tree updates, but before arrange_windows
89 // Passed the previous parent
90 struct wl_signal reparent;
88 } events; 91 } events;
89}; 92};
90 93
94const char *container_type_to_str(enum sway_container_type type);
95
91// TODO only one container create function and pass the type? 96// TODO only one container create function and pass the type?
92struct sway_container *container_output_create( 97struct sway_container *container_output_create(
93 struct sway_output *sway_output); 98 struct sway_output *sway_output);
diff --git a/include/sway/tree/layout.h b/include/sway/tree/layout.h
index fecf1582..a14152e8 100644
--- a/include/sway/tree/layout.h
+++ b/include/sway/tree/layout.h
@@ -11,9 +11,6 @@ enum movement_direction {
11 MOVE_DOWN, 11 MOVE_DOWN,
12 MOVE_PARENT, 12 MOVE_PARENT,
13 MOVE_CHILD, 13 MOVE_CHILD,
14 MOVE_NEXT,
15 MOVE_PREV,
16 MOVE_FIRST
17}; 14};
18 15
19struct sway_container; 16struct sway_container;
@@ -32,7 +29,8 @@ struct sway_root {
32 29
33void layout_init(void); 30void layout_init(void);
34 31
35void container_add_child(struct sway_container *parent, struct sway_container *child); 32void container_add_child(struct sway_container *parent,
33 struct sway_container *child);
36 34
37struct sway_container *container_add_sibling(struct sway_container *parent, 35struct sway_container *container_add_sibling(struct sway_container *parent,
38 struct sway_container *child); 36 struct sway_container *child);
@@ -44,7 +42,11 @@ struct sway_container *container_reap_empty(struct sway_container *container);
44void container_move_to(struct sway_container* container, 42void container_move_to(struct sway_container* container,
45 struct sway_container* destination); 43 struct sway_container* destination);
46 44
47enum sway_container_layout container_get_default_layout(struct sway_container *output); 45void container_move(struct sway_container *container,
46 enum movement_direction dir, int move_amt);
47
48enum sway_container_layout container_get_default_layout(
49 struct sway_container *output);
48 50
49void container_sort_workspaces(struct sway_container *output); 51void container_sort_workspaces(struct sway_container *output);
50 52