#endif
#define LOG_TAG "WL_TEXTINPUT"
+#define WTI_WARNING(resource, code, msg) (_e_input_panel_log_show((resource), (code), (msg), __func__))
+
typedef struct _E_Input_Panel E_Input_Panel;
typedef struct _E_Input_Panel_Surface E_Input_Panel_Surface;
Eina_List *handlers = NULL;
static Eina_Bool panel_show_need_rerun = EINA_FALSE;
+static void
+_e_input_panel_log_show(struct wl_resource *resource, uint32_t code, const char *msg, const char *warning_msg)
+{
+ LOGW("%s() is failed\n", warning_msg);
+ wl_resource_post_error(resource, code, "%s", msg);
+}
+
static Eina_Bool
_e_input_panel_is_effect_running(E_Client *ec)
{
if (!ips)
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Input Panel Surface For Surface");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Input Panel Surface For Surface");
return;
}
if (!ips)
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Input Panel Surface For Surface");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Input Panel Surface For Surface");
return;
}
if (!ips)
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Input Panel Surface For Surface");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Input Panel Surface For Surface");
return;
}
if (!ips)
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Input Panel Surface For Surface");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Input Panel Surface For Surface");
return;
}
if (!(ips = wl_resource_get_user_data(resource)))
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Input Panel Surface For Surface");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Input Panel Surface For Surface");
return;
}
if (!(ec = ips->ec))
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Client For Input Panel Surface");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Client For Input Panel Surface");
return;
}
if (!(ips = wl_resource_get_user_data(resource)))
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Input Panel Surface For Surface");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Input Panel Surface For Surface");
return;
}
if (!(ec = ips->ec))
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Client For Input Panel Surface");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Client For Input Panel Surface");
return;
}
if (!ec->comp_data)
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Data For Client");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Data For Client");
return;
}
if (!(ips = wl_resource_get_user_data(resource)))
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Input Panel Surface For Surface");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Input Panel Surface For Surface");
return;
}
if (!(ec = ips->ec))
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Client For Input Panel Surface");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Client For Input Panel Surface");
return;
}
if (!ec->comp_data)
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Data For Client");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Data For Client");
return;
}
if (!input_panel)
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Input Panel Surface For Surface");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Input Panel Surface For Surface");
return;
}
if (!ec)
{
- wl_resource_post_error(surface_resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No E_Client Set On Surface");
+ WTI_WARNING(surface_resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No E_Client Set On Surface");
return;
}
if (!(cdata = ec->comp_data))
{
- wl_resource_post_error(surface_resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Data For Client");
+ WTI_WARNING(surface_resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Data For Client");
return;
}
/* check for existing shell surface */
if (cdata->shell.surface)
{
- wl_resource_post_error(surface_resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "Client already has shell surface");
+ WTI_WARNING(surface_resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "Client already has shell surface");
return;
}
if (!input_panel)
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Input Panel For Resource");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Input Panel For Resource");
return;
}
return;
}
- wl_resource_post_error(resource, WL_DISPLAY_ERROR_INVALID_OBJECT,
- "input_panel object already bound");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "input_panel object already bound");
}
void
#endif
#define LOG_TAG "WL_TEXTINPUT"
+#define WTI_WARNING(resource, code, msg) (_e_text_input_log_show((resource), (code), (msg), __func__))
+
static Eina_Bool _e_text_input_method_context_cb_client_resize(void *data EINA_UNUSED, int type, void *event);
static void set_soft_keyboard_mode();
static Eina_Bool _e_text_input_method_create_context(struct wl_client *client, E_Input_Method *input_method, E_Text_Input *text_input);
static void
+_e_text_input_log_show(struct wl_resource *resource, uint32_t code, const char *msg, const char *warning_msg)
+{
+ LOGW("%s() is failed\n", warning_msg);
+ wl_resource_post_error(resource, code, "%s", msg);
+}
+
+static void
_e_text_input_send_input_panel_geometry(struct wl_resource *resource, int x, int y, int w, int h)
{
int angle = 0;
if (!text_input)
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Text Input For Resource");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Text Input For Resource");
return;
}
if (!context)
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Input Method Context For Resource");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Input Method Context For Resource");
return;
}
if (!context)
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Input Method Context For Resource");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Input Method Context For Resource");
return;
}
if (!context)
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Input Method Context For Resource");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Input Method Context For Resource");
return;
}
if (!context)
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Input Method Context For Resource");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Input Method Context For Resource");
return;
}
if (!context)
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Input Method Context For Resource");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Input Method Context For Resource");
return;
}
if (!context)
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Input Method Context For Resource");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Input Method Context For Resource");
return;
}
if (!context)
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Input Method Context For Resource");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Input Method Context For Resource");
return;
}
if (!context)
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Input Method Context For Resource");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Input Method Context For Resource");
return;
}
if (!context)
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Input Method Context For Resource");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Input Method Context For Resource");
return;
}
if (!context)
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Input Method Context For Resource");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Input Method Context For Resource");
return;
}
if (!context)
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Input Method Context For Resource");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Input Method Context For Resource");
return;
}
if (!context)
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Input Method Context For Resource");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Input Method Context For Resource");
return;
}
if (!context)
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Input Method Context For Resource");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Input Method Context For Resource");
return;
}
if (!context)
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Input Method Context For Resource");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Input Method Context For Resource");
return;
}
if (!context)
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Input Method Context For Resource");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Input Method Context For Resource");
return;
}
if (!text_input)
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Text Input For Resource");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Text Input For Resource");
return;
}
if (!context)
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Input Method Context For Resource");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Input Method Context For Resource");
close (fd);
return;
}
if (!context)
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Input Method Context For Resource");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Input Method Context For Resource");
close (fd);
return;
}
if (!context)
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Input Method Context For Resource");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Input Method Context For Resource");
return;
}
if (!context)
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Input Method Context For Resource");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Input Method Context For Resource");
return;
}
err:
if (resource)
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Text Input For Resource");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Text Input For Resource");
+
if (seat)
- wl_resource_post_error(seat,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Comp Data For Seat");
+ WTI_WARNING(seat,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Comp Data For Seat");
}
static void
if (!text_input)
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Text Input For Resource");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Text Input For Resource");
return;
}
if (!input_method)
{
- wl_resource_post_error(seat,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Input Method For Seat");
+ WTI_WARNING(seat,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Input Method For Seat");
return;
}
static void
_e_text_input_cb_input_panel_show(struct wl_client *client, struct wl_resource *resource)
{
+ LOGD("");
E_Text_Input *text_input = wl_resource_get_user_data(resource);
E_Input_Method *input_method = NULL;
if (!text_input)
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Text Input For Resource");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Text Input For Resource");
return;
}
if (!text_input)
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Text Input For Resource");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Text Input For Resource");
return;
}
if (!text_input)
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Text Input For Resource");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Text Input For Resource");
return;
}
if (!text_input)
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Text Input For Resource");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Text Input For Resource");
return;
}
if (!text_input)
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Text Input For Resource");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Text Input For Resource");
return;
}
if (!text_input)
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Text Input For Resource");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Text Input For Resource");
return;
}
if (!text_input)
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Text Input For Resource");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Text Input For Resource");
return;
}
if (!text_input)
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Text Input For Resource");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Text Input For Resource");
return;
}
if (!text_input)
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Text Input For Resource");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Text Input For Resource");
return;
}
if (!text_input)
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Text Input For Resource");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Text Input For Resource");
return;
}
if (!text_input)
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Text Input For Resource");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Text Input For Resource");
return;
}
if (!text_input)
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Text Input For Resource");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Text Input For Resource");
return;
}
if (!text_input)
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Text Input For Resource");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Text Input For Resource");
return;
}
if (!text_input)
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Text Input For Resource");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Text Input For Resource");
return;
}
if (!text_input)
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Text Input For Resource");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Text Input For Resource");
return;
}
if (!text_input)
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Text Input For Resource");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Text Input For Resource");
return;
}
if (!text_input)
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Text Input For Resource");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Text Input For Resource");
return;
}
if (!text_input_mgr)
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Text Input Manager For Resource");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Text Input Manager For Resource");
return;
}
static void
_e_text_input_method_cb_unbind(struct wl_resource *resource)
{
+ LOGD("");
E_Input_Method *input_method = wl_resource_get_user_data(resource);
if (!input_method)
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Input Method For Resource");
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Input Method For Resource");
return;
}
static void
_e_text_input_method_cb_bind(struct wl_client *client, void *data, uint32_t version EINA_UNUSED, uint32_t id)
{
+ LOGD("");
E_Input_Method *input_method = data;
struct wl_resource *resource = NULL;
if (input_method->resource)
{
- wl_resource_post_error(input_method->resource, WL_DISPLAY_ERROR_INVALID_OBJECT,
- "input_method object already bound");
+ WTI_WARNING(input_method->resource, WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "input_method object already bound");
return;
}