aboutsummaryrefslogtreecommitdiffstats
path: root/include/sway/old/commands.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/sway/old/commands.h')
-rw-r--r--include/sway/old/commands.h214
1 files changed, 0 insertions, 214 deletions
diff --git a/include/sway/old/commands.h b/include/sway/old/commands.h
deleted file mode 100644
index 660da2c2..00000000
--- a/include/sway/old/commands.h
+++ /dev/null
@@ -1,214 +0,0 @@
1#ifndef _SWAY_COMMANDS_H
2#define _SWAY_COMMANDS_H
3#include <stdbool.h>
4#include <json-c/json.h>
5#include <wlc/wlc.h>
6#include "config.h"
7
8// Container that a called command should act upon. Only valid in command functions.
9extern swayc_t *current_container;
10
11/**
12 * Indicates the result of a command's execution.
13 */
14enum cmd_status {
15 CMD_SUCCESS, /**< The command was successful */
16 CMD_FAILURE, /**< The command resulted in an error */
17 CMD_INVALID, /**< Unknown command or parser error */
18 CMD_DEFER, /**< Command execution deferred */
19 // Config Blocks
20 CMD_BLOCK_END,
21 CMD_BLOCK_MODE,
22 CMD_BLOCK_BAR,
23 CMD_BLOCK_BAR_COLORS,
24 CMD_BLOCK_INPUT,
25 CMD_BLOCK_COMMANDS,
26 CMD_BLOCK_IPC,
27 CMD_BLOCK_IPC_EVENTS,
28};
29
30/**
31 * Stores the result of executing a command.
32 */
33struct cmd_results {
34 enum cmd_status status;
35 char *input;
36 /**
37 * Human friendly error message, or NULL on success
38 */
39 char *error;
40};
41
42enum expected_args {
43 EXPECTED_MORE_THAN,
44 EXPECTED_AT_LEAST,
45 EXPECTED_LESS_THAN,
46 EXPECTED_EQUAL_TO
47};
48
49struct cmd_results *checkarg(int argc, const char *name, enum expected_args type, int val);
50struct cmd_results *add_color(const char*, char*, const char*);
51void input_cmd_apply(struct input_config *input);
52void hide_view_in_scratchpad(swayc_t *sp_view);
53
54swayc_t *sp_view;
55int sp_index;
56
57/**
58 * Parse and handles a command.
59 */
60struct cmd_results *handle_command(char *command, enum command_context context);
61/**
62 * Parse and handles a command during config file loading.
63 *
64 * Do not use this under normal conditions.
65 */
66struct cmd_results *config_command(char *command, enum cmd_status block);
67/*
68 * Parses a command policy rule.
69 */
70struct cmd_results *config_commands_command(char *exec);
71
72/**
73 * Allocates a cmd_results object.
74 */
75struct cmd_results *cmd_results_new(enum cmd_status status, const char* input, const char *error, ...);
76/**
77 * Frees a cmd_results object.
78 */
79void free_cmd_results(struct cmd_results *results);
80/**
81 * Serializes cmd_results to a JSON string.
82 *
83 * Free the JSON string later on.
84 */
85const char *cmd_results_to_json(struct cmd_results *results);
86
87void remove_view_from_scratchpad(swayc_t *);
88
89/**
90 * Actual command function signatures for individual .c files in commands/ directory.
91 */
92
93typedef struct cmd_results *sway_cmd(int argc, char **argv);
94
95sway_cmd cmd_assign;
96sway_cmd cmd_bar;
97sway_cmd cmd_bindcode;
98sway_cmd cmd_bindsym;
99sway_cmd cmd_border;
100sway_cmd cmd_client_focused;
101sway_cmd cmd_client_focused_inactive;
102sway_cmd cmd_client_unfocused;
103sway_cmd cmd_client_urgent;
104sway_cmd cmd_client_placeholder;
105sway_cmd cmd_client_background;
106sway_cmd cmd_clipboard;
107sway_cmd cmd_commands;
108sway_cmd cmd_debuglog;
109sway_cmd cmd_default_border;
110sway_cmd cmd_default_floating_border;
111sway_cmd cmd_exec;
112sway_cmd cmd_exec_always;
113sway_cmd cmd_exit;
114sway_cmd cmd_floating;
115sway_cmd cmd_floating_maximum_size;
116sway_cmd cmd_floating_minimum_size;
117sway_cmd cmd_floating_mod;
118sway_cmd cmd_floating_scroll;
119sway_cmd cmd_focus;
120sway_cmd cmd_focus_follows_mouse;
121sway_cmd cmd_font;
122sway_cmd cmd_for_window;
123sway_cmd cmd_force_focus_wrapping;
124sway_cmd cmd_fullscreen;
125sway_cmd cmd_gaps;
126sway_cmd cmd_hide_edge_borders;
127sway_cmd cmd_include;
128sway_cmd cmd_input;
129sway_cmd cmd_ipc;
130sway_cmd cmd_kill;
131sway_cmd cmd_layout;
132sway_cmd cmd_log_colors;
133sway_cmd cmd_mark;
134sway_cmd cmd_mode;
135sway_cmd cmd_mouse_warping;
136sway_cmd cmd_move;
137sway_cmd cmd_new_float;
138sway_cmd cmd_new_window;
139sway_cmd cmd_no_focus;
140sway_cmd cmd_orientation;
141sway_cmd cmd_output;
142sway_cmd cmd_permit;
143sway_cmd cmd_reject;
144sway_cmd cmd_reload;
145sway_cmd cmd_resize;
146sway_cmd cmd_scratchpad;
147sway_cmd cmd_seamless_mouse;
148sway_cmd cmd_set;
149sway_cmd cmd_show_marks;
150sway_cmd cmd_smart_gaps;
151sway_cmd cmd_split;
152sway_cmd cmd_splith;
153sway_cmd cmd_splitt;
154sway_cmd cmd_splitv;
155sway_cmd cmd_sticky;
156sway_cmd cmd_unmark;
157sway_cmd cmd_workspace;
158sway_cmd cmd_ws_auto_back_and_forth;
159sway_cmd cmd_workspace_layout;
160
161sway_cmd bar_cmd_activate_button;
162sway_cmd bar_cmd_binding_mode_indicator;
163sway_cmd bar_cmd_bindsym;
164sway_cmd bar_cmd_colors;
165sway_cmd bar_cmd_context_button;
166sway_cmd bar_cmd_font;
167sway_cmd bar_cmd_mode;
168sway_cmd bar_cmd_modifier;
169sway_cmd bar_cmd_output;
170sway_cmd bar_cmd_height;
171sway_cmd bar_cmd_hidden_state;
172sway_cmd bar_cmd_icon_theme;
173sway_cmd bar_cmd_id;
174sway_cmd bar_cmd_position;
175sway_cmd bar_cmd_secondary_button;
176sway_cmd bar_cmd_separator_symbol;
177sway_cmd bar_cmd_status_command;
178sway_cmd bar_cmd_pango_markup;
179sway_cmd bar_cmd_strip_workspace_numbers;
180sway_cmd bar_cmd_swaybar_command;
181sway_cmd bar_cmd_tray_output;
182sway_cmd bar_cmd_tray_padding;
183sway_cmd bar_cmd_wrap_scroll;
184sway_cmd bar_cmd_workspace_buttons;
185
186sway_cmd bar_colors_cmd_active_workspace;
187sway_cmd bar_colors_cmd_background;
188sway_cmd bar_colors_cmd_focused_background;
189sway_cmd bar_colors_cmd_binding_mode;
190sway_cmd bar_colors_cmd_focused_workspace;
191sway_cmd bar_colors_cmd_inactive_workspace;
192sway_cmd bar_colors_cmd_separator;
193sway_cmd bar_colors_cmd_focused_separator;
194sway_cmd bar_colors_cmd_statusline;
195sway_cmd bar_colors_cmd_focused_statusline;
196sway_cmd bar_colors_cmd_urgent_workspace;
197
198sway_cmd input_cmd_accel_profile;
199sway_cmd input_cmd_click_method;
200sway_cmd input_cmd_drag_lock;
201sway_cmd input_cmd_dwt;
202sway_cmd input_cmd_events;
203sway_cmd input_cmd_left_handed;
204sway_cmd input_cmd_middle_emulation;
205sway_cmd input_cmd_natural_scroll;
206sway_cmd input_cmd_pointer_accel;
207sway_cmd input_cmd_scroll_method;
208sway_cmd input_cmd_tap;
209
210sway_cmd cmd_ipc_cmd;
211sway_cmd cmd_ipc_events;
212sway_cmd cmd_ipc_event_cmd;
213
214#endif