summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2015-08-18 07:19:20 -0400
committerLibravatar Drew DeVault <sir@cmpwn.com>2015-08-18 07:20:34 -0400
commit2139001c9f61a84ed1ac581a54bb2bde68928afd (patch)
treea6efb486fdb71675775253d79e9550b5fc1d2f67 /include
parentfixed floating window crashing bug (diff)
downloadsway-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.h17
-rw-r--r--include/focus.h16
-rw-r--r--include/handlers.h2
-rw-r--r--include/layout.h6
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
64swayc_t *new_output(wlc_handle handle); 59swayc_t *new_output(wlc_handle handle);
65swayc_t *new_workspace(swayc_t * output, const char *name); 60swayc_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))
67swayc_t *new_container(swayc_t *child, enum swayc_layouts layout); 62swayc_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
69swayc_t *new_view(swayc_t *sibling, wlc_handle handle); 64swayc_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
71swayc_t *new_floating_view(wlc_handle handle); 66swayc_t *new_floating_view(wlc_handle handle);
72 67
73 68
74swayc_t *destroy_output(swayc_t *output); 69swayc_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
76swayc_t *destroy_workspace(swayc_t *workspace); 71swayc_t *destroy_workspace(swayc_t *workspace);
77swayc_t *destroy_container(swayc_t *container); 72swayc_t *destroy_container(swayc_t *container);
78swayc_t *destroy_view(swayc_t *view); 73swayc_t *destroy_view(swayc_t *view);
@@ -80,7 +75,7 @@ swayc_t *destroy_view(swayc_t *view);
80swayc_t *find_container(swayc_t *container, bool (*test)(swayc_t *view, void *data), void *data); 75swayc_t *find_container(swayc_t *container, bool (*test)(swayc_t *view, void *data), void *data);
81void container_map(swayc_t *, void (*f)(swayc_t *, void *), void *); 76void container_map(swayc_t *, void (*f)(swayc_t *, void *), void *);
82 77
83//Mappings 78// Mappings
84void set_view_visibility(swayc_t *view, void *data); 79void 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
20swayc_t *get_focused_container(swayc_t *parent); 20swayc_t *get_focused_container(swayc_t *parent);
21swayc_t *get_focused_view(swayc_t *parent); 21swayc_t *get_focused_view(swayc_t *parent);
@@ -23,8 +23,8 @@ swayc_t *get_focused_view(swayc_t *parent);
23void set_focused_container(swayc_t *container); 23void set_focused_container(swayc_t *container);
24void set_focused_container_for(swayc_t *ancestor, swayc_t *container); 24void 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
29extern bool locked_container_focus; 29extern bool locked_container_focus;
30extern bool locked_view_focus; 30extern 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 @@
7extern struct wlc_interface interface; 7extern struct wlc_interface interface;
8extern uint32_t keys_pressed[32]; 8extern 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
11swayc_t *container_under_pointer(void); 11swayc_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;
10void init_layout(void); 10void init_layout(void);
11 11
12void add_child(swayc_t *parent, swayc_t *child); 12void 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.
14swayc_t *add_sibling(swayc_t *sibling, swayc_t *child); 14swayc_t *add_sibling(swayc_t *sibling, swayc_t *child);
15swayc_t *replace_child(swayc_t *child, swayc_t *new_child); 15swayc_t *replace_child(swayc_t *child, swayc_t *new_child);
16swayc_t *remove_child(swayc_t *child); 16swayc_t *remove_child(swayc_t *child);
17 17
18//Layout 18// Layout
19void arrange_windows(swayc_t *container, int width, int height); 19void arrange_windows(swayc_t *container, int width, int height);
20 20
21//Focus 21// Focus
22void unfocus_all(swayc_t *container); 22void unfocus_all(swayc_t *container);
23void focus_view(swayc_t *view); 23void focus_view(swayc_t *view);
24void focus_view_for(swayc_t *ancestor, swayc_t *container); 24void focus_view_for(swayc_t *ancestor, swayc_t *container);