aboutsummaryrefslogtreecommitdiffstats
path: root/sway/ipc-json.c
diff options
context:
space:
mode:
authorLibravatar Tony Crisci <tony@dubstepdish.com>2018-03-29 23:41:33 -0400
committerLibravatar Tony Crisci <tony@dubstepdish.com>2018-03-29 23:41:33 -0400
commitdc8c9fbeb664518c76066cc28ee29452c6c30128 (patch)
tree88c2de0d08e00b2a30cb20cdfadfa6e53f5c59b4 /sway/ipc-json.c
parentMerge pull request #1653 from swaywm/revert-1647-refactor-tree (diff)
downloadsway-dc8c9fbeb664518c76066cc28ee29452c6c30128.tar.gz
sway-dc8c9fbeb664518c76066cc28ee29452c6c30128.tar.zst
sway-dc8c9fbeb664518c76066cc28ee29452c6c30128.zip
Revert "Merge pull request #1653 from swaywm/revert-1647-refactor-tree"
Diffstat (limited to 'sway/ipc-json.c')
-rw-r--r--sway/ipc-json.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/sway/ipc-json.c b/sway/ipc-json.c
index 977f1ecb..7caa2457 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/container.h" 6#include "sway/tree/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
28static json_object *ipc_json_create_rect(swayc_t *c) { 28static json_object *ipc_json_create_rect(struct sway_container *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(swayc_t *c) {
36 return rect; 36 return rect;
37} 37}
38 38
39static void ipc_json_describe_root(swayc_t *root, json_object *object) { 39static void ipc_json_describe_root(struct sway_container *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
66static void ipc_json_describe_output(swayc_t *container, json_object *object) { 66static void ipc_json_describe_output(struct sway_container *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(swayc_t *container, json_object *object) {
94 json_object_object_add(object, "modes", modes_array); 94 json_object_object_add(object, "modes", modes_array);
95} 95}
96 96
97static void ipc_json_describe_workspace(swayc_t *workspace, json_object *object) { 97static void ipc_json_describe_workspace(struct sway_container *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(swayc_t *workspace, json_object *object)
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
105static void ipc_json_describe_view(swayc_t *c, json_object *object) { 105static void ipc_json_describe_view(struct sway_container *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
109json_object *ipc_json_describe_container(swayc_t *c) { 109json_object *ipc_json_describe_container(struct sway_container *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(swayc_t *c) {
147 return object; 147 return object;
148} 148}
149 149
150json_object *ipc_json_describe_container_recursive(swayc_t *c) { 150json_object *ipc_json_describe_container_recursive(struct sway_container *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