mirror of
https://github.com/labwc/labwc.git
synced 2026-03-20 05:34:12 -04:00
Fix coding style, mostly whitespace
This commit is contained in:
parent
f8e1d76333
commit
606b6d946e
6 changed files with 16 additions and 14 deletions
|
|
@ -25,6 +25,6 @@ struct libinput_category {
|
||||||
};
|
};
|
||||||
|
|
||||||
enum device_type get_device_type(const char *s);
|
enum device_type get_device_type(const char *s);
|
||||||
struct libinput_category *libinput_category_create();
|
struct libinput_category *libinput_category_create(void);
|
||||||
|
|
||||||
#endif /* __LABWC_LIBINPUT_H */
|
#endif /* __LABWC_LIBINPUT_H */
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ get_device_type(const char *s)
|
||||||
}
|
}
|
||||||
|
|
||||||
struct libinput_category *
|
struct libinput_category *
|
||||||
libinput_category_create()
|
libinput_category_create(void)
|
||||||
{
|
{
|
||||||
struct libinput_category *l = calloc(1, sizeof(struct libinput_category));
|
struct libinput_category *l = calloc(1, sizeof(struct libinput_category));
|
||||||
if (!l) {
|
if (!l) {
|
||||||
|
|
|
||||||
|
|
@ -150,15 +150,15 @@ fill_libinput_category(char *nodename, char *content)
|
||||||
string_truncate_at_pattern(nodename, ".device.libinput");
|
string_truncate_at_pattern(nodename, ".device.libinput");
|
||||||
|
|
||||||
if (!strcmp(nodename, "category")) {
|
if (!strcmp(nodename, "category")) {
|
||||||
if (!strcmp(content, "touch")
|
if (!strcmp(content, "touch")
|
||||||
|| !strcmp(content, "non-touch")
|
|| !strcmp(content, "non-touch")
|
||||||
|| !strcmp(content, "default")) {
|
|| !strcmp(content, "default")) {
|
||||||
current_libinput_category->type = get_device_type(content);
|
current_libinput_category->type = get_device_type(content);
|
||||||
} else {
|
} else {
|
||||||
current_libinput_category->name = strdup(content);
|
current_libinput_category->name = strdup(content);
|
||||||
}
|
}
|
||||||
} else if (!strcasecmp(nodename, "naturalscroll")) {
|
} else if (!strcasecmp(nodename, "naturalscroll")) {
|
||||||
current_libinput_category->natural_scroll =
|
current_libinput_category->natural_scroll =
|
||||||
get_bool(content) ? 1 : 0;
|
get_bool(content) ? 1 : 0;
|
||||||
} else if (!strcasecmp(nodename, "lefthanded")) {
|
} else if (!strcasecmp(nodename, "lefthanded")) {
|
||||||
current_libinput_category->left_handed = get_bool(content) ? 1 : 0;
|
current_libinput_category->left_handed = get_bool(content) ? 1 : 0;
|
||||||
|
|
@ -170,18 +170,18 @@ fill_libinput_category(char *nodename, char *content)
|
||||||
current_libinput_category->pointer_speed = 1;
|
current_libinput_category->pointer_speed = 1;
|
||||||
}
|
}
|
||||||
} else if (!strcasecmp(nodename, "tap")) {
|
} else if (!strcasecmp(nodename, "tap")) {
|
||||||
current_libinput_category->tap = get_bool(content) ?
|
current_libinput_category->tap = get_bool(content) ?
|
||||||
LIBINPUT_CONFIG_TAP_ENABLED :
|
LIBINPUT_CONFIG_TAP_ENABLED :
|
||||||
LIBINPUT_CONFIG_TAP_DISABLED;
|
LIBINPUT_CONFIG_TAP_DISABLED;
|
||||||
} else if (!strcasecmp(nodename, "accelprofile")) {
|
} else if (!strcasecmp(nodename, "accelprofile")) {
|
||||||
current_libinput_category->accel_profile = get_accel_profile(content);
|
current_libinput_category->accel_profile = get_accel_profile(content);
|
||||||
} else if (!strcasecmp(nodename, "middleemulation")) {
|
} else if (!strcasecmp(nodename, "middleemulation")) {
|
||||||
current_libinput_category->middle_emu = get_bool(content) ?
|
current_libinput_category->middle_emu = get_bool(content) ?
|
||||||
LIBINPUT_CONFIG_MIDDLE_EMULATION_ENABLED :
|
LIBINPUT_CONFIG_MIDDLE_EMULATION_ENABLED :
|
||||||
LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED;
|
LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED;
|
||||||
} else if (!strcasecmp(nodename, "disablewhiletyping")) {
|
} else if (!strcasecmp(nodename, "disablewhiletyping")) {
|
||||||
current_libinput_category->dwt = get_bool(content) ?
|
current_libinput_category->dwt = get_bool(content) ?
|
||||||
LIBINPUT_CONFIG_DWT_ENABLED :
|
LIBINPUT_CONFIG_DWT_ENABLED :
|
||||||
LIBINPUT_CONFIG_DWT_DISABLED;
|
LIBINPUT_CONFIG_DWT_DISABLED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -341,8 +341,10 @@ static void xml_tree_walk(xmlNode *node);
|
||||||
static void
|
static void
|
||||||
traverse(xmlNode *n)
|
traverse(xmlNode *n)
|
||||||
{
|
{
|
||||||
|
xmlAttr *attr;
|
||||||
|
|
||||||
process_node(n);
|
process_node(n);
|
||||||
for (xmlAttr *attr = n->properties; attr; attr = attr->next) {
|
for (attr = n->properties; attr; attr = attr->next) {
|
||||||
xml_tree_walk(attr->children);
|
xml_tree_walk(attr->children);
|
||||||
}
|
}
|
||||||
xml_tree_walk(n->children);
|
xml_tree_walk(n->children);
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ change_vt(struct server *server, unsigned int vt)
|
||||||
static bool
|
static bool
|
||||||
any_modifiers_pressed(struct wlr_keyboard *keyboard)
|
any_modifiers_pressed(struct wlr_keyboard *keyboard)
|
||||||
{
|
{
|
||||||
xkb_mod_index_t i ;
|
xkb_mod_index_t i;
|
||||||
for (i = 0; i < xkb_keymap_num_mods(keyboard->keymap); i++) {
|
for (i = 0; i < xkb_keymap_num_mods(keyboard->keymap); i++) {
|
||||||
if (xkb_state_mod_index_is_active
|
if (xkb_state_mod_index_is_active
|
||||||
(keyboard->xkb_state, i,
|
(keyboard->xkb_state, i,
|
||||||
|
|
|
||||||
|
|
@ -188,7 +188,7 @@ output_drag_icon_for_each_surface(struct output *output, struct seat *seat,
|
||||||
}
|
}
|
||||||
double ox = seat->cursor->x, oy = seat->cursor->y;
|
double ox = seat->cursor->x, oy = seat->cursor->y;
|
||||||
wlr_output_layout_output_coords(output->server->output_layout,
|
wlr_output_layout_output_coords(output->server->output_layout,
|
||||||
output->wlr_output, &ox, &oy);
|
output->wlr_output, &ox, &oy);
|
||||||
output_surface_for_each_surface(output, seat->drag_icon->surface,
|
output_surface_for_each_surface(output, seat->drag_icon->surface,
|
||||||
ox, oy, iterator, user_data);
|
ox, oy, iterator, user_data);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,7 @@ configure_libinput(struct wlr_input_device *wlr_input_device)
|
||||||
} else {
|
} else {
|
||||||
wlr_log(WLR_INFO, "pointer acceleration configured");
|
wlr_log(WLR_INFO, "pointer acceleration configured");
|
||||||
if (dc->pointer_speed > -1) {
|
if (dc->pointer_speed > -1) {
|
||||||
libinput_device_config_accel_set_speed(libinput_dev,
|
libinput_device_config_accel_set_speed(libinput_dev,
|
||||||
dc->pointer_speed);
|
dc->pointer_speed);
|
||||||
}
|
}
|
||||||
if (dc->accel_profile > 0) {
|
if (dc->accel_profile > 0) {
|
||||||
|
|
@ -224,7 +224,7 @@ seat_reconfigure(struct server *server)
|
||||||
wl_list_for_each(input, &seat->inputs, link) {
|
wl_list_for_each(input, &seat->inputs, link) {
|
||||||
/* We don't configure keyboards by libinput, so skip them */
|
/* We don't configure keyboards by libinput, so skip them */
|
||||||
if (wlr_input_device_is_libinput(input->wlr_input_device) &&
|
if (wlr_input_device_is_libinput(input->wlr_input_device) &&
|
||||||
input->wlr_input_device->type ==
|
input->wlr_input_device->type ==
|
||||||
WLR_INPUT_DEVICE_POINTER) {
|
WLR_INPUT_DEVICE_POINTER) {
|
||||||
configure_libinput(input->wlr_input_device);
|
configure_libinput(input->wlr_input_device);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue