aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-04-02 15:30:58 -0400
committeremersion <contact@emersion.fr>2018-04-02 15:30:58 -0400
commita4a241697ae591289d7c14eff972e1ef787216e2 (patch)
treed82d3c3eba2946670aa634a62d03feb7102f0bf8 /include
parent2f64ce86c47efb2ee4c0e3a3c2b31307d21404d9 (diff)
parent0c0cc79282b5ce29616893977aca629f90521988 (diff)
Merge branch 'wlroots' into view-redesign
Diffstat (limited to 'include')
-rw-r--r--include/sway/config.h27
-rw-r--r--include/sway/input/input-manager.h23
-rw-r--r--include/sway/input/seat.h28
-rw-r--r--include/sway/output.h2
-rw-r--r--include/sway/tree/container.h5
-rw-r--r--include/sway/tree/layout.h12
-rw-r--r--include/swaybar/ipc.h2
-rw-r--r--include/swaybar/status_line.h53
8 files changed, 118 insertions, 34 deletions
diff --git a/include/sway/config.h b/include/sway/config.h
index 03b51948..91f772b5 100644
--- a/include/sway/config.h
+++ b/include/sway/config.h
@@ -377,6 +377,7 @@ void free_config(struct sway_config *config);
void config_clear_handler_context(struct sway_config *config);
void free_sway_variable(struct sway_variable *var);
+
/**
* Does variable replacement for a string based on the config's currently loaded variables.
*/
@@ -385,44 +386,68 @@ char *do_var_replacement(char *str);
struct cmd_results *check_security_config();
int input_identifier_cmp(const void *item, const void *data);
+
struct input_config *new_input_config(const char* identifier);
+
void merge_input_config(struct input_config *dst, struct input_config *src);
+
struct input_config *copy_input_config(struct input_config *ic);
+
void free_input_config(struct input_config *ic);
+
void apply_input_config(struct input_config *input);
int seat_name_cmp(const void *item, const void *data);
+
struct seat_config *new_seat_config(const char* name);
+
void merge_seat_config(struct seat_config *dst, struct seat_config *src);
+
struct seat_config *copy_seat_config(struct seat_config *seat);
+
void free_seat_config(struct seat_config *ic);
+
struct seat_attachment_config *seat_attachment_config_new();
+
struct seat_attachment_config *seat_config_get_attachment(
struct seat_config *seat_config, char *identifier);
+
void apply_seat_config(struct seat_config *seat);
int output_name_cmp(const void *item, const void *data);
+
void output_get_identifier(char *identifier, size_t len,
struct sway_output *output);
+
struct output_config *new_output_config(const char *name);
+
void merge_output_config(struct output_config *dst, struct output_config *src);
+
void apply_output_config(struct output_config *oc,
struct sway_container *output);
+
void free_output_config(struct output_config *oc);
int workspace_output_cmp_workspace(const void *a, const void *b);
int sway_binding_cmp(const void *a, const void *b);
+
int sway_binding_cmp_qsort(const void *a, const void *b);
+
int sway_binding_cmp_keys(const void *a, const void *b);
+
void free_sway_binding(struct sway_binding *sb);
+
struct sway_binding *sway_binding_dup(struct sway_binding *sb);
-/* Bar stuff */
void load_swaybars();
+
void invoke_swaybar(struct bar_config *bar);
+
void terminate_swaybg(pid_t pid);
+
struct bar_config *default_bar_config(void);
+
void free_bar_config(struct bar_config *bar);
/* Global config singleton. */
diff --git a/include/sway/input/input-manager.h b/include/sway/input/input-manager.h
index c6c73dba..8e39a4a7 100644
--- a/include/sway/input/input-manager.h
+++ b/include/sway/input/input-manager.h
@@ -14,7 +14,6 @@ extern struct sway_input_manager *input_manager;
struct sway_input_device {
char *identifier;
struct wlr_input_device *wlr_device;
- struct input_config *config;
struct wl_list link;
struct wl_listener device_destroy;
};
@@ -27,30 +26,34 @@ struct sway_input_manager {
struct wl_listener new_input;
};
-struct sway_input_manager *sway_input_manager_create(
- struct sway_server *server);
+struct sway_input_manager *input_manager_create(struct sway_server *server);
-bool sway_input_manager_has_focus(struct sway_input_manager *input,
+bool input_manager_has_focus(struct sway_input_manager *input,
struct sway_container *container);
-void sway_input_manager_set_focus(struct sway_input_manager *input,
+void input_manager_set_focus(struct sway_input_manager *input,
struct sway_container *container);
-void sway_input_manager_configure_xcursor(struct sway_input_manager *input);
+void input_manager_configure_xcursor(struct sway_input_manager *input);
-void sway_input_manager_apply_input_config(struct sway_input_manager *input,
+void input_manager_apply_input_config(struct sway_input_manager *input,
struct input_config *input_config);
-void sway_input_manager_apply_seat_config(struct sway_input_manager *input,
+void input_manager_apply_seat_config(struct sway_input_manager *input,
struct seat_config *seat_config);
-struct sway_seat *sway_input_manager_get_default_seat(
+struct sway_seat *input_manager_get_default_seat(
struct sway_input_manager *input);
struct sway_seat *input_manager_get_seat(struct sway_input_manager *input,
const char *seat_name);
-/** Gets the last seat the user interacted with */
+/**
+ * Gets the last seat the user interacted with
+ */
struct sway_seat *input_manager_current_seat(struct sway_input_manager *input);
+struct input_config *input_device_get_config(struct sway_input_device *device);
+
+
#endif
diff --git a/include/sway/input/seat.h b/include/sway/input/seat.h
index 31210a5a..5c3c2c4f 100644
--- a/include/sway/input/seat.h
+++ b/include/sway/input/seat.h
@@ -8,7 +8,6 @@ struct sway_seat_device {
struct sway_seat *sway_seat;
struct sway_input_device *input_device;
struct sway_keyboard *keyboard;
- struct seat_attachment_config *attachment_config;
struct wl_list link; // sway_seat::devices
};
@@ -23,7 +22,6 @@ struct sway_seat_container {
struct sway_seat {
struct wlr_seat *wlr_seat;
- struct seat_config *config;
struct sway_cursor *cursor;
struct sway_input_manager *input;
@@ -38,28 +36,28 @@ struct sway_seat {
struct wl_list link; // input_manager::seats
};
-struct sway_seat *sway_seat_create(struct sway_input_manager *input,
+struct sway_seat *seat_create(struct sway_input_manager *input,
const char *seat_name);
-void sway_seat_destroy(struct sway_seat *seat);
+void seat_destroy(struct sway_seat *seat);
-void sway_seat_add_device(struct sway_seat *seat,
+void seat_add_device(struct sway_seat *seat,
struct sway_input_device *device);
-void sway_seat_configure_device(struct sway_seat *seat,
+void seat_configure_device(struct sway_seat *seat,
struct sway_input_device *device);
-void sway_seat_remove_device(struct sway_seat *seat,
+void seat_remove_device(struct sway_seat *seat,
struct sway_input_device *device);
-void sway_seat_configure_xcursor(struct sway_seat *seat);
+void seat_configure_xcursor(struct sway_seat *seat);
-void sway_seat_set_focus(struct sway_seat *seat, struct sway_container *container);
+void seat_set_focus(struct sway_seat *seat, struct sway_container *container);
-void sway_seat_set_focus_warp(struct sway_seat *seat,
+void seat_set_focus_warp(struct sway_seat *seat,
struct sway_container *container, bool warp);
-struct sway_container *sway_seat_get_focus(struct sway_seat *seat);
+struct sway_container *seat_get_focus(struct sway_seat *seat);
/**
* Return the last container to be focused for the seat (or the most recently
@@ -70,12 +68,14 @@ struct sway_container *sway_seat_get_focus(struct sway_seat *seat);
* is destroyed, or focus moves to a container with children and we need to
* descend into the next leaf in focus order.
*/
-struct sway_container *sway_seat_get_focus_inactive(struct sway_seat *seat,
+struct sway_container *seat_get_focus_inactive(struct sway_seat *seat,
struct sway_container *container);
-struct sway_container *sway_seat_get_focus_by_type(struct sway_seat *seat,
+struct sway_container *seat_get_focus_by_type(struct sway_seat *seat,
enum sway_container_type type);
-void sway_seat_set_config(struct sway_seat *seat, struct seat_config *seat_config);
+void seat_apply_config(struct sway_seat *seat, struct seat_config *seat_config);
+
+struct seat_config *seat_get_config(struct sway_seat *seat);
#endif
diff --git a/include/sway/output.h b/include/sway/output.h
index cfe7502b..98d0f83f 100644
--- a/include/sway/output.h
+++ b/include/sway/output.h
@@ -37,4 +37,6 @@ void output_damage_whole(struct sway_output *output);
void output_damage_whole_view(struct sway_output *output,
struct sway_view *view);
+struct sway_container *output_by_name(const char *name);
+
#endif
diff --git a/include/sway/tree/container.h b/include/sway/tree/container.h
index 423c0a22..bd02197c 100644
--- a/include/sway/tree/container.h
+++ b/include/sway/tree/container.h
@@ -85,9 +85,14 @@ struct sway_container {
struct {
struct wl_signal destroy;
+ // Raised after the tree updates, but before arrange_windows
+ // Passed the previous parent
+ struct wl_signal reparent;
} events;
};
+const char *container_type_to_str(enum sway_container_type type);
+
// TODO only one container create function and pass the type?
struct sway_container *container_output_create(
struct sway_output *sway_output);
diff --git a/include/sway/tree/layout.h b/include/sway/tree/layout.h
index fecf1582..a14152e8 100644
--- a/include/sway/tree/layout.h
+++ b/include/sway/tree/layout.h
@@ -11,9 +11,6 @@ enum movement_direction {
MOVE_DOWN,
MOVE_PARENT,
MOVE_CHILD,
- MOVE_NEXT,
- MOVE_PREV,
- MOVE_FIRST
};
struct sway_container;
@@ -32,7 +29,8 @@ struct sway_root {
void layout_init(void);
-void container_add_child(struct sway_container *parent, struct sway_container *child);
+void container_add_child(struct sway_container *parent,
+ struct sway_container *child);
struct sway_container *container_add_sibling(struct sway_container *parent,
struct sway_container *child);
@@ -44,7 +42,11 @@ struct sway_container *container_reap_empty(struct sway_container *container);
void container_move_to(struct sway_container* container,
struct sway_container* destination);
-enum sway_container_layout container_get_default_layout(struct sway_container *output);
+void container_move(struct sway_container *container,
+ enum movement_direction dir, int move_amt);
+
+enum sway_container_layout container_get_default_layout(
+ struct sway_container *output);
void container_sort_workspaces(struct sway_container *output);
diff --git a/include/swaybar/ipc.h b/include/swaybar/ipc.h
index 6ea7c4d6..a1696bcf 100644
--- a/include/swaybar/ipc.h
+++ b/include/swaybar/ipc.h
@@ -4,7 +4,7 @@
#include "swaybar/bar.h"
void ipc_initialize(struct swaybar *bar, const char *bar_id);
-bool handle_ipc_event(struct swaybar *bar);
+bool handle_ipc_readable(struct swaybar *bar);
void ipc_get_workspaces(struct swaybar *bar);
void ipc_send_workspace_command(struct swaybar *bar, const char *ws);
diff --git a/include/swaybar/status_line.h b/include/swaybar/status_line.h
index 6c595df0..3538f49c 100644
--- a/include/swaybar/status_line.h
+++ b/include/swaybar/status_line.h
@@ -7,10 +7,52 @@
enum status_protocol {
PROTOCOL_UNDEF,
+ PROTOCOL_ERROR,
PROTOCOL_TEXT,
PROTOCOL_I3BAR,
};
+struct text_protocol_state {
+ char *buffer;
+ size_t buffer_size;
+};
+
+enum json_node_type {
+ JSON_NODE_UNKNOWN,
+ JSON_NODE_ARRAY,
+ JSON_NODE_STRING,
+};
+
+struct i3bar_protocol_state {
+ bool click_events;
+ char *buffer;
+ size_t buffer_size;
+ size_t buffer_index;
+ const char *current_node;
+ bool escape;
+ size_t depth;
+ enum json_node_type nodes[16];
+};
+
+struct i3bar_block {
+ struct wl_list link;
+ char *full_text, *short_text, *align;
+ bool urgent;
+ uint32_t *color;
+ int min_width;
+ char *name, *instance;
+ bool separator;
+ int separator_block_width;
+ bool markup;
+ // Airblader features
+ uint32_t background;
+ uint32_t border;
+ int border_top;
+ int border_bottom;
+ int border_left;
+ int border_right;
+};
+
struct status_line {
pid_t pid;
int read_fd, write_fd;
@@ -18,13 +60,18 @@ struct status_line {
enum status_protocol protocol;
const char *text;
+ struct wl_list blocks; // i3bar_block::link
- char *buffer;
- size_t buffer_size;
+ struct text_protocol_state text_state;
+ struct i3bar_protocol_state i3bar_state;
};
struct status_line *status_line_init(char *cmd);
+void status_error(struct status_line *status, const char *text);
+bool status_handle_readable(struct status_line *status);
void status_line_free(struct status_line *status);
-bool handle_status_readable(struct status_line *status);
+bool i3bar_handle_readable(struct status_line *status);
+void i3bar_block_send_click(struct status_line *status,
+ struct i3bar_block *block, int x, int y, uint32_t button);
#endif