mirror of
https://github.com/swaywm/sway.git
synced 2026-04-28 06:46:26 -04:00
ipc: add function hooks to ipc_json_describe_node*
This makes it easier to have an alternative json output for compatibility purposes, and is preparative work for serving a mimicked i3 output on I3SOCK. Signed-off-by: Franklin "Snaipe" Mathieu <me@snai.pe>
This commit is contained in:
parent
91c1a52595
commit
822b5897ad
6 changed files with 107 additions and 77 deletions
|
|
@ -4,16 +4,27 @@
|
|||
#include "sway/tree/container.h"
|
||||
#include "sway/input/input-manager.h"
|
||||
|
||||
typedef void (*ipc_json_descriptor)(struct sway_node *, json_object *);
|
||||
typedef ipc_json_descriptor ipc_json_descriptor_map[NUM_NODE_TYPES];
|
||||
|
||||
json_object *ipc_json_success(void);
|
||||
json_object *ipc_json_failure(const char *error);
|
||||
|
||||
json_object *ipc_json_get_version(void);
|
||||
|
||||
json_object *ipc_json_describe_disabled_output(struct sway_output *o);
|
||||
json_object *ipc_json_describe_node(struct sway_node *node);
|
||||
json_object *ipc_json_describe_node_recursive(struct sway_node *node);
|
||||
json_object *ipc_json_describe_node(struct sway_node *node,
|
||||
const ipc_json_descriptor_map *desc);
|
||||
json_object *ipc_json_describe_node_recursive(struct sway_node *node,
|
||||
const ipc_json_descriptor_map *desc);
|
||||
json_object *ipc_json_describe_input(struct sway_input_device *device);
|
||||
json_object *ipc_json_describe_seat(struct sway_seat *seat);
|
||||
json_object *ipc_json_describe_bar_config(struct bar_config *bar);
|
||||
void ipc_json_describe_container(struct sway_container *c, json_object *object);
|
||||
void ipc_json_describe_view_common(struct sway_container *c, json_object *object);
|
||||
|
||||
void ipc_json_describe_output(struct sway_node *node, json_object *object);
|
||||
void ipc_json_describe_root(struct sway_node *node, json_object *object);
|
||||
void ipc_json_describe_workspace(struct sway_node *node, json_object *object);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -31,4 +31,6 @@ json_object *ipc_sway_send_tick(struct ipc_client *client,
|
|||
json_object *ipc_sway_subscribe(struct ipc_client *client,
|
||||
enum ipc_command_type *type, char *buf);
|
||||
|
||||
extern const ipc_json_descriptor_map ipc_json_sway_descriptors;
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@ enum sway_node_type {
|
|||
N_CONTAINER,
|
||||
};
|
||||
|
||||
#define NUM_NODE_TYPES ((size_t)(N_CONTAINER + 1))
|
||||
|
||||
struct sway_node {
|
||||
enum sway_node_type type;
|
||||
union {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue