From: InHong Han Date: Fri, 14 Jan 2022 04:13:49 +0000 (+0900) Subject: Separated floating IME functions from wl_input_method_context_interface X-Git-Tag: submit/tizen_6.5/20220117.043908~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=265bfd8a21400745114ee76bd0314303a4830dbb;p=platform%2Fcore%2Fuifw%2Fe-mod-tizen-wl-textinput.git Separated floating IME functions from wl_input_method_context_interface Change-Id: I61e6eaed90ecfc04ef4862191f45f686ce55da5a --- diff --git a/src/Makefile.am b/src/Makefile.am index a1dd9ec..6098d30 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -9,6 +9,7 @@ pkg_LTLIBRARIES = module.la module_la_SOURCES = e_mod_main.c \ e_mod_input_panel.c \ e_mod_input_method_manager.c \ + e_mod_input_panel_type.c \ wti_log.c module_la_LIBADD = module_la_CFLAGS = @WAYLAND_CFLAGS@ @ENLIGHTENMENT_CFLAGS@ @EEZE_CFLAGS@ @ECORE_CFLAGS@ @EINA_CFLAGS@ @VCONF_CFLAGS@ @CAPI_SYSTEM_INFO_CFLAGS@ @XKBCOMMON_CFLAGS@ -DHAVE_WAYLAND_ONLY -DHAVE_WAYLAND diff --git a/src/e_mod_input_panel_type.c b/src/e_mod_input_panel_type.c new file mode 100644 index 0000000..6ac6c4e --- /dev/null +++ b/src/e_mod_input_panel_type.c @@ -0,0 +1,79 @@ +#define E_COMP_WL +#include "e.h" +#include "e_mod_main.h" +#include "e_mod_input_panel_type.h" +#include +#include + +typedef struct _E_Input_Panel_Type E_Input_Panel_Type; + +struct _E_Input_Panel_Type +{ + struct wl_global *global; + struct wl_resource *resource; +}; + +static void +_e_input_panel_type_cb_floating_panel_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, uint32_t state) +{ + e_input_panel_floating_panel_set(state ? EINA_TRUE : EINA_FALSE); +} + +static void +_e_input_panel_type_cb_floating_drag_enabled_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, uint32_t enabled) +{ + e_input_panel_floating_drag_enabled(enabled ? EINA_TRUE : EINA_FALSE); +} + +static const struct wl_input_panel_type_interface _e_input_panel_type_interface = +{ + _e_input_panel_type_cb_floating_panel_set, + _e_input_panel_type_cb_floating_drag_enabled_set, +}; + +static void +_e_input_panel_type_cb_unbind(struct wl_resource *resource) +{ + LOGD(""); +} + +static void +_e_input_panel_type_cb_bind(struct wl_client *client, void *data, uint32_t version EINA_UNUSED, uint32_t id) +{ + LOGD(""); + E_Input_Panel_Type *input_panel_type = data; + + input_panel_type->resource = + wl_resource_create(client, + &wl_input_panel_type_interface, 1, id); + + if (input_panel_type->resource) + wl_resource_set_implementation(input_panel_type->resource, + &_e_input_panel_type_interface, + input_panel_type, _e_input_panel_type_cb_unbind); +} + +Eina_Bool +e_input_panel_type_create(void) +{ + E_Input_Panel_Type *input_panel_type; + + if (!(input_panel_type = E_NEW(E_Input_Panel_Type, 1))) + { + ERR("Could not allocate space for Input_Panel_Type"); + return EINA_FALSE; + } + + input_panel_type->global = + wl_global_create(e_comp_wl->wl.disp, + &wl_input_panel_type_interface, 1, + input_panel_type, _e_input_panel_type_cb_bind); + + if (!input_panel_type->global) + { + free(input_panel_type); + return EINA_FALSE; + } + + return EINA_TRUE; +} \ No newline at end of file diff --git a/src/e_mod_input_panel_type.h b/src/e_mod_input_panel_type.h new file mode 100644 index 0000000..a51a95f --- /dev/null +++ b/src/e_mod_input_panel_type.h @@ -0,0 +1,8 @@ +#ifndef _E_MOD_INPUT_PANEL_TYPE_H +#define _E_MOD_INPUT_PANEL_TYPE_H + +#include + +Eina_Bool e_input_panel_type_create(void); + +#endif /* _E_MOD_INPUT_PANEL_TYPE_H */ \ No newline at end of file diff --git a/src/e_mod_main.c b/src/e_mod_main.c index d2ac3a1..4f225b0 100644 --- a/src/e_mod_main.c +++ b/src/e_mod_main.c @@ -2,6 +2,7 @@ #include "e.h" #include "e_mod_main.h" #include "e_mod_input_method_manager.h" +#include "e_mod_input_panel_type.h" #include #include #include @@ -1105,18 +1106,6 @@ _e_text_input_method_context_cb_reshow_input_panel(struct wl_client *client EINA e_input_panel_wait_update_set(EINA_TRUE); } -static void -_e_text_input_moethod_context_cb_set_floating_panel(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, uint32_t state) -{ - e_input_panel_floating_panel_set(state ? EINA_TRUE : EINA_FALSE); -} - -static void -_e_text_input_moethod_context_cb_set_floating_drag_enabled(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, uint32_t enabled) -{ - e_input_panel_floating_drag_enabled(enabled ? EINA_TRUE : EINA_FALSE); -} - static const struct wl_input_method_context_interface _e_text_input_method_context_implementation = { _e_text_input_method_context_cb_destroy, _e_text_input_method_context_cb_string_commit, @@ -1145,8 +1134,6 @@ static const struct wl_input_method_context_interface _e_text_input_method_conte _e_text_input_method_context_cb_commit_content, _e_text_input_method_context_cb_update_candidate_state, _e_text_input_method_context_cb_reshow_input_panel, - _e_text_input_moethod_context_cb_set_floating_panel, - _e_text_input_moethod_context_cb_set_floating_drag_enabled, }; static void @@ -2613,6 +2600,9 @@ e_modapi_init(E_Module *m) if (!e_input_method_manager_create()) goto err; + if (!e_input_panel_type_create()) + goto err; + E_LIST_HANDLER_APPEND(handlers, E_EVENT_CLIENT_RESIZE, _e_text_input_method_context_cb_client_resize, NULL); if (vconf_notify_key_changed(VCONFKEY_ISF_HW_KEYBOARD_INPUT_DETECTED, _keyboard_mode_changed_cb, NULL) != 0)