commit f16aa3c0ad8328da0820e81c99a619835f36082f
parent f4a5a0ead4c8b155985c242db1fa5de5fa4807a0
Author: Tony Crisci <tony@dubstepdish.com>
Date: Sat, 16 Dec 2017 12:14:24 -0500
rename config apply cmds
Diffstat:
20 files changed, 37 insertions(+), 22 deletions(-)
diff --git a/include/sway/commands.h b/include/sway/commands.h
@@ -42,9 +42,6 @@ enum expected_args {
EXPECTED_EQUAL_TO
};
-void input_cmd_apply(struct input_config *input);
-void seat_cmd_apply(struct seat_config *seat);
-
struct cmd_results *checkarg(int argc, const char *name,
enum expected_args type, int val);
diff --git a/include/sway/config.h b/include/sway/config.h
@@ -384,6 +384,7 @@ 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);
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);
@@ -392,6 +393,7 @@ 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);
struct output_config *new_output_config();
diff --git a/sway/commands.c b/sway/commands.c
@@ -57,7 +57,7 @@ struct cmd_results *checkarg(int argc, const char *name, enum expected_args type
return error;
}
-void input_cmd_apply(struct input_config *input) {
+void apply_input_config(struct input_config *input) {
int i;
i = list_seq_find(config->input_configs, input_identifier_cmp, input->identifier);
if (i >= 0) {
@@ -74,7 +74,7 @@ void input_cmd_apply(struct input_config *input) {
sway_input_manager_apply_input_config(input_manager, input);
}
-void seat_cmd_apply(struct seat_config *seat) {
+void apply_seat_config(struct seat_config *seat) {
int i;
i = list_seq_find(config->seat_configs, seat_name_cmp, seat->name);
if (i >= 0) {
diff --git a/sway/commands/input/accel_profile.c b/sway/commands/input/accel_profile.c
@@ -1,5 +1,6 @@
#include <string.h>
#include <strings.h>
+#include "sway/config.h"
#include "sway/commands.h"
#include "sway/input/input-manager.h"
@@ -24,6 +25,6 @@ struct cmd_results *input_cmd_accel_profile(int argc, char **argv) {
"Expected 'accel_profile <adaptive|flat>'");
}
- input_cmd_apply(new_config);
+ apply_input_config(new_config);
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
}
diff --git a/sway/commands/input/click_method.c b/sway/commands/input/click_method.c
@@ -1,6 +1,7 @@
#include <string.h>
#include <strings.h>
#include "sway/commands.h"
+#include "sway/config.h"
#include "sway/input/input-manager.h"
#include "log.h"
@@ -29,6 +30,6 @@ struct cmd_results *input_cmd_click_method(int argc, char **argv) {
"Expected 'click_method <none|button_areas|clickfinger'");
}
- input_cmd_apply(new_config);
+ apply_input_config(new_config);
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
}
diff --git a/sway/commands/input/drag_lock.c b/sway/commands/input/drag_lock.c
@@ -1,5 +1,6 @@
#include <string.h>
#include <strings.h>
+#include "sway/config.h"
#include "sway/commands.h"
#include "sway/input/input-manager.h"
@@ -24,6 +25,6 @@ struct cmd_results *input_cmd_drag_lock(int argc, char **argv) {
"Expected 'drag_lock <enabled|disabled>'");
}
- input_cmd_apply(new_config);
+ apply_input_config(new_config);
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
}
diff --git a/sway/commands/input/dwt.c b/sway/commands/input/dwt.c
@@ -1,5 +1,6 @@
#include <string.h>
#include <strings.h>
+#include "sway/config.h"
#include "sway/commands.h"
#include "sway/input/input-manager.h"
@@ -23,6 +24,6 @@ struct cmd_results *input_cmd_dwt(int argc, char **argv) {
"Expected 'dwt <enabled|disabled>'");
}
- input_cmd_apply(new_config);
+ apply_input_config(new_config);
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
}
diff --git a/sway/commands/input/events.c b/sway/commands/input/events.c
@@ -1,5 +1,6 @@
#include <string.h>
#include <strings.h>
+#include "sway/config.h"
#include "sway/commands.h"
#include "sway/input/input-manager.h"
#include "log.h"
@@ -30,6 +31,6 @@ struct cmd_results *input_cmd_events(int argc, char **argv) {
"Expected 'events <enabled|disabled|disabled_on_external_mouse>'");
}
- input_cmd_apply(new_config);
+ apply_input_config(new_config);
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
}
diff --git a/sway/commands/input/left_handed.c b/sway/commands/input/left_handed.c
@@ -1,5 +1,6 @@
#include <string.h>
#include <strings.h>
+#include "sway/config.h"
#include "sway/commands.h"
#include "sway/input/input-manager.h"
@@ -24,6 +25,6 @@ struct cmd_results *input_cmd_left_handed(int argc, char **argv) {
"Expected 'left_handed <enabled|disabled>'");
}
- input_cmd_apply(new_config);
+ apply_input_config(new_config);
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
}
diff --git a/sway/commands/input/middle_emulation.c b/sway/commands/input/middle_emulation.c
@@ -1,5 +1,6 @@
#include <string.h>
#include <strings.h>
+#include "sway/config.h"
#include "sway/commands.h"
#include "sway/input/input-manager.h"
@@ -25,6 +26,6 @@ struct cmd_results *input_cmd_middle_emulation(int argc, char **argv) {
"Expected 'middle_emulation <enabled|disabled>'");
}
- input_cmd_apply(new_config);
+ apply_input_config(new_config);
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
}
diff --git a/sway/commands/input/natural_scroll.c b/sway/commands/input/natural_scroll.c
@@ -1,5 +1,6 @@
#include <string.h>
#include <strings.h>
+#include "sway/config.h"
#include "sway/commands.h"
#include "sway/input/input-manager.h"
@@ -24,6 +25,6 @@ struct cmd_results *input_cmd_natural_scroll(int argc, char **argv) {
"Expected 'natural_scroll <enabled|disabled>'");
}
- input_cmd_apply(new_config);
+ apply_input_config(new_config);
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
}
diff --git a/sway/commands/input/pointer_accel.c b/sway/commands/input/pointer_accel.c
@@ -1,5 +1,6 @@
#include <stdlib.h>
#include <string.h>
+#include "sway/config.h"
#include "sway/commands.h"
#include "sway/input/input-manager.h"
@@ -22,6 +23,6 @@ struct cmd_results *input_cmd_pointer_accel(int argc, char **argv) {
}
new_config->pointer_accel = pointer_accel;
- input_cmd_apply(new_config);
+ apply_input_config(new_config);
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
}
diff --git a/sway/commands/input/scroll_method.c b/sway/commands/input/scroll_method.c
@@ -1,5 +1,6 @@
#include <string.h>
#include <strings.h>
+#include "sway/config.h"
#include "sway/commands.h"
#include "sway/input/input-manager.h"
@@ -28,6 +29,6 @@ struct cmd_results *input_cmd_scroll_method(int argc, char **argv) {
"Expected 'scroll_method <none|two_finger|edge|on_button_down>'");
}
- input_cmd_apply(new_config);
+ apply_input_config(new_config);
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
}
diff --git a/sway/commands/input/tap.c b/sway/commands/input/tap.c
@@ -1,5 +1,6 @@
#include <string.h>
#include <strings.h>
+#include "sway/config.h"
#include "sway/commands.h"
#include "sway/input/input-manager.h"
#include "log.h"
@@ -27,6 +28,6 @@ struct cmd_results *input_cmd_tap(int argc, char **argv) {
sway_log(L_DEBUG, "apply-tap for device: %s",
current_input_config->identifier);
- input_cmd_apply(new_config);
+ apply_input_config(new_config);
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
}
diff --git a/sway/commands/input/xkb_layout.c b/sway/commands/input/xkb_layout.c
@@ -1,4 +1,5 @@
#define _XOPEN_SOURCE 700
+#include "sway/config.h"
#include "sway/commands.h"
#include "sway/input/input-manager.h"
#include "log.h"
@@ -19,6 +20,6 @@ struct cmd_results *input_cmd_xkb_layout(int argc, char **argv) {
sway_log(L_DEBUG, "apply-xkb_layout for device: %s",
current_input_config->identifier);
- input_cmd_apply(new_config);
+ apply_input_config(new_config);
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
}
diff --git a/sway/commands/input/xkb_model.c b/sway/commands/input/xkb_model.c
@@ -1,4 +1,5 @@
#define _XOPEN_SOURCE 700
+#include "sway/config.h"
#include "sway/commands.h"
#include "sway/input/input-manager.h"
#include "log.h"
@@ -19,6 +20,6 @@ struct cmd_results *input_cmd_xkb_model(int argc, char **argv) {
sway_log(L_DEBUG, "apply-xkb_model for device: %s",
current_input_config->identifier);
- input_cmd_apply(new_config);
+ apply_input_config(new_config);
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
}
diff --git a/sway/commands/input/xkb_options.c b/sway/commands/input/xkb_options.c
@@ -1,4 +1,5 @@
#define _XOPEN_SOURCE 700
+#include "sway/config.h"
#include "sway/commands.h"
#include "sway/input/input-manager.h"
#include "log.h"
@@ -19,6 +20,6 @@ struct cmd_results *input_cmd_xkb_options(int argc, char **argv) {
sway_log(L_DEBUG, "apply-xkb_options for device: %s",
current_input_config->identifier);
- input_cmd_apply(new_config);
+ apply_input_config(new_config);
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
}
diff --git a/sway/commands/input/xkb_rules.c b/sway/commands/input/xkb_rules.c
@@ -1,4 +1,5 @@
#define _XOPEN_SOURCE 700
+#include "sway/config.h"
#include "sway/commands.h"
#include "sway/input/input-manager.h"
#include "log.h"
@@ -19,6 +20,6 @@ struct cmd_results *input_cmd_xkb_rules(int argc, char **argv) {
sway_log(L_DEBUG, "apply-xkb_rules for device: %s",
current_input_config->identifier);
- input_cmd_apply(new_config);
+ apply_input_config(new_config);
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
}
diff --git a/sway/commands/input/xkb_variant.c b/sway/commands/input/xkb_variant.c
@@ -1,4 +1,5 @@
#define _XOPEN_SOURCE 700
+#include "sway/config.h"
#include "sway/commands.h"
#include "sway/input/input-manager.h"
#include "log.h"
@@ -19,6 +20,6 @@ struct cmd_results *input_cmd_xkb_variant(int argc, char **argv) {
sway_log(L_DEBUG, "apply-xkb_variant for device: %s",
current_input_config->identifier);
- input_cmd_apply(new_config);
+ apply_input_config(new_config);
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
}
diff --git a/sway/commands/seat/attach.c b/sway/commands/seat/attach.c
@@ -21,6 +21,6 @@ struct cmd_results *seat_cmd_attach(int argc, char **argv) {
new_attachment->identifier = strdup(argv[0]);
list_add(new_config->attachments, new_attachment);
- seat_cmd_apply(new_config);
+ apply_seat_config(new_config);
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
}