diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/config.h | 8 | ||||
-rw-r--r-- | include/container.h | 2 | ||||
-rw-r--r-- | include/focus.h | 36 | ||||
-rw-r--r-- | include/handlers.h | 5 | ||||
-rw-r--r-- | include/layout.h | 2 | ||||
-rw-r--r-- | include/movement.h | 17 |
6 files changed, 47 insertions, 23 deletions
diff --git a/include/config.h b/include/config.h index 38e93eb8..9243bf35 100644 --- a/include/config.h +++ b/include/config.h | |||
@@ -3,6 +3,7 @@ | |||
3 | 3 | ||
4 | #include <stdint.h> | 4 | #include <stdint.h> |
5 | #include <wlc/wlc.h> | 5 | #include <wlc/wlc.h> |
6 | #include <xkbcommon/xkbcommon.h> | ||
6 | #include "list.h" | 7 | #include "list.h" |
7 | 8 | ||
8 | struct sway_variable { | 9 | struct sway_variable { |
@@ -32,16 +33,17 @@ struct sway_config { | |||
32 | list_t *cmd_queue; | 33 | list_t *cmd_queue; |
33 | list_t *workspace_outputs; | 34 | list_t *workspace_outputs; |
34 | struct sway_mode *current_mode; | 35 | struct sway_mode *current_mode; |
36 | uint32_t floating_mod; | ||
35 | 37 | ||
36 | // Flags | 38 | // Flags |
37 | bool focus_follows_mouse; | 39 | bool focus_follows_mouse; |
38 | bool mouse_warping; | 40 | bool mouse_warping; |
39 | bool active; | 41 | bool active; |
40 | bool failed; | 42 | bool failed; |
41 | bool reloading; | 43 | bool reloading; |
42 | }; | 44 | }; |
43 | 45 | ||
44 | bool load_config(); | 46 | bool load_config(void); |
45 | bool read_config(FILE *file, bool is_active); | 47 | bool read_config(FILE *file, bool is_active); |
46 | char *do_var_replacement(struct sway_config *config, char *str); | 48 | char *do_var_replacement(struct sway_config *config, char *str); |
47 | 49 | ||
diff --git a/include/container.h b/include/container.h index e395a55b..5f386368 100644 --- a/include/container.h +++ b/include/container.h | |||
@@ -45,6 +45,8 @@ struct sway_container { | |||
45 | 45 | ||
46 | bool is_floating; | 46 | bool is_floating; |
47 | 47 | ||
48 | bool is_focused; | ||
49 | |||
48 | int weight; | 50 | int weight; |
49 | 51 | ||
50 | char *name; | 52 | char *name; |
diff --git a/include/focus.h b/include/focus.h new file mode 100644 index 00000000..185910f3 --- /dev/null +++ b/include/focus.h | |||
@@ -0,0 +1,36 @@ | |||
1 | #ifndef _SWAY_FOCUS_H | ||
2 | #define _SWAY_FOCUS_H | ||
3 | #include "container.h" | ||
4 | |||
5 | enum movement_direction { | ||
6 | MOVE_LEFT, | ||
7 | MOVE_RIGHT, | ||
8 | MOVE_UP, | ||
9 | MOVE_DOWN, | ||
10 | MOVE_PARENT | ||
11 | }; | ||
12 | |||
13 | //focused_container - the container found by following the `focused` pointer | ||
14 | //from a given container to a container with `is_focused` boolean set | ||
15 | //--- | ||
16 | //focused_view - the container found by following the `focused` pointer from a | ||
17 | //given container to a view. | ||
18 | //--- | ||
19 | |||
20 | swayc_t *get_focused_container(swayc_t *parent); | ||
21 | swayc_t *get_focused_view(swayc_t *parent); | ||
22 | |||
23 | void set_focused_container(swayc_t *container); | ||
24 | void set_focused_container_for(swayc_t *ancestor, swayc_t *container); | ||
25 | |||
26 | //lock focused container/view. locked by windows with OVERRIDE attribute | ||
27 | //and unlocked when they are destroyed | ||
28 | |||
29 | extern bool locked_container_focus; | ||
30 | extern bool locked_view_focus; | ||
31 | |||
32 | |||
33 | bool move_focus(enum movement_direction direction); | ||
34 | |||
35 | #endif | ||
36 | |||
diff --git a/include/handlers.h b/include/handlers.h index d1742cce..6b642419 100644 --- a/include/handlers.h +++ b/include/handlers.h | |||
@@ -1,12 +1,13 @@ | |||
1 | #ifndef _SWAY_HANDLERS_H | 1 | #ifndef _SWAY_HANDLERS_H |
2 | #define _SWAY_HANDLERS_H | 2 | #define _SWAY_HANDLERS_H |
3 | 3 | #include "container.h" | |
4 | #include <stdbool.h> | 4 | #include <stdbool.h> |
5 | #include <wlc/wlc.h> | 5 | #include <wlc/wlc.h> |
6 | 6 | ||
7 | extern struct wlc_interface interface; | 7 | extern struct wlc_interface interface; |
8 | extern uint32_t keys_pressed[32]; | ||
8 | 9 | ||
9 | //set focus to current pointer location and return focused container | 10 | //set focus to current pointer location and return focused container |
10 | swayc_t *focus_pointer(void); | 11 | swayc_t *container_under_pointer(void); |
11 | 12 | ||
12 | #endif | 13 | #endif |
diff --git a/include/layout.h b/include/layout.h index a7f43fda..26d00ce4 100644 --- a/include/layout.h +++ b/include/layout.h | |||
@@ -13,7 +13,7 @@ void add_child(swayc_t *parent, swayc_t *child); | |||
13 | //Returns parent container which needs to be rearranged. | 13 | //Returns parent container which needs to be rearranged. |
14 | swayc_t *add_sibling(swayc_t *sibling, swayc_t *child); | 14 | swayc_t *add_sibling(swayc_t *sibling, swayc_t *child); |
15 | swayc_t *replace_child(swayc_t *child, swayc_t *new_child); | 15 | swayc_t *replace_child(swayc_t *child, swayc_t *new_child); |
16 | swayc_t *remove_child(swayc_t *parent, swayc_t *child); | 16 | swayc_t *remove_child(swayc_t *child); |
17 | 17 | ||
18 | //Layout | 18 | //Layout |
19 | void arrange_windows(swayc_t *container, int width, int height); | 19 | void arrange_windows(swayc_t *container, int width, int height); |
diff --git a/include/movement.h b/include/movement.h deleted file mode 100644 index dd701877..00000000 --- a/include/movement.h +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | #ifndef _SWAY_MOVEMENT_H | ||
2 | #define _SWAY_MOVEMENT_H | ||
3 | |||
4 | #include <wlc/wlc.h> | ||
5 | #include "list.h" | ||
6 | |||
7 | enum movement_direction { | ||
8 | MOVE_LEFT, | ||
9 | MOVE_RIGHT, | ||
10 | MOVE_UP, | ||
11 | MOVE_DOWN, | ||
12 | MOVE_PARENT | ||
13 | }; | ||
14 | |||
15 | bool move_focus(enum movement_direction direction); | ||
16 | |||
17 | #endif | ||