}
static void
-_einput_device_input_thread_path_backend_heavy(void *data, Ecore_Thread *th, void *msg_data)
+_einput_device_init_libinput_device_from_env(struct libinput *libinput, int ndevices)
{
char *env = NULL;
struct libinput_device *device;
+
+ TRACE_INPUT_BEGIN(libinput_path_add_device_loop);
+ for (int i = 0; i < ndevices; i++)
+ {
+ char buf[1024] = "PATH_DEVICE_";
+ eina_convert_itoa(i + 1, buf + 12);
+ env = e_util_env_get(buf);
+ if (env)
+ {
+ device = libinput_path_add_device(libinput, env);
+ if (!device)
+ ERR("Failed to initialized device %s", env);
+ else
+ INF("libinput_path created input device %s", env);
+ E_FREE(env);
+ }
+ }
+ TRACE_INPUT_END();
+}
+
+static void
+_einput_device_input_thread_path_backend_heavy(void *data, Ecore_Thread *th, void *msg_data)
+{
E_Input_Backend *input = (E_Input_Backend *)data;
EINA_SAFETY_ON_NULL_RETURN(input);
libinput_log_set_priority(input->libinput, LIBINPUT_LOG_PRIORITY_INFO);
}
- TRACE_INPUT_BEGIN(libinput_path_add_device_loop);
- for (int i = 0; i < input->path_ndevices; i++)
- {
- char buf[1024] = "PATH_DEVICE_";
- eina_convert_itoa(i + 1, buf + 12);
- env = e_util_env_get(buf);
-
- if (env)
- {
- device = libinput_path_add_device(input->libinput, env);
- if (!device)
- ERR("Failed to initialized device %s", env);
- else
- INF("libinput_path created input device %s", env);
- E_FREE(env);
- }
- }
- TRACE_INPUT_END();
+ _einput_device_init_libinput_device_from_env(input->libinput, input->path_ndevices);
return;
}
e_input_backend_create_libinput_path(int ndevices)
{
E_Input_Backend *input;
- struct libinput_device *device;
char *env;
/* try to allocate space for new input structure */
libinput_log_set_priority(input->libinput, LIBINPUT_LOG_PRIORITY_INFO);
}
- TRACE_INPUT_BEGIN(libinput_path_add_device_loop);
- for (int i = 0; i < ndevices; i++)
- {
- char buf[1024] = "PATH_DEVICE_";
- eina_convert_itoa(i + 1, buf + 12);
- env = e_util_env_get(buf);
- if (env)
- {
- device = libinput_path_add_device(input->libinput, env);
- if (!device)
- ERR("Failed to initialized device %s", env);
- else
- INF("libinput_path created input device %s", env);
- E_FREE(env);
- }
- }
- TRACE_INPUT_END();
+ _einput_device_init_libinput_device_from_env(input->libinput, ndevices);
/* enable this input */
if (!e_input_backend_enable_input(input))