Lines Matching refs:options
99 tools_init_options(struct tools_options *options)
101 memset(options, 0, sizeof(*options));
102 options->tapping = -1;
103 options->tap_map = -1;
104 options->drag = -1;
105 options->drag_lock = -1;
106 options->natural_scroll = -1;
107 options->left_handed = -1;
108 options->middlebutton = -1;
109 options->dwt = -1;
110 options->dwtp = -1;
111 options->click_method = -1;
112 options->scroll_method = -1;
113 options->scroll_button = -1;
114 options->scroll_button_lock = -1;
115 options->speed = 0.0;
116 options->profile = LIBINPUT_CONFIG_ACCEL_PROFILE_NONE;
119 options->custom_points = points;
120 options->custom_npoints = ARRAY_LENGTH(points);
121 options->custom_type = LIBINPUT_ACCEL_TYPE_FALLBACK;
122 options->custom_step = 1.0;
128 struct tools_options *options)
132 options->tapping = 1;
135 options->tapping = 0;
142 options->tap_map = LIBINPUT_CONFIG_TAP_MAP_LRM;
144 options->tap_map = LIBINPUT_CONFIG_TAP_MAP_LMR;
150 options->drag = 1;
153 options->drag = 0;
156 options->drag_lock = 1;
159 options->drag_lock = 0;
162 options->natural_scroll = 1;
165 options->natural_scroll = 0;
168 options->left_handed = 1;
171 options->left_handed = 0;
174 options->middlebutton = 1;
177 options->middlebutton = 0;
180 options->dwt = LIBINPUT_CONFIG_DWT_ENABLED;
183 options->dwt = LIBINPUT_CONFIG_DWT_DISABLED;
186 options->dwtp = LIBINPUT_CONFIG_DWTP_ENABLED;
189 options->dwtp = LIBINPUT_CONFIG_DWTP_DISABLED;
196 options->click_method =
199 options->click_method =
202 options->click_method =
213 options->scroll_method =
216 options->scroll_method =
219 options->scroll_method =
222 options->scroll_method =
232 options->scroll_button =
235 if (options->scroll_button == -1) {
243 options->scroll_button_lock = true;
246 options->scroll_button_lock = false;
251 options->speed = atof(optarg);
258 options->profile = LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE;
260 options->profile = LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT;
262 options->profile = LIBINPUT_CONFIG_ACCEL_PROFILE_CUSTOM;
270 snprintf(options->disable_pattern,
271 sizeof(options->disable_pattern),
279 snprintf(options->match,
280 sizeof(options->match),
287 options->custom_points = double_array_from_string(optarg,
289 &options->custom_npoints);
290 if (!options->custom_points || options->custom_npoints < 2) {
301 options->custom_step = strtod(optarg, NULL);
307 options->custom_type = LIBINPUT_ACCEL_TYPE_FALLBACK;
309 options->custom_type = LIBINPUT_ACCEL_TYPE_MOTION;
311 options->custom_type = LIBINPUT_ACCEL_TYPE_SCROLL;
322 if (!safe_atou(optarg, &options->angle)) {
458 struct tools_options *options)
464 fnmatch(options->disable_pattern, name, 0) != FNM_NOMATCH) {
469 if (strlen(options->match) > 0 &&
470 fnmatch(options->match, name, 0) == FNM_NOMATCH)
473 if (options->tapping != -1)
474 libinput_device_config_tap_set_enabled(device, options->tapping);
475 if (options->tap_map != (enum libinput_config_tap_button_map)-1)
477 options->tap_map);
478 if (options->drag != -1)
480 options->drag);
481 if (options->drag_lock != -1)
483 options->drag_lock);
484 if (options->natural_scroll != -1)
486 options->natural_scroll);
487 if (options->left_handed != -1)
488 libinput_device_config_left_handed_set(device, options->left_handed);
489 if (options->middlebutton != -1)
491 options->middlebutton);
493 if (options->dwt != -1)
494 libinput_device_config_dwt_set_enabled(device, options->dwt);
496 if (options->dwtp != -1)
497 libinput_device_config_dwtp_set_enabled(device, options->dwtp);
499 if (options->click_method != (enum libinput_config_click_method)-1)
500 libinput_device_config_click_set_method(device, options->click_method);
502 if (options->scroll_method != (enum libinput_config_scroll_method)-1)
504 options->scroll_method);
505 if (options->scroll_button != -1)
507 options->scroll_button);
508 if (options->scroll_button_lock != -1)
510 options->scroll_button_lock);
514 options->speed);
515 if (options->profile != LIBINPUT_CONFIG_ACCEL_PROFILE_NONE)
517 options->profile);
520 if (options->profile == LIBINPUT_CONFIG_ACCEL_PROFILE_CUSTOM) {
524 options->custom_type,
525 options->custom_step,
526 options->custom_npoints,
527 options->custom_points);
532 if (options->angle != 0)
533 libinput_device_config_rotation_set_angle(device, options->angle % 360);