forked from enlightenment/efl
parent
ed3305dc18
commit
cbde94b4e3
|
@ -469,7 +469,9 @@ extern "C" {
|
|||
EAPI void edje_object_part_text_cursor_geometry_get (const Evas_Object *obj, const char *part, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h);
|
||||
EAPI void edje_object_part_text_select_allow_set (const Evas_Object *obj, const char *part, Eina_Bool allow);
|
||||
EAPI void edje_object_part_text_select_abort (const Evas_Object *obj, const char *part);
|
||||
|
||||
EAPI void edje_object_part_text_select_begin (const Evas_Object *obj, const char *part);
|
||||
EAPI void edje_object_part_text_select_extend (const Evas_Object *obj, const char *part);
|
||||
|
||||
EAPI Eina_Bool edje_object_part_text_cursor_next(const Evas_Object *obj, const char *part, Edje_Cursor cur);
|
||||
EAPI Eina_Bool edje_object_part_text_cursor_prev(const Evas_Object *obj, const char *part, Edje_Cursor cur);
|
||||
EAPI Eina_Bool edje_object_part_text_cursor_up(const Evas_Object *obj, const char *part, Edje_Cursor cur);
|
||||
|
|
|
@ -1831,6 +1831,27 @@ _edje_entry_select_all(Edje_Real_Part *rp)
|
|||
_edje_entry_real_part_configure(rp);
|
||||
}
|
||||
|
||||
void
|
||||
_edje_entry_select_begin(Edje_Real_Part *rp)
|
||||
{
|
||||
Entry *en = rp->entry_data;
|
||||
if (!en) return;
|
||||
_sel_clear(en->cursor, rp->object, en);
|
||||
_sel_enable(en->cursor, rp->object, en);
|
||||
_sel_start(en->cursor, rp->object, en);
|
||||
_sel_extend(en->cursor, rp->object, en);
|
||||
_edje_entry_real_part_configure(rp);
|
||||
}
|
||||
|
||||
void
|
||||
_edje_entry_select_extend(Edje_Real_Part *rp)
|
||||
{
|
||||
Entry *en = rp->entry_data;
|
||||
if (!en) return;
|
||||
_sel_extend(en->cursor, rp->object, en);
|
||||
_edje_entry_real_part_configure(rp);
|
||||
}
|
||||
|
||||
const Eina_List *
|
||||
_edje_entry_anchor_geometry_get(Edje_Real_Part *rp, const char *anchor)
|
||||
{
|
||||
|
@ -2044,6 +2065,7 @@ _edje_entry_cursor_copy(Edje_Real_Part *rp, Edje_Cursor cur, Edje_Cursor dst)
|
|||
if (!c) return;
|
||||
Evas_Textblock_Cursor *d = _cursor_get(rp, dst);
|
||||
if (!d) return;
|
||||
printf("copy %p to %p\n", c, d);
|
||||
evas_textblock_cursor_copy(c, d);
|
||||
_curs_update_from_curs(c, rp->object, rp->entry_data);
|
||||
_sel_update(c, rp->object, rp->entry_data);
|
||||
|
|
|
@ -1501,6 +1501,8 @@ void _edje_entry_set_cursor_end(Edje_Real_Part *rp);
|
|||
void _edje_entry_cursor_copy(Edje_Real_Part *rp, Edje_Cursor cur, Edje_Cursor dst);
|
||||
void _edje_entry_select_none(Edje_Real_Part *rp);
|
||||
void _edje_entry_select_all(Edje_Real_Part *rp);
|
||||
void _edje_entry_select_begin(Edje_Real_Part *rp);
|
||||
void _edje_entry_select_extend(Edje_Real_Part *rp);
|
||||
const Eina_List *_edje_entry_anchor_geometry_get(Edje_Real_Part *rp, const char *anchor);
|
||||
const Eina_List *_edje_entry_anchors_list(Edje_Real_Part *rp);
|
||||
void _edje_entry_cursor_geometry_get(Edje_Real_Part *rp, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch);
|
||||
|
|
|
@ -1735,6 +1735,46 @@ edje_object_part_text_select_abort(const Evas_Object *obj, const char *part)
|
|||
_edje_entry_select_abort(rp);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Starts selecting at current cursor position
|
||||
*
|
||||
* @param obj A valid Evas_Object handle
|
||||
* @param part The part name
|
||||
*/
|
||||
EAPI void
|
||||
edje_object_part_text_select_begin(const Evas_Object *obj, const char *part)
|
||||
{
|
||||
Edje *ed;
|
||||
Edje_Real_Part *rp;
|
||||
|
||||
ed = _edje_fetch(obj);
|
||||
if ((!ed) || (!part)) return;
|
||||
rp = _edje_real_part_recursive_get(ed, (char *)part);
|
||||
if (!rp) return;
|
||||
if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
|
||||
_edje_entry_select_begin(rp);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Extends the current selection to the current cursor position
|
||||
*
|
||||
* @param obj A valid Evas_Object handle
|
||||
* @param part The part name
|
||||
*/
|
||||
EAPI void
|
||||
edje_object_part_text_select_extend(const Evas_Object *obj, const char *part)
|
||||
{
|
||||
Edje *ed;
|
||||
Edje_Real_Part *rp;
|
||||
|
||||
ed = _edje_fetch(obj);
|
||||
if ((!ed) || (!part)) return;
|
||||
rp = _edje_real_part_recursive_get(ed, (char *)part);
|
||||
if (!rp) return;
|
||||
if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
|
||||
_edje_entry_select_extend(rp);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief XX
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue