2012-02-06 Jihoon Kim (jihoon)
* Set ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL as default layout in ecore_imf_context_add.
+ * Add Ecore_IMF function to set or get the input panel-specific data.
void (*input_panel_language_set) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Lang lang);
Ecore_IMF_Input_Panel_Lang (*input_panel_language_get) (Ecore_IMF_Context *ctx);
void (*cursor_location_set) (Ecore_IMF_Context *ctx, int x, int y, int w, int h);
+ void (*input_panel_imdata_set)(Ecore_IMF_Context *ctx, const void* data, int len);
+ void (*input_panel_imdata_get)(Ecore_IMF_Context *ctx, void* data, int *len);
};
struct _Ecore_IMF_Context_Info
EAPI Ecore_IMF_Input_Panel_Lang ecore_imf_context_input_panel_language_get(Ecore_IMF_Context *ctx);
EAPI void ecore_imf_context_input_panel_enabled_set(Ecore_IMF_Context *ctx, Eina_Bool enable);
EAPI Eina_Bool ecore_imf_context_input_panel_enabled_get(Ecore_IMF_Context *ctx);
+EAPI void ecore_imf_context_input_panel_imdata_set(Ecore_IMF_Context *ctx, const void *data, int len);
+EAPI void ecore_imf_context_input_panel_imdata_get(Ecore_IMF_Context *ctx, void *data, int *len);
/* The following entry points must be exported by each input method module
*/
return ctx->input_panel_enabled;
}
+/**
+ * Set the input panel-specific data to deliver to the input panel.
+ * this API is used by applications to deliver specific data to the input panel.
+ * the data format MUST be negotiated by both application and the input panel.
+ * The size and format of data are defined by the input panel.
+ *
+ * @param ctx An #Ecore_IMF_Context.
+ * @param data The specific data to be set to the input panel.
+ * @param len the length of data, in bytes, to send to the input panel
+ * @ingroup Ecore_IMF_Context_Group
+ * @since 1.2.0
+ */
+EAPI void
+ecore_imf_context_input_panel_imdata_set(Ecore_IMF_Context *ctx, const void *data, int len)
+{
+ if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
+ {
+ ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
+ "ecore_imf_context_input_panel_imdata_set");
+ return;
+ }
+
+ if (!data) return;
+
+ if (ctx->klass->input_panel_imdata_set)
+ ctx->klass->input_panel_imdata_set(ctx, data, len);
+}
+
+/**
+ * Get the specific data of the current active input panel.
+ *
+ * @param ctx An #Ecore_IMF_Context.
+ * @param data The specific data to be got from the input panel
+ * @param len The length of data
+ * @ingroup Ecore_IMF_Context_Group
+ * @since 1.2.0
+ */
+EAPI void
+ecore_imf_context_input_panel_imdata_get(Ecore_IMF_Context *ctx, void *data, int *len)
+{
+ if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
+ {
+ ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
+ "ecore_imf_context_input_panel_imdata_get");
+ return;
+ }
+
+ if (!data) return;
+
+ if (ctx->klass->input_panel_imdata_get)
+ ctx->klass->input_panel_imdata_get(ctx, data, len);
+}
NULL, /* isf_imf_context_input_panel_layout_get, */
NULL, /* isf_imf_context_input_panel_language_set, */
NULL, /* isf_imf_context_input_panel_language_get, */
- isf_imf_context_cursor_location_set /* cursor_location_set */
+ isf_imf_context_cursor_location_set, /* cursor_location_set */
+ NULL, /* input_panel_imdata_set */
+ NULL, /* input_panel_imdata_get */
};
static Ecore_IMF_Context *imf_module_create (void);
.input_panel_language_set = NULL,
.input_panel_language_get = NULL,
.cursor_location_set = _ecore_imf_context_xim_cursor_location_set,
+ .input_panel_imdata_set = NULL,
+ .input_panel_imdata_get = NULL,
};
static Ecore_IMF_Context *