From f09f9b91015a829a24df47bffd14bf1517f0a6b5 Mon Sep 17 00:00:00 2001 From: SooChan Lim Date: Tue, 14 May 2024 10:54:04 +0900 Subject: [PATCH] e_input_backend: make e_input_backend_intern header file e_input_backend_intern header provides the information and functionalities of the E_Input_Backend resource. Change-Id: I920eb654adf900d308ff65c713494c5af953a002 --- src/bin/Makefile.mk | 2 +- src/bin/core/e_client.c | 19 +++++---- src/bin/core/e_desk_area.c | 4 +- src/bin/core/e_zone.c | 3 +- src/bin/e_main.c | 5 ++- .../{e_input_inputs.c => e_input_backend.c} | 43 ++++++++++--------- src/bin/inputmgr/e_input_backend_intern.h | 48 ++++++++++++++++++++++ src/bin/inputmgr/e_input_device.c | 18 ++++---- src/bin/inputmgr/e_input_evdev.c | 4 +- src/bin/inputmgr/e_input_evdev_intern.h | 2 + src/bin/inputmgr/e_input_intern.h | 48 ---------------------- src/bin/inputmgr/e_keyrouter.c | 3 +- src/bin/server/e_comp_wl.c | 6 +-- src/bin/server/e_comp_wl_input.c | 5 ++- src/bin/server/e_keyrouter_wl.c | 5 ++- src/bin/server/e_policy_wl.c | 4 +- 16 files changed, 116 insertions(+), 103 deletions(-) rename src/bin/inputmgr/{e_input_inputs.c => e_input_backend.c} (96%) create mode 100644 src/bin/inputmgr/e_input_backend_intern.h diff --git a/src/bin/Makefile.mk b/src/bin/Makefile.mk index 3197cd4..48f9641 100644 --- a/src/bin/Makefile.mk +++ b/src/bin/Makefile.mk @@ -207,7 +207,7 @@ src/bin/inputmgr/e_comp_input.c \ src/bin/inputmgr/e_mouse.c \ src/bin/inputmgr/e_input.c \ src/bin/inputmgr/e_input_event.c \ -src/bin/inputmgr/e_input_inputs.c \ +src/bin/inputmgr/e_input_backend.c \ src/bin/inputmgr/e_input_device.c \ src/bin/inputmgr/e_input_evdev.c \ src/bin/inputmgr/e_input_thread_client.c \ diff --git a/src/bin/core/e_client.c b/src/bin/core/e_client.c index d6f73ff..b8cc2ad 100644 --- a/src/bin/core/e_client.c +++ b/src/bin/core/e_client.c @@ -10,6 +10,7 @@ #include "e_comp_intern.h" #include "e_input_intern.h" #include "e_input_device_intern.h" +#include "e_input_backend_intern.h" #include "e_policy_intern.h" #include "e_map_intern.h" #include "e_policy_visibility_intern.h" @@ -1051,7 +1052,7 @@ _e_client_free(E_Client *ec) ec_data.ec = ec; INF("[%s] ec: %p\n", __func__, ec); - e_input_thread_safe_call(_e_input_thread_client_free, &ec_data, sizeof(E_Input_Thread_Request_EClient_Data)); + e_input_backend_thread_safe_call(_e_input_thread_client_free, &ec_data, sizeof(E_Input_Thread_Request_EClient_Data)); _e_client_private_finish(ec); free(ec); @@ -1154,7 +1155,7 @@ _e_client_del(E_Client *ec) ec_data.ec = ec; INF("[%s] ec: %p\n", __func__, ec); - e_input_thread_safe_call(_e_input_thread_client_del, &ec_data, sizeof(E_Input_Thread_Request_EClient_Data)); + e_input_backend_thread_safe_call(_e_input_thread_client_del, &ec_data, sizeof(E_Input_Thread_Request_EClient_Data)); g_rec_mutex_unlock(&e_comp->ec_list_mutex); } @@ -2737,7 +2738,7 @@ e_client_visibility_set(E_Client *ec, E_Visibility visibility) ec_data.visibility = ec->visibility.obscured; INF("[%s] ec(%p), visibility(%d)\n", __func__, ec, ec->visibility.obscured); - e_input_thread_safe_call(_e_input_thread_client_visibility_set, &ec_data, sizeof(E_Input_Thread_Request_EClient_Data)); + e_input_backend_thread_safe_call(_e_input_thread_client_visibility_set, &ec_data, sizeof(E_Input_Thread_Request_EClient_Data)); } static Eina_Bool @@ -3353,7 +3354,7 @@ _e_client_input_thread_clone_new(E_Client *ec) ec_new_data.wl_surface = ec->comp_data ? ec->comp_data->wl_surface : NULL; INF("[%s] ec(%p), surface(%p)\n", __func__, ec, ec_new_data.wl_surface); - e_input_thread_safe_call(_e_input_thread_client_new, &ec_new_data, sizeof(E_Input_Thread_Request_EClient_Data)); + e_input_backend_thread_safe_call(_e_input_thread_client_new, &ec_new_data, sizeof(E_Input_Thread_Request_EClient_Data)); } E_API E_Client * @@ -6018,7 +6019,7 @@ e_client_input_thread_layer_set(E_Client *ec, E_Layer layer) ec_data.layer = layer; INF("[%s] ec(%p), layer(%d)\n", __func__, ec, layer); - e_input_thread_safe_call(_e_input_thread_client_layer_set, &ec_data, sizeof(E_Input_Thread_Request_EClient_Data)); + e_input_backend_thread_safe_call(_e_input_thread_client_layer_set, &ec_data, sizeof(E_Input_Thread_Request_EClient_Data)); } E_API Eina_Bool @@ -7112,7 +7113,7 @@ e_client_icccm_name_set(E_Client *ec, const char *name) strncpy(ec_data.icccm_name, name, sizeof(ec_data.icccm_name)-1); INF("[%s] ec(%p), surface(%p), name(%s)\n", __func__, ec, ec_data.wl_surface, name); - e_input_thread_safe_call(_e_input_thread_client_icccm_name_set, &ec_data, sizeof(E_Input_Thread_Request_EClient_Data)); + e_input_backend_thread_safe_call(_e_input_thread_client_icccm_name_set, &ec_data, sizeof(E_Input_Thread_Request_EClient_Data)); } } @@ -7151,7 +7152,7 @@ e_client_netwm_name_set(E_Client *ec, const char *name) strncpy(ec_data.netwm_name, name, sizeof(ec_data.netwm_name)-1); INF("[%s] ec(%p), surface(%p), name(%s)\n", __func__, ec, ec_data.wl_surface, ec_data.netwm_name); - e_input_thread_safe_call(_e_input_thread_client_netwm_name_set, &ec_data, sizeof(E_Input_Thread_Request_EClient_Data)); + e_input_backend_thread_safe_call(_e_input_thread_client_netwm_name_set, &ec_data, sizeof(E_Input_Thread_Request_EClient_Data)); } E_API Eina_Stringshare * @@ -7190,7 +7191,7 @@ e_client_icccm_title_set(E_Client *ec, const char *title) strncpy(ec_data.icccm_title, title, sizeof(ec_data.icccm_title)-1); INF("[%s] ec(%p), surface(%p)\n", __func__, ec, ec_data.wl_surface); - e_input_thread_safe_call(_e_input_thread_client_icccm_title_set, &ec_data, sizeof(E_Input_Thread_Request_EClient_Data)); + e_input_backend_thread_safe_call(_e_input_thread_client_icccm_title_set, &ec_data, sizeof(E_Input_Thread_Request_EClient_Data)); } } @@ -7323,5 +7324,5 @@ e_client_video_mode_set(E_Client *ec, Eina_Bool is_video) ec_data.is_video = is_video; INF("[%s] ec(%p), is_video(%d)\n", __func__, ec, is_video); - e_input_thread_safe_call(_e_input_thread_client_video_mode_set, &ec_data, sizeof(E_Input_Thread_Request_EClient_Data)); + e_input_backend_thread_safe_call(_e_input_thread_client_video_mode_set, &ec_data, sizeof(E_Input_Thread_Request_EClient_Data)); } diff --git a/src/bin/core/e_desk_area.c b/src/bin/core/e_desk_area.c index f2d94e8..397d163 100644 --- a/src/bin/core/e_desk_area.c +++ b/src/bin/core/e_desk_area.c @@ -6,7 +6,7 @@ #include "e_policy_intern.h" #include "e_maximize_intern.h" #include "e_policy_visibility_intern.h" -#include "e_input_intern.h" +#include "e_input_backend_intern.h" #include "e_comp_input_intern.h" #include "e_comp_wl_subsurface_intern.h" #include "e_zone_intern.h" @@ -194,7 +194,7 @@ _e_comp_object_layers_update(unsigned int layer, E_Comp_Input_Inlist_Function_Ty layer_data.relative = relative; INF("[%s] layer(%u), function type(%d), item(%p), relative(%p)\n", __func__, layer, type, item, relative); - e_input_thread_safe_call(_e_comp_input_thread_layers_update, &layer_data, sizeof(E_Comp_Input_Layer_Data)); + e_input_backend_thread_safe_call(_e_comp_input_thread_layers_update, &layer_data, sizeof(E_Comp_Input_Layer_Data)); } static void diff --git a/src/bin/core/e_zone.c b/src/bin/core/e_zone.c index 259f445..469b8a6 100644 --- a/src/bin/core/e_zone.c +++ b/src/bin/core/e_zone.c @@ -9,6 +9,7 @@ #include "e_comp_intern.h" #include "e_input_intern.h" #include "e_input_device_intern.h" +#include "e_input_backend_intern.h" #include "e_place_intern.h" #include "e_policy_intern.h" #include "e_maximize_intern.h" @@ -507,7 +508,7 @@ _zone_cb_focus_focused_ec_changed(struct wl_listener *listener, void *data) ec_data.ec = focused_ec; INF("[%s] focused ec(%p)\n", __func__, focused_ec); - e_input_thread_safe_call(_e_zone_input_thread_focused_client_set, &ec_data, sizeof(E_Input_Thread_Request_EClient_Data)); + e_input_backend_thread_safe_call(_e_zone_input_thread_focused_client_set, &ec_data, sizeof(E_Input_Thread_Request_EClient_Data)); } EINTERN E_Zone * diff --git a/src/bin/e_main.c b/src/bin/e_main.c index df4be02..0d6d012 100644 --- a/src/bin/e_main.c +++ b/src/bin/e_main.c @@ -33,6 +33,7 @@ #include "e_zone_intern.h" #include "e_eom_intern.h" #include "e_input_intern.h" +#include "e_input_backend_intern.h" #include @@ -656,8 +657,8 @@ main(int argc, char **argv) if (e_input_thread_mode_get()) { - e_input_thread_init(); - e_input_thread_start(); + e_input_backend_thread_init(); + e_input_backend_thread_start(); } if (e_config->eom_enable) diff --git a/src/bin/inputmgr/e_input_inputs.c b/src/bin/inputmgr/e_input_backend.c similarity index 96% rename from src/bin/inputmgr/e_input_inputs.c rename to src/bin/inputmgr/e_input_backend.c index 7513956..7bc65a3 100644 --- a/src/bin/inputmgr/e_input_inputs.c +++ b/src/bin/inputmgr/e_input_backend.c @@ -20,6 +20,11 @@ # include #endif +typedef struct { + E_Input_Thread_Safe_Call_Cb safe_call_cb; + unsigned int data_length; +} E_Input_Thread_Request_Data; + #define TS_DO #ifdef TS_DO static double t0, t1, t2; @@ -678,7 +683,7 @@ _input_event_process(struct libinput_event *event) } void -_input_events_process(E_Input_Backend *input) +e_input_backend_events_process(E_Input_Backend *input) { struct libinput_event *event; while ((event = libinput_get_event(input->libinput))) @@ -705,7 +710,7 @@ _cb_input_dispatch(void *data, Ecore_Fd_Handler *hdlr EINA_UNUSED) ERR("Failed to dispatch libinput events: %m"); /* process pending events */ - _input_events_process(input); + e_input_backend_events_process(input); if (e_config->key_input_ttrace_enable) { @@ -816,17 +821,17 @@ input_dispatch(GSource *source, GSourceFunc callback, gpointer user_data) if (e_config->key_input_ttrace_enable) { - TRACE_INPUT_DEVICE_BEGIN(_input_events_process); - ELOGF("INPUT", "_input_events_process|B|", NULL); + TRACE_INPUT_DEVICE_BEGIN(e_input_backend_events_process); + ELOGF("INPUT", "e_input_backend_events_process|B|", NULL); } /* process pending events */ - _input_events_process(input); + e_input_backend_events_process(input); if (e_config->key_input_ttrace_enable) { TRACE_INPUT_DEVICE_END(); - ELOGF("INPUT", "_input_events_process|E|", NULL); + ELOGF("INPUT", "e_input_backend_events_process|E|", NULL); TRACE_INPUT_DEVICE_END(); ELOGF("INPUT", "input_dispatch|E|", NULL); @@ -975,7 +980,7 @@ input_thread_start(void *data, Ecore_Thread *th) #endif /* enable this input */ - if (!e_input_enable_input(input)) + if (!e_input_backend_enable_input(input)) { ERR("Failed to enable input"); return; @@ -993,7 +998,7 @@ input_thread_start(void *data, Ecore_Thread *th) input_event_source->tag = g_source_add_unix_fd(&input_event_source->gsource, input->fd, G_IO_IN); if (!input->event_source) - e_input_create_event_source(input); + e_input_backend_create_event_source(input); //create main loop input->input_thread_loop = g_main_loop_new(context, FALSE); @@ -1064,7 +1069,7 @@ input_thread_cancel(void *data, Ecore_Thread *th) } void -_e_input_key_event_list_add(Ecore_Event_Key *key) +e_input_backend_key_event_list_add(Ecore_Event_Key *key) { Ecore_Event_Key *clone = NULL; @@ -1083,7 +1088,7 @@ _e_input_key_event_list_add(Ecore_Event_Key *key) } EINTERN Eina_Bool -e_input_enable_input(E_Input_Backend *input) +e_input_backend_enable_input(E_Input_Backend *input) { EINA_SAFETY_ON_NULL_RETURN_VAL(input, EINA_FALSE); EINA_SAFETY_ON_NULL_RETURN_VAL(input->libinput, EINA_FALSE); @@ -1108,7 +1113,7 @@ e_input_enable_input(E_Input_Backend *input) input->suspended = EINA_FALSE; /* process pending events */ - _input_events_process(input); + e_input_backend_events_process(input); } input->enabled = EINA_TRUE; @@ -1129,7 +1134,7 @@ err: } EINTERN void -e_input_disable_input(E_Input_Backend *input) +e_input_backend_disable_input(E_Input_Backend *input) { EINA_SAFETY_ON_NULL_RETURN(input); EINA_SAFETY_ON_TRUE_RETURN(input->suspended); @@ -1138,7 +1143,7 @@ e_input_disable_input(E_Input_Backend *input) libinput_suspend(input->libinput); /* process pending events */ - _input_events_process(input); + e_input_backend_events_process(input); input->suspended = EINA_TRUE; @@ -1165,21 +1170,21 @@ e_input_thread_mode_get() } EINTERN void -e_input_create_event_source(E_Input_Backend *input) +e_input_backend_create_event_source(E_Input_Backend *input) { input->event_source = e_input_event_source_create(); g_input_event_source = input->event_source; } -EINTERN void e_input_thread_start() +EINTERN void e_input_backend_thread_start() { EINA_SAFETY_ON_NULL_RETURN(g_input_backend); g_input_backend->input_thread = ecore_thread_feedback_run(input_thread_start, input_thread_feedback, input_thread_end, input_thread_cancel, g_input_backend, EINA_FALSE); } -EINTERN void e_input_thread_init() +EINTERN void e_input_backend_thread_init() { if (pipe(main_to_input_thread_pipe_fd) != 0) ERR("error in pipe\n"); @@ -1194,7 +1199,7 @@ EINTERN void e_input_thread_init() } } -EINTERN void e_input_thread_shutdown() +EINTERN void e_input_backend_thread_shutdown() { EINA_SAFETY_ON_NULL_RETURN(g_input_backend); @@ -1202,7 +1207,7 @@ EINTERN void e_input_thread_shutdown() close(g_input_backend->main_to_input_thread_pipe_fd[1]); } -EINTERN void e_input_thread_input_backend_set(E_Input_Backend *input) +EINTERN void e_input_backend_thread_input_backend_set(E_Input_Backend *input) { g_input_backend = input; @@ -1214,7 +1219,7 @@ EINTERN void e_input_thread_input_backend_set(E_Input_Backend *input) } EINTERN void -e_input_thread_safe_call(E_Input_Thread_Safe_Call_Cb cb, void *data, size_t data_length) +e_input_backend_thread_safe_call(E_Input_Thread_Safe_Call_Cb cb, void *data, size_t data_length) { E_Input_Thread_Request_Data order; order.safe_call_cb = cb; diff --git a/src/bin/inputmgr/e_input_backend_intern.h b/src/bin/inputmgr/e_input_backend_intern.h new file mode 100644 index 0000000..d6bbfab --- /dev/null +++ b/src/bin/inputmgr/e_input_backend_intern.h @@ -0,0 +1,48 @@ +#ifndef E_INPUT_BACKEND_INTERN_H +#define E_INPUT_BACKEND_INTERN_H + +#include "e_intern.h" +#include "e_input_intern.h" + +typedef struct _E_Input_Backend E_Input_Backend; + +struct _E_Input_Backend +{ + int fd; + E_Input_Device *dev; + struct libinput *libinput; + + Ecore_Fd_Handler *hdlr; + + Eina_Bool enabled : 1; + Eina_Bool suspended : 1; + Eina_Bool left_handed : 1; + + Ecore_Thread *thread; + Ecore_Thread *input_thread; + E_Input_Libinput_Backend backend; + + Eina_Bool log_disable : 1; + Eina_Bool log_use_eina : 1; + + unsigned int path_ndevices; + + GMainLoop *input_thread_loop; + E_Input_Event_Source *event_source; + + int main_to_input_thread_pipe_fd[2]; +}; + +EINTERN void e_input_backend_thread_init(); +EINTERN void e_input_backend_thread_shutdown(); + +EINTERN Eina_Bool e_input_backend_enable_input(E_Input_Backend *input); +EINTERN void e_input_backend_disable_input(E_Input_Backend *input); +EINTERN void e_input_backend_create_event_source(E_Input_Backend *input); +EINTERN void e_input_backend_thread_start(); +EINTERN void e_input_backend_thread_input_backend_set(E_Input_Backend *input); +EINTERN void e_input_backend_thread_safe_call(E_Input_Thread_Safe_Call_Cb cb, void *data, size_t data_length); +EINTERN void e_input_backend_events_process(E_Input_Backend *input); +EINTERN void e_input_backend_key_event_list_add(Ecore_Event_Key *key); + +#endif diff --git a/src/bin/inputmgr/e_input_device.c b/src/bin/inputmgr/e_input_device.c index ad7a61f..8b6cd94 100644 --- a/src/bin/inputmgr/e_input_device.c +++ b/src/bin/inputmgr/e_input_device.c @@ -811,7 +811,7 @@ _einput_device_input_thread_udev_backend_end(void *data, Ecore_Thread *th, void input->thread = NULL; /* enable this input */ - if (!e_input_enable_input(input)) + if (!e_input_backend_enable_input(input)) { ERR("Failed to enable input"); return; @@ -822,7 +822,7 @@ _einput_device_input_thread_udev_backend_end(void *data, Ecore_Thread *th, void dev->inputs = eina_list_append(dev->inputs, input); /* process pending events */ - _input_events_process(input); + e_input_backend_events_process(input); } static void @@ -905,7 +905,7 @@ e_input_device_input_create_libinput_udev(E_Input_Device *dev) if (e_input_thread_mode_get()) { - e_input_thread_input_backend_set(input); + e_input_backend_thread_input_backend_set(input); return EINA_TRUE; } @@ -925,7 +925,7 @@ e_input_device_input_create_libinput_udev(E_Input_Device *dev) goto err; /* enable this input */ - if (!e_input_enable_input(input)) + if (!e_input_backend_enable_input(input)) { ERR("Failed to enable input"); goto err; @@ -935,7 +935,7 @@ e_input_device_input_create_libinput_udev(E_Input_Device *dev) dev->inputs = eina_list_append(dev->inputs, input); /* process pending events */ - _input_events_process(input); + e_input_backend_events_process(input); return EINA_TRUE; @@ -1061,7 +1061,7 @@ _einput_device_input_thread_path_backend_end(void *data, Ecore_Thread *th, void input->thread = NULL; /* enable this input */ - if (!e_input_enable_input(input)) + if (!e_input_backend_enable_input(input)) { ERR("Failed to enable input"); return; @@ -1072,7 +1072,7 @@ _einput_device_input_thread_path_backend_end(void *data, Ecore_Thread *th, void dev->inputs = eina_list_append(dev->inputs, input); /* process pending events */ - _input_events_process(input); + e_input_backend_events_process(input); } static void @@ -1198,7 +1198,7 @@ e_input_device_input_create_libinput_path(E_Input_Device *dev) TRACE_INPUT_END(); /* enable this input */ - if (!e_input_enable_input(input)) + if (!e_input_backend_enable_input(input)) { ERR("Failed to enable input"); goto err; @@ -1208,7 +1208,7 @@ e_input_device_input_create_libinput_path(E_Input_Device *dev) dev->inputs = eina_list_append(dev->inputs, input); /* process pending events */ - _input_events_process(input); + e_input_backend_events_process(input); return EINA_TRUE; diff --git a/src/bin/inputmgr/e_input_evdev.c b/src/bin/inputmgr/e_input_evdev.c index 71a703b..b5ba1ac 100644 --- a/src/bin/inputmgr/e_input_evdev.c +++ b/src/bin/inputmgr/e_input_evdev.c @@ -786,7 +786,7 @@ _device_handle_key(struct libinput_device *device, struct libinput_event_keyboar ELOGF("INPUT", "ECORE_EVENT_KEY:%s:%s:%u:%lld|B|", NULL, state ? "PRESS" : "RELEASE", e->keyname, timestamp, (long long unsigned int)libinput_event_keyboard_get_time_usec(event)); } - _e_input_key_event_list_add(e); + e_input_backend_key_event_list_add(e); if (e_input_thread_mode_get()) { @@ -2700,7 +2700,7 @@ e_input_evdev_seatname_set(E_Input_Evdev *evdev, const char *seatname) } /* process pending events */ - _input_events_process(input); + e_input_backend_events_process(input); res = EINA_TRUE; } diff --git a/src/bin/inputmgr/e_input_evdev_intern.h b/src/bin/inputmgr/e_input_evdev_intern.h index fac13a6..87736ce 100644 --- a/src/bin/inputmgr/e_input_evdev_intern.h +++ b/src/bin/inputmgr/e_input_evdev_intern.h @@ -3,6 +3,7 @@ #include "e_intern.h" #include "e_input_intern.h" +#include "e_input_backend_intern.h" typedef struct _E_Input_Evdev E_Input_Evdev; typedef struct _E_Input_Seat E_Input_Seat; @@ -140,5 +141,6 @@ EINTERN unsigned int e_input_evdev_touch_pressed_get(E_Input_Evdev *edev); EINTERN const char *e_input_evdev_seatname_get(E_Input_Evdev *evdev); EINTERN Eina_Bool e_input_evdev_seatname_set(E_Input_Evdev *evdev, const char *seatname); +EINTERN Eina_Bool e_input_libinput_context_create(E_Input_Backend *input); #endif diff --git a/src/bin/inputmgr/e_input_intern.h b/src/bin/inputmgr/e_input_intern.h index 33bbd09..0abd738 100644 --- a/src/bin/inputmgr/e_input_intern.h +++ b/src/bin/inputmgr/e_input_intern.h @@ -8,17 +8,11 @@ #include typedef struct _E_Input E_Input; -typedef struct _E_Input_Backend E_Input_Backend; typedef void (*e_input_relative_motion_cb)(double dx[2], double dy[2], uint64_t time_us); typedef void (*e_input_keyboard_grab_key_cb)(uint32_t keycode, uint32_t state, uint32_t timestamp, void *dev); typedef void (*E_Input_Thread_Safe_Call_Cb)(void *data); -typedef struct { - E_Input_Thread_Safe_Call_Cb safe_call_cb; - unsigned int data_length; -} E_Input_Thread_Request_Data; - struct _E_Input { Ecore_Window window; @@ -34,33 +28,6 @@ struct _E_Input e_input_keyboard_grab_key_cb keyboard_grab_key_handler; }; -struct _E_Input_Backend -{ - int fd; - E_Input_Device *dev; - struct libinput *libinput; - - Ecore_Fd_Handler *hdlr; - - Eina_Bool enabled : 1; - Eina_Bool suspended : 1; - Eina_Bool left_handed : 1; - - Ecore_Thread *thread; - Ecore_Thread *input_thread; - E_Input_Libinput_Backend backend; - - Eina_Bool log_disable : 1; - Eina_Bool log_use_eina : 1; - - unsigned int path_ndevices; - - GMainLoop *input_thread_loop; - E_Input_Event_Source *event_source; - - int main_to_input_thread_pipe_fd[2]; -}; - struct _E_Input_Hook { EINA_INLIST; @@ -82,9 +49,6 @@ EINTERN Eina_Bool e_input_thread_enabled_get(void); EINTERN E_Input *e_input_get(void); EINTERN Ecore_Evas *e_input_ecore_evas_get(E_Input *ei); -EINTERN Eina_Bool e_input_enable_input(E_Input_Backend *input); -EINTERN void e_input_disable_input(E_Input_Backend *input); - EINTERN Eina_Bool e_input_relative_motion_handler_set(e_input_relative_motion_cb handler); EINTERN e_input_relative_motion_cb e_input_relative_motion_handler_get(void); @@ -94,25 +58,13 @@ EINTERN e_input_keyboard_grab_key_cb e_input_keyboard_grab_key_handler_get(void) EINTERN void e_input_touch_max_count_set(unsigned int max_count); -EINTERN void e_input_create_event_source(E_Input_Backend *input); EINTERN void e_input_flush_keyboard_share_events(void); EINTERN void e_input_main_thread_id_set(pid_t tid); EINTERN void e_input_boost_lock(GMutex *mutex); EINTERN void e_input_boost_unlock(GMutex *mutex); EINTERN void e_input_thread_id_set(pid_t tid); -EINTERN void e_input_thread_start(); -EINTERN void e_input_thread_input_backend_set(E_Input_Backend *input); -EINTERN void e_input_thread_safe_call(E_Input_Thread_Safe_Call_Cb cb, void *data, size_t data_length); - -EINTERN void e_input_thread_init(); -EINTERN void e_input_thread_shutdown(); - -EINTERN Eina_Bool e_input_libinput_context_create(E_Input_Backend *input); -EINTERN void _input_events_process(E_Input_Backend *input); EINTERN void _e_input_hook_call(E_Input_Hook_Point hookpoint, const char *device_name); -EINTERN void _e_input_key_event_list_add(Ecore_Event_Key *key); - #endif diff --git a/src/bin/inputmgr/e_keyrouter.c b/src/bin/inputmgr/e_keyrouter.c index e892b44..f94b818 100644 --- a/src/bin/inputmgr/e_keyrouter.c +++ b/src/bin/inputmgr/e_keyrouter.c @@ -1,6 +1,7 @@ #include "e_keyrouter_intern.h" #include "e_input_intern.h" #include "e_input_event_intern.h" +#include "e_input_backend_intern.h" #include "e_comp_wl_input_intern.h" #include "e_comp_wl_intern.h" #include "e_info_server_intern.h" @@ -278,7 +279,7 @@ _e_keyrouter_input_thread_keygrab_print(void *data) static void _e_keyrouter_keygrab_print(void *data EINA_UNUSED, const char *log_path) { - e_input_thread_safe_call(_e_keyrouter_input_thread_keygrab_print, (void *)log_path, strlen(log_path)+1); + e_input_backend_thread_safe_call(_e_keyrouter_input_thread_keygrab_print, (void *)log_path, strlen(log_path)+1); } static Eina_Bool diff --git a/src/bin/server/e_comp_wl.c b/src/bin/server/e_comp_wl.c index 520f391..0c72d20 100644 --- a/src/bin/server/e_comp_wl.c +++ b/src/bin/server/e_comp_wl.c @@ -21,7 +21,7 @@ #include "e_comp_wl_tbm_intern.h" #include "e_comp_wl_viewport_intern.h" #include "e_comp_intern.h" -#include "e_input_intern.h" +#include "e_input_backend_intern.h" #include "e_keyrouter_intern.h" #include "e_error_intern.h" #include "e_pointer_intern.h" @@ -3106,7 +3106,7 @@ _e_comp_wl_client_cb_focus_set(void *data EINA_UNUSED, E_Client *ec) } INF("[%s] surface(%p)", __func__, ec->comp_data->surface); - e_input_thread_safe_call(_e_input_thread_client_cb_focus_set, (void *)&ec->comp_data->surface, sizeof(struct wl_resource *)); + e_input_backend_thread_safe_call(_e_input_thread_client_cb_focus_set, (void *)&ec->comp_data->surface, sizeof(struct wl_resource *)); } static void @@ -3138,7 +3138,7 @@ _e_comp_wl_client_cb_focus_unset(void *data EINA_UNUSED, E_Client *ec) _e_comp_wl_focus_check(); INF("[%s] surface(%p)", __func__, ec->comp_data->surface); - e_input_thread_safe_call(_e_input_thread_client_cb_focus_unset, (void *)&ec->comp_data->surface, sizeof(struct wl_resource *)); + e_input_backend_thread_safe_call(_e_input_thread_client_cb_focus_unset, (void *)&ec->comp_data->surface, sizeof(struct wl_resource *)); } static void diff --git a/src/bin/server/e_comp_wl_input.c b/src/bin/server/e_comp_wl_input.c index bce44dd..1901400 100644 --- a/src/bin/server/e_comp_wl_input.c +++ b/src/bin/server/e_comp_wl_input.c @@ -3,6 +3,7 @@ #include "e_comp_wl_intern.h" #include "e_input_intern.h" #include "e_input_device_intern.h" +#include "e_input_backend_intern.h" #include "e_pointer_intern.h" #include "e_comp_object_intern.h" #include "e_comp_input_intern.h" @@ -229,7 +230,7 @@ _e_comp_wl_input_pointer_cb_cursor_set(struct wl_client *client, struct wl_resou ec_data.layer_block = ec->layer_block; ec_data.is_cursor = ec->is_cursor; INF("[%s] ec(%p), layer_block(%d), is_cursor(%d)\n", __func__, ec, ec->layer_block, ec->is_cursor); - e_input_thread_safe_call(_e_comp_wl_input_thread_cursor_set, &ec_data, sizeof(E_Input_Thread_Request_EClient_Data)); + e_input_backend_thread_safe_call(_e_comp_wl_input_thread_cursor_set, &ec_data, sizeof(E_Input_Thread_Request_EClient_Data)); } /* Set a pointer_object after wl_surface commit @@ -1870,7 +1871,7 @@ e_comp_wl_input_keyboard_enabled_set(Eina_Bool enabled) return; } - e_input_thread_safe_call(_e_comp_wl_input_thread_cb_keyboard_enabled_set, &enabled, sizeof(Eina_Bool)); + e_input_backend_thread_safe_call(_e_comp_wl_input_thread_cb_keyboard_enabled_set, &enabled, sizeof(Eina_Bool)); _e_comp_wl_input_update_seat_caps(NULL); } diff --git a/src/bin/server/e_keyrouter_wl.c b/src/bin/server/e_keyrouter_wl.c index 080ae45..90dbe57 100644 --- a/src/bin/server/e_keyrouter_wl.c +++ b/src/bin/server/e_keyrouter_wl.c @@ -1,5 +1,6 @@ #include "e_keyrouter_intern.h" #include "e_input_intern.h" +#include "e_input_backend_intern.h" #include "e_comp_wl_input_intern.h" #include "e_comp_wl_intern.h" #include "e_client_intern.h" @@ -258,7 +259,7 @@ _e_keyrouter_cb_keygrab_set(struct wl_client *client, struct wl_resource *resour keygrab_data.mode = mode; INF("client: %p, surface: %p, key: %d, mode: %d\n", keygrab_data.client, keygrab_data.surface, keygrab_data.key, keygrab_data.mode); - e_input_thread_safe_call(_e_keyrouter_input_thread_keygrab_set, &keygrab_data, sizeof(E_Input_Thread_Request_Keygrab_Data)); + e_input_backend_thread_safe_call(_e_keyrouter_input_thread_keygrab_set, &keygrab_data, sizeof(E_Input_Thread_Request_Keygrab_Data)); } static void @@ -297,7 +298,7 @@ _e_keyrouter_cb_keygrab_unset(struct wl_client *client, struct wl_resource *reso keygrab_data.mode = TIZEN_KEYROUTER_MODE_NONE; /* UNUSED */ INF("client: %p, surface: %p, key: %d\n", keygrab_data.client, keygrab_data.surface, keygrab_data.key); - e_input_thread_safe_call(_e_keyrouter_input_thread_keygrab_unset, &keygrab_data, sizeof(E_Input_Thread_Request_Keygrab_Data)); + e_input_backend_thread_safe_call(_e_keyrouter_input_thread_keygrab_unset, &keygrab_data, sizeof(E_Input_Thread_Request_Keygrab_Data)); } /* tizen_keyrouter get_keygrab_status request handler */ diff --git a/src/bin/server/e_policy_wl.c b/src/bin/server/e_policy_wl.c index 11289ab..4bb0145 100644 --- a/src/bin/server/e_policy_wl.c +++ b/src/bin/server/e_policy_wl.c @@ -31,7 +31,7 @@ #include "e_utils_intern.h" #include "e_screensaver_intern.h" #include "e_hwc_window_intern.h" -#include "e_input_intern.h" +#include "e_input_backend_intern.h" #include "e_input_thread_client_intern.h" #include @@ -1905,7 +1905,7 @@ _tzpol_iface_cb_role_set(struct wl_client *client EINA_UNUSED, struct wl_resourc ec_data.ec = ec; ec_data.is_cursor = 1; INF("[%s] ec(%p), is_cursor(%d)\n", __func__, ec, ec->is_cursor); - e_input_thread_safe_call(_e_policy_wl_input_thread_cursor_set, &ec_data, sizeof(E_Input_Thread_Request_EClient_Data)); + e_input_backend_thread_safe_call(_e_policy_wl_input_thread_cursor_set, &ec_data, sizeof(E_Input_Thread_Request_EClient_Data)); } } -- 2.7.4