diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-03-29 23:29:29 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-29 23:29:29 -0400 |
commit | d0c7f66e950689b70196a890b62b82ff3c66e103 (patch) | |
tree | b8b52173a9791e3b13a0316ab9d316a80a6adc20 /sway/ipc-json.c | |
parent | Merge pull request #1647 from acrisci/refactor-tree (diff) | |
download | sway-d0c7f66e950689b70196a890b62b82ff3c66e103.tar.gz sway-d0c7f66e950689b70196a890b62b82ff3c66e103.tar.zst sway-d0c7f66e950689b70196a890b62b82ff3c66e103.zip |
Revert "Refactor tree"
Diffstat (limited to 'sway/ipc-json.c')
-rw-r--r-- | sway/ipc-json.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sway/ipc-json.c b/sway/ipc-json.c index 7caa2457..977f1ecb 100644 --- a/sway/ipc-json.c +++ b/sway/ipc-json.c | |||
@@ -3,7 +3,7 @@ | |||
3 | #include <ctype.h> | 3 | #include <ctype.h> |
4 | #include "log.h" | 4 | #include "log.h" |
5 | #include "sway/ipc-json.h" | 5 | #include "sway/ipc-json.h" |
6 | #include "sway/tree/container.h" | 6 | #include "sway/container.h" |
7 | #include "sway/output.h" | 7 | #include "sway/output.h" |
8 | #include "sway/input/input-manager.h" | 8 | #include "sway/input/input-manager.h" |
9 | #include "sway/input/seat.h" | 9 | #include "sway/input/seat.h" |
@@ -25,7 +25,7 @@ json_object *ipc_json_get_version() { | |||
25 | return version; | 25 | return version; |
26 | } | 26 | } |
27 | 27 | ||
28 | static json_object *ipc_json_create_rect(struct sway_container *c) { | 28 | static json_object *ipc_json_create_rect(swayc_t *c) { |
29 | json_object *rect = json_object_new_object(); | 29 | json_object *rect = json_object_new_object(); |
30 | 30 | ||
31 | json_object_object_add(rect, "x", json_object_new_int((int32_t)c->x)); | 31 | json_object_object_add(rect, "x", json_object_new_int((int32_t)c->x)); |
@@ -36,7 +36,7 @@ static json_object *ipc_json_create_rect(struct sway_container *c) { | |||
36 | return rect; | 36 | return rect; |
37 | } | 37 | } |
38 | 38 | ||
39 | static void ipc_json_describe_root(struct sway_container *root, json_object *object) { | 39 | static void ipc_json_describe_root(swayc_t *root, json_object *object) { |
40 | json_object_object_add(object, "type", json_object_new_string("root")); | 40 | json_object_object_add(object, "type", json_object_new_string("root")); |
41 | json_object_object_add(object, "layout", json_object_new_string("splith")); | 41 | json_object_object_add(object, "layout", json_object_new_string("splith")); |
42 | } | 42 | } |
@@ -63,7 +63,7 @@ static const char *ipc_json_get_output_transform(enum wl_output_transform transf | |||
63 | return NULL; | 63 | return NULL; |
64 | } | 64 | } |
65 | 65 | ||
66 | static void ipc_json_describe_output(struct sway_container *container, json_object *object) { | 66 | static void ipc_json_describe_output(swayc_t *container, json_object *object) { |
67 | struct wlr_output *wlr_output = container->sway_output->wlr_output; | 67 | struct wlr_output *wlr_output = container->sway_output->wlr_output; |
68 | json_object_object_add(object, "type", json_object_new_string("output")); | 68 | json_object_object_add(object, "type", json_object_new_string("output")); |
69 | json_object_object_add(object, "active", json_object_new_boolean(true)); | 69 | json_object_object_add(object, "active", json_object_new_boolean(true)); |
@@ -94,7 +94,7 @@ static void ipc_json_describe_output(struct sway_container *container, json_obje | |||
94 | json_object_object_add(object, "modes", modes_array); | 94 | json_object_object_add(object, "modes", modes_array); |
95 | } | 95 | } |
96 | 96 | ||
97 | static void ipc_json_describe_workspace(struct sway_container *workspace, json_object *object) { | 97 | static void ipc_json_describe_workspace(swayc_t *workspace, json_object *object) { |
98 | int num = (isdigit(workspace->name[0])) ? atoi(workspace->name) : -1; | 98 | int num = (isdigit(workspace->name[0])) ? atoi(workspace->name) : -1; |
99 | 99 | ||
100 | json_object_object_add(object, "num", json_object_new_int(num)); | 100 | json_object_object_add(object, "num", json_object_new_int(num)); |
@@ -102,11 +102,11 @@ static void ipc_json_describe_workspace(struct sway_container *workspace, json_o | |||
102 | json_object_object_add(object, "type", json_object_new_string("workspace")); | 102 | json_object_object_add(object, "type", json_object_new_string("workspace")); |
103 | } | 103 | } |
104 | 104 | ||
105 | static void ipc_json_describe_view(struct sway_container *c, json_object *object) { | 105 | static void ipc_json_describe_view(swayc_t *c, json_object *object) { |
106 | json_object_object_add(object, "name", (c->name) ? json_object_new_string(c->name) : NULL); | 106 | json_object_object_add(object, "name", (c->name) ? json_object_new_string(c->name) : NULL); |
107 | } | 107 | } |
108 | 108 | ||
109 | json_object *ipc_json_describe_container(struct sway_container *c) { | 109 | json_object *ipc_json_describe_container(swayc_t *c) { |
110 | if (!(sway_assert(c, "Container must not be null."))) { | 110 | if (!(sway_assert(c, "Container must not be null."))) { |
111 | return NULL; | 111 | return NULL; |
112 | } | 112 | } |
@@ -147,7 +147,7 @@ json_object *ipc_json_describe_container(struct sway_container *c) { | |||
147 | return object; | 147 | return object; |
148 | } | 148 | } |
149 | 149 | ||
150 | json_object *ipc_json_describe_container_recursive(struct sway_container *c) { | 150 | json_object *ipc_json_describe_container_recursive(swayc_t *c) { |
151 | json_object *object = ipc_json_describe_container(c); | 151 | json_object *object = ipc_json_describe_container(c); |
152 | int i; | 152 | int i; |
153 | 153 | ||