diff options
author | Drew DeVault <sir@cmpwn.com> | 2015-08-18 07:19:20 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2015-08-18 07:20:34 -0400 |
commit | 2139001c9f61a84ed1ac581a54bb2bde68928afd (patch) | |
tree | a6efb486fdb71675775253d79e9550b5fc1d2f67 /include | |
parent | fixed floating window crashing bug (diff) | |
download | sway-2139001c9f61a84ed1ac581a54bb2bde68928afd.tar.gz sway-2139001c9f61a84ed1ac581a54bb2bde68928afd.tar.zst sway-2139001c9f61a84ed1ac581a54bb2bde68928afd.zip |
Coding style enforcement
This was done by hand, so I might have missed things. If anyone knows of
a good C style enforcement tool, let me know.
Diffstat (limited to 'include')
-rw-r--r-- | include/container.h | 17 | ||||
-rw-r--r-- | include/focus.h | 16 | ||||
-rw-r--r-- | include/handlers.h | 2 | ||||
-rw-r--r-- | include/layout.h | 6 |
4 files changed, 18 insertions, 23 deletions
diff --git a/include/container.h b/include/container.h index 5f386368..186ee8b6 100644 --- a/include/container.h +++ b/include/container.h | |||
@@ -30,7 +30,6 @@ struct sway_container { | |||
30 | wlc_handle handle; | 30 | wlc_handle handle; |
31 | 31 | ||
32 | enum swayc_types type; | 32 | enum swayc_types type; |
33 | |||
34 | enum swayc_layouts layout; | 33 | enum swayc_layouts layout; |
35 | 34 | ||
36 | // Not including borders or margins | 35 | // Not including borders or margins |
@@ -42,9 +41,7 @@ struct sway_container { | |||
42 | int x, y; | 41 | int x, y; |
43 | 42 | ||
44 | bool visible; | 43 | bool visible; |
45 | |||
46 | bool is_floating; | 44 | bool is_floating; |
47 | |||
48 | bool is_focused; | 45 | bool is_focused; |
49 | 46 | ||
50 | int weight; | 47 | int weight; |
@@ -52,8 +49,6 @@ struct sway_container { | |||
52 | char *name; | 49 | char *name; |
53 | 50 | ||
54 | list_t *children; | 51 | list_t *children; |
55 | |||
56 | // Special list for floating windows in workspaces | ||
57 | list_t *floating; | 52 | list_t *floating; |
58 | 53 | ||
59 | struct sway_container *parent; | 54 | struct sway_container *parent; |
@@ -62,17 +57,17 @@ struct sway_container { | |||
62 | 57 | ||
63 | 58 | ||
64 | swayc_t *new_output(wlc_handle handle); | 59 | swayc_t *new_output(wlc_handle handle); |
65 | swayc_t *new_workspace(swayc_t * output, const char *name); | 60 | swayc_t *new_workspace(swayc_t *output, const char *name); |
66 | //Creates container Around child (parent child) -> (parent (container child)) | 61 | // Creates container Around child (parent child) -> (parent (container child)) |
67 | swayc_t *new_container(swayc_t *child, enum swayc_layouts layout); | 62 | swayc_t *new_container(swayc_t *child, enum swayc_layouts layout); |
68 | //Creates view as a sibling of current focused container, or as child of a workspace | 63 | // Creates view as a sibling of current focused container, or as child of a workspace |
69 | swayc_t *new_view(swayc_t *sibling, wlc_handle handle); | 64 | swayc_t *new_view(swayc_t *sibling, wlc_handle handle); |
70 | //Creates view as a new floating view which is in the active workspace | 65 | // Creates view as a new floating view which is in the active workspace |
71 | swayc_t *new_floating_view(wlc_handle handle); | 66 | swayc_t *new_floating_view(wlc_handle handle); |
72 | 67 | ||
73 | 68 | ||
74 | swayc_t *destroy_output(swayc_t *output); | 69 | swayc_t *destroy_output(swayc_t *output); |
75 | //destroys workspace if empty and returns parent pointer, else returns NULL | 70 | // Destroys workspace if empty and returns parent pointer, else returns NULL |
76 | swayc_t *destroy_workspace(swayc_t *workspace); | 71 | swayc_t *destroy_workspace(swayc_t *workspace); |
77 | swayc_t *destroy_container(swayc_t *container); | 72 | swayc_t *destroy_container(swayc_t *container); |
78 | swayc_t *destroy_view(swayc_t *view); | 73 | swayc_t *destroy_view(swayc_t *view); |
@@ -80,7 +75,7 @@ swayc_t *destroy_view(swayc_t *view); | |||
80 | swayc_t *find_container(swayc_t *container, bool (*test)(swayc_t *view, void *data), void *data); | 75 | swayc_t *find_container(swayc_t *container, bool (*test)(swayc_t *view, void *data), void *data); |
81 | void container_map(swayc_t *, void (*f)(swayc_t *, void *), void *); | 76 | void container_map(swayc_t *, void (*f)(swayc_t *, void *), void *); |
82 | 77 | ||
83 | //Mappings | 78 | // Mappings |
84 | void set_view_visibility(swayc_t *view, void *data); | 79 | void set_view_visibility(swayc_t *view, void *data); |
85 | 80 | ||
86 | #endif | 81 | #endif |
diff --git a/include/focus.h b/include/focus.h index 185910f3..410ed134 100644 --- a/include/focus.h +++ b/include/focus.h | |||
@@ -10,12 +10,12 @@ enum movement_direction { | |||
10 | MOVE_PARENT | 10 | MOVE_PARENT |
11 | }; | 11 | }; |
12 | 12 | ||
13 | //focused_container - the container found by following the `focused` pointer | 13 | // focused_container - the container found by following the `focused` pointer |
14 | //from a given container to a container with `is_focused` boolean set | 14 | // from a given container to a container with `is_focused` boolean set |
15 | //--- | 15 | // --- |
16 | //focused_view - the container found by following the `focused` pointer from a | 16 | // focused_view - the container found by following the `focused` pointer from a |
17 | //given container to a view. | 17 | // given container to a view. |
18 | //--- | 18 | // --- |
19 | 19 | ||
20 | swayc_t *get_focused_container(swayc_t *parent); | 20 | swayc_t *get_focused_container(swayc_t *parent); |
21 | swayc_t *get_focused_view(swayc_t *parent); | 21 | swayc_t *get_focused_view(swayc_t *parent); |
@@ -23,8 +23,8 @@ swayc_t *get_focused_view(swayc_t *parent); | |||
23 | void set_focused_container(swayc_t *container); | 23 | void set_focused_container(swayc_t *container); |
24 | void set_focused_container_for(swayc_t *ancestor, swayc_t *container); | 24 | void set_focused_container_for(swayc_t *ancestor, swayc_t *container); |
25 | 25 | ||
26 | //lock focused container/view. locked by windows with OVERRIDE attribute | 26 | // lock focused container/view. locked by windows with OVERRIDE attribute |
27 | //and unlocked when they are destroyed | 27 | // and unlocked when they are destroyed |
28 | 28 | ||
29 | extern bool locked_container_focus; | 29 | extern bool locked_container_focus; |
30 | extern bool locked_view_focus; | 30 | extern bool locked_view_focus; |
diff --git a/include/handlers.h b/include/handlers.h index 6b642419..c25c3309 100644 --- a/include/handlers.h +++ b/include/handlers.h | |||
@@ -7,7 +7,7 @@ | |||
7 | extern struct wlc_interface interface; | 7 | extern struct wlc_interface interface; |
8 | extern uint32_t keys_pressed[32]; | 8 | extern uint32_t keys_pressed[32]; |
9 | 9 | ||
10 | //set focus to current pointer location and return focused container | 10 | // set focus to current pointer location and return focused container |
11 | swayc_t *container_under_pointer(void); | 11 | swayc_t *container_under_pointer(void); |
12 | 12 | ||
13 | #endif | 13 | #endif |
diff --git a/include/layout.h b/include/layout.h index 26d00ce4..282f92ee 100644 --- a/include/layout.h +++ b/include/layout.h | |||
@@ -10,15 +10,15 @@ extern swayc_t root_container; | |||
10 | void init_layout(void); | 10 | void init_layout(void); |
11 | 11 | ||
12 | void add_child(swayc_t *parent, swayc_t *child); | 12 | 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 *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); |
20 | 20 | ||
21 | //Focus | 21 | // Focus |
22 | void unfocus_all(swayc_t *container); | 22 | void unfocus_all(swayc_t *container); |
23 | void focus_view(swayc_t *view); | 23 | void focus_view(swayc_t *view); |
24 | void focus_view_for(swayc_t *ancestor, swayc_t *container); | 24 | void focus_view_for(swayc_t *ancestor, swayc_t *container); |