forked from enlightenment/efl
Edje: add edje_object_part_text_input_panel_show_on_demand_set/get()
This commit is contained in:
parent
bf9c3aad24
commit
f241646370
|
@ -81,6 +81,8 @@ enum
|
|||
EDJE_OBJ_SUB_ID_PART_TEXT_INPUT_PANEL_RETURN_KEY_TYPE_GET,
|
||||
EDJE_OBJ_SUB_ID_PART_TEXT_INPUT_PANEL_RETURN_KEY_DISABLED_SET,
|
||||
EDJE_OBJ_SUB_ID_PART_TEXT_INPUT_PANEL_RETURN_KEY_DISABLED_GET,
|
||||
EDJE_OBJ_SUB_ID_PART_TEXT_INPUT_PANEL_SHOW_ON_DEMAND_SET,
|
||||
EDJE_OBJ_SUB_ID_PART_TEXT_INPUT_PANEL_SHOW_ON_DEMAND_GET,
|
||||
EDJE_OBJ_SUB_ID_TEXT_INSERT_FILTER_CALLBACK_ADD,
|
||||
EDJE_OBJ_SUB_ID_TEXT_INSERT_FILTER_CALLBACK_DEL,
|
||||
EDJE_OBJ_SUB_ID_TEXT_INSERT_FILTER_CALLBACK_DEL_FULL,
|
||||
|
@ -519,6 +521,32 @@ enum
|
|||
*/
|
||||
#define edje_obj_part_text_input_panel_return_key_disabled_get(part, ret) EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_PART_TEXT_INPUT_PANEL_RETURN_KEY_DISABLED_GET), EO_TYPECHECK(const char *, part), EO_TYPECHECK(Eina_Bool *, ret)
|
||||
|
||||
/**
|
||||
* @def edje_obj_part_text_input_panel_show_on_demand_set
|
||||
* @since 1.9
|
||||
*
|
||||
* @brief Set the attribute to show the input panel in case of only an user's explicit Mouse Up event.
|
||||
*
|
||||
* @param[in] part
|
||||
* @param[in] ondemand
|
||||
*
|
||||
* @see edje_object_part_text_input_panel_show_on_demand_set
|
||||
*/
|
||||
#define edje_obj_part_text_input_panel_show_on_demand_set(part, ondemand) EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_PART_TEXT_INPUT_PANEL_SHOW_ON_DEMAND_SET), EO_TYPECHECK(const char *, part), EO_TYPECHECK(Eina_Bool, ondemand)
|
||||
|
||||
/**
|
||||
* @def edje_obj_part_text_input_panel_show_on_demand_get
|
||||
* @since 1.9
|
||||
*
|
||||
* @brief Get the attribute to show the input panel in case of only an user's explicit Mouse Up event.
|
||||
*
|
||||
* @param[in] part
|
||||
* @param[out] ret
|
||||
*
|
||||
* @see edje_object_part_text_input_panel_show_on_demand_get
|
||||
*/
|
||||
#define edje_obj_part_text_input_panel_show_on_demand_get(part, ret) EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_PART_TEXT_INPUT_PANEL_SHOW_ON_DEMAND_GET), EO_TYPECHECK(const char *, part), EO_TYPECHECK(Eina_Bool *, ret)
|
||||
|
||||
/**
|
||||
* @def edje_obj_text_insert_filter_callback_add
|
||||
* @since 1.8
|
||||
|
|
|
@ -1240,6 +1240,27 @@ EAPI void edje_object_part_text_input_panel_return_key_disabled_set(
|
|||
*/
|
||||
EAPI Eina_Bool edje_object_part_text_input_panel_return_key_disabled_get(const Evas_Object *obj, const char *part);
|
||||
|
||||
/**
|
||||
* Set the attribute to show the input panel in case of only an user's explicit Mouse Up event.
|
||||
* It doesn't request to show the input panel even though it has focus.
|
||||
*
|
||||
* @param obj A valid Evas_Object handle
|
||||
* @param part The part name
|
||||
* @param ondemand If true, the input panel will be shown in case of only Mouse up event. (Focus event will be ignored.)
|
||||
* @since 1.9.0
|
||||
*/
|
||||
EAPI void edje_object_part_text_input_panel_show_on_demand_set(Evas_Object *obj, const char *part, Eina_Bool ondemand);
|
||||
|
||||
/**
|
||||
* Get the attribute to show the input panel in case of only an user's explicit Mouse Up event.
|
||||
*
|
||||
* @param obj A valid Evas_Object handle
|
||||
* @param part The part name
|
||||
* @return @c EINA_TRUE if the input panel will be shown in case of only Mouse up event.
|
||||
* @since 1.9.0
|
||||
*/
|
||||
EAPI Eina_Bool edje_object_part_text_input_panel_show_on_demand_get(const Evas_Object *obj, const char *part);
|
||||
|
||||
/**
|
||||
* Add a filter function for newly inserted text.
|
||||
*
|
||||
|
|
|
@ -3302,6 +3302,44 @@ _edje_entry_input_panel_return_key_disabled_get(Edje_Real_Part *rp)
|
|||
#endif
|
||||
}
|
||||
|
||||
#ifdef HAVE_ECORE_IMF
|
||||
void
|
||||
_edje_entry_input_panel_show_on_demand_set(Edje_Real_Part *rp, Eina_Bool ondemand)
|
||||
#else
|
||||
void
|
||||
_edje_entry_input_panel_show_on_demand_set(Edje_Real_Part *rp, Eina_Bool ondemand __UNUSED__)
|
||||
#endif
|
||||
{
|
||||
Entry *en;
|
||||
|
||||
if ((rp->type != EDJE_RP_TYPE_TEXT) ||
|
||||
(!rp->typedata.text)) return;
|
||||
en = rp->typedata.text->entry_data;
|
||||
if (!en) return;
|
||||
#ifdef HAVE_ECORE_IMF
|
||||
if (en->imf_context)
|
||||
ecore_imf_context_input_panel_show_on_demand_set(en->imf_context, ondemand);
|
||||
#endif
|
||||
}
|
||||
|
||||
Eina_Bool
|
||||
_edje_entry_input_panel_show_on_demand_get(Edje_Real_Part *rp)
|
||||
{
|
||||
Entry *en;
|
||||
|
||||
if ((rp->type != EDJE_RP_TYPE_TEXT) ||
|
||||
(!rp->typedata.text)) return EINA_FALSE;
|
||||
en = rp->typedata.text->entry_data;
|
||||
if (!en) return EINA_FALSE;
|
||||
#ifdef HAVE_ECORE_IMF
|
||||
if (en->imf_context) {
|
||||
Eina_Bool ret = ecore_imf_context_input_panel_show_on_demand_get(en->imf_context);
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
static Evas_Textblock_Cursor *
|
||||
_cursor_get(Edje_Real_Part *rp, Edje_Cursor cur)
|
||||
{
|
||||
|
|
|
@ -2340,6 +2340,8 @@ void _edje_entry_input_panel_return_key_type_set(Edje_Real_Part *rp, Edje_Input_
|
|||
Edje_Input_Panel_Return_Key_Type _edje_entry_input_panel_return_key_type_get(Edje_Real_Part *rp);
|
||||
void _edje_entry_input_panel_return_key_disabled_set(Edje_Real_Part *rp, Eina_Bool disabled);
|
||||
Eina_Bool _edje_entry_input_panel_return_key_disabled_get(Edje_Real_Part *rp);
|
||||
void _edje_entry_input_panel_show_on_demand_set(Edje_Real_Part *rp, Eina_Bool ondemand);
|
||||
Eina_Bool _edje_entry_input_panel_show_on_demand_get(Edje_Real_Part *rp);
|
||||
|
||||
void _edje_external_init(void);
|
||||
void _edje_external_shutdown(void);
|
||||
|
@ -2503,6 +2505,8 @@ void _part_text_input_panel_return_key_type_set(Eo *obj, void *_pd, va_list *lis
|
|||
void _part_text_input_panel_return_key_type_get(Eo *obj, void *_pd, va_list *list);
|
||||
void _part_text_input_panel_return_key_disabled_set(Eo *obj, void *_pd, va_list *list);
|
||||
void _part_text_input_panel_return_key_disabled_get(Eo *obj, void *_pd, va_list *list);
|
||||
void _part_text_input_panel_show_on_demand_set(Eo *obj, void *_pd, va_list *list);
|
||||
void _part_text_input_panel_show_on_demand_get(Eo *obj, void *_pd, va_list *list);
|
||||
void _text_insert_filter_callback_add(Eo *obj, void *_pd, va_list *list);
|
||||
void _text_insert_filter_callback_del(Eo *obj, void *_pd, va_list *list);
|
||||
void _text_insert_filter_callback_del_full(Eo *obj, void *_pd, va_list *list);
|
||||
|
|
|
@ -471,6 +471,8 @@ _edje_smart_class_constructor(Eo_Class *klass)
|
|||
EO_OP_FUNC(EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_PART_TEXT_INPUT_PANEL_RETURN_KEY_TYPE_GET), _part_text_input_panel_return_key_type_get),
|
||||
EO_OP_FUNC(EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_PART_TEXT_INPUT_PANEL_RETURN_KEY_DISABLED_SET), _part_text_input_panel_return_key_disabled_set),
|
||||
EO_OP_FUNC(EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_PART_TEXT_INPUT_PANEL_RETURN_KEY_DISABLED_GET), _part_text_input_panel_return_key_disabled_get),
|
||||
EO_OP_FUNC(EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_PART_TEXT_INPUT_PANEL_SHOW_ON_DEMAND_SET), _part_text_input_panel_show_on_demand_set),
|
||||
EO_OP_FUNC(EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_PART_TEXT_INPUT_PANEL_SHOW_ON_DEMAND_GET), _part_text_input_panel_show_on_demand_get),
|
||||
EO_OP_FUNC(EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_TEXT_INSERT_FILTER_CALLBACK_ADD), _text_insert_filter_callback_add),
|
||||
EO_OP_FUNC(EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_TEXT_INSERT_FILTER_CALLBACK_DEL), _text_insert_filter_callback_del),
|
||||
EO_OP_FUNC(EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_TEXT_INSERT_FILTER_CALLBACK_DEL_FULL), _text_insert_filter_callback_del_full),
|
||||
|
@ -619,6 +621,8 @@ static const Eo_Op_Description op_desc[] = {
|
|||
EO_OP_DESCRIPTION(EDJE_OBJ_SUB_ID_PART_TEXT_INPUT_PANEL_RETURN_KEY_TYPE_GET, "Get the return key type."),
|
||||
EO_OP_DESCRIPTION(EDJE_OBJ_SUB_ID_PART_TEXT_INPUT_PANEL_RETURN_KEY_DISABLED_SET, "Set the return key on the input panel to be disabled."),
|
||||
EO_OP_DESCRIPTION(EDJE_OBJ_SUB_ID_PART_TEXT_INPUT_PANEL_RETURN_KEY_DISABLED_GET, "Get whether the return key on the input panel should be disabled or not."),
|
||||
EO_OP_DESCRIPTION(EDJE_OBJ_SUB_ID_PART_TEXT_INPUT_PANEL_SHOW_ON_DEMAND_SET, "Set the attribute to show the input panel in case of only an user's explicit Mouse Up event."),
|
||||
EO_OP_DESCRIPTION(EDJE_OBJ_SUB_ID_PART_TEXT_INPUT_PANEL_SHOW_ON_DEMAND_GET, "Get the attribute to show the input panel in case of only an user's explicit Mouse Up event."),
|
||||
EO_OP_DESCRIPTION(EDJE_OBJ_SUB_ID_TEXT_INSERT_FILTER_CALLBACK_ADD, "Add a filter function for newly inserted text."),
|
||||
EO_OP_DESCRIPTION(EDJE_OBJ_SUB_ID_TEXT_INSERT_FILTER_CALLBACK_DEL, "Delete a function from the filter list."),
|
||||
EO_OP_DESCRIPTION(EDJE_OBJ_SUB_ID_TEXT_INSERT_FILTER_CALLBACK_DEL_FULL, "Delete a function and matching user data from the filter list."),
|
||||
|
|
|
@ -3151,6 +3151,55 @@ _part_text_input_panel_return_key_disabled_get(Eo *obj EINA_UNUSED, void *_pd, v
|
|||
}
|
||||
}
|
||||
|
||||
EAPI void
|
||||
edje_object_part_text_input_panel_show_on_demand_set(Evas_Object *obj, const char *part, Eina_Bool ondemand)
|
||||
{
|
||||
if (!obj) return;
|
||||
eo_do(obj, edje_obj_part_text_input_panel_show_on_demand_set(part, ondemand));
|
||||
}
|
||||
|
||||
void _part_text_input_panel_show_on_demand_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
|
||||
{
|
||||
const char *part = va_arg(*list, const char *);
|
||||
Eina_Bool ondemand = va_arg(*list, int);
|
||||
Edje *ed = _pd;
|
||||
Edje_Real_Part *rp;
|
||||
|
||||
if ((!ed) || (!part)) return;
|
||||
rp = _edje_real_part_recursive_get(&ed, part);
|
||||
if (!rp) return;
|
||||
if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
|
||||
{
|
||||
_edje_entry_input_panel_show_on_demand_set(rp, ondemand);
|
||||
}
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
edje_object_part_text_input_panel_show_on_demand_get(const Evas_Object *obj, const char *part)
|
||||
{
|
||||
if (!obj) return EINA_FALSE;
|
||||
Eina_Bool ret = EINA_FALSE;
|
||||
eo_do((Eo *)obj, edje_obj_part_text_input_panel_show_on_demand_get(part, &ret));
|
||||
return ret;
|
||||
}
|
||||
|
||||
void _part_text_input_panel_show_on_demand_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
|
||||
{
|
||||
const char *part = va_arg(*list, const char *);
|
||||
Eina_Bool *ret = va_arg(*list, Eina_Bool *);
|
||||
Edje *ed = _pd;
|
||||
Edje_Real_Part *rp;
|
||||
*ret = EINA_FALSE;
|
||||
|
||||
if ((!ed) || (!part)) return;
|
||||
rp = _edje_real_part_recursive_get(&ed, part);
|
||||
if (!rp) return;
|
||||
if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
|
||||
{
|
||||
*ret = _edje_entry_input_panel_show_on_demand_get(rp);
|
||||
}
|
||||
}
|
||||
|
||||
EAPI void
|
||||
edje_object_text_insert_filter_callback_add(Evas_Object *obj, const char *part, Edje_Text_Filter_Cb func, void *data)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue