From 9f068c55dbf1ce1017492d4d84133d0acbd903c8 Mon Sep 17 00:00:00 2001 From: InHong Han Date: Thu, 14 Sep 2017 10:39:03 +0900 Subject: [PATCH] ecore_imf: Add ecore_imf_context_input_panel_position_set API Summary: Sets the x,y coordinates of the input panel Test Plan: Tested in Tizen device Reviewers: woohyun, id213sin, jihoon, cedric Subscribers: jpeg, jihoon, cedric Differential Revision: https://phab.enlightenment.org/D5193 --- src/lib/ecore_imf/Ecore_IMF.h | 14 ++++++++++++++ src/lib/ecore_imf/ecore_imf_context.c | 16 ++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/src/lib/ecore_imf/Ecore_IMF.h b/src/lib/ecore_imf/Ecore_IMF.h index 53fc118..af6cd4e 100644 --- a/src/lib/ecore_imf/Ecore_IMF.h +++ b/src/lib/ecore_imf/Ecore_IMF.h @@ -729,6 +729,7 @@ struct _Ecore_IMF_Context_Class Ecore_IMF_Input_Panel_Keyboard_Mode (*keyboard_mode_get) (Ecore_IMF_Context *ctx); /**< Return the current keyboard mode of the input panel */ void (*prediction_hint_set) (Ecore_IMF_Context *ctx, const char *prediction_hint); /**< Set the prediction hint to the input panel */ void (*mime_type_accept_set) (Ecore_IMF_Context *ctx, const char *mime_type); /**< Set the MIME type to the input panel */ + void (*input_panel_position_set) (Ecore_IMF_Context *ctx, int x, int y); /**< Set the position of the input panel */ }; /** @@ -1934,6 +1935,19 @@ EAPI void ecore_imf_context_prediction_hint_set(Ecore_I */ EAPI void ecore_imf_context_mime_type_accept_set(Ecore_IMF_Context *ctx, const char *mime_type); +/** + * @ingroup Ecore_IMF_Context_Group + * @brief Sets the x,y coordinates of the input panel. + * This API can be used in floating mode. + * + * @since 1.21.0 + * + * @param[in] ctx An #Ecore_IMF_Context + * @param x top-left x coordinate of the input panel + * @param y top-left y coordinate of the input panel + */ +EAPI void ecore_imf_context_input_panel_position_set(Ecore_IMF_Context *ctx, int x, int y); + /* The following entry points must be exported by each input method module */ diff --git a/src/lib/ecore_imf/ecore_imf_context.c b/src/lib/ecore_imf/ecore_imf_context.c index caa2d59..1b34e0c 100644 --- a/src/lib/ecore_imf/ecore_imf_context.c +++ b/src/lib/ecore_imf/ecore_imf_context.c @@ -1445,3 +1445,19 @@ ecore_imf_context_mime_type_accept_set(Ecore_IMF_Context *ctx, const char *mime_ if (ctx->klass->mime_type_accept_set) ctx->klass->mime_type_accept_set(ctx, mime_type); } + +EAPI void +ecore_imf_context_input_panel_position_set(Ecore_IMF_Context *ctx, int x, int y) +{ + if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) + { + ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT, + "ecore_imf_context_input_panel_position_set"); + return; + } + + if (x < 0 || y < 0) return; + + if (ctx->klass->input_panel_position_set) + ctx->klass->input_panel_position_set(ctx, x, y); +} \ No newline at end of file -- 2.7.4