forked from enlightenment/efl
Edje text: Added edje_object_part_text_append.
SVN revision: 59407
This commit is contained in:
parent
e4dada93e6
commit
30847d0bdc
|
@ -84,3 +84,9 @@
|
||||||
|
|
||||||
* size_min_restricted_calc: Fixed textblock handling.
|
* size_min_restricted_calc: Fixed textblock handling.
|
||||||
|
|
||||||
|
2011-05-15 Tom Hacohen (TAsn)
|
||||||
|
|
||||||
|
* Entry - New API: added edje_object_part_text_append which appends
|
||||||
|
text to the end of the textblock part. This lets us do cool thing
|
||||||
|
like population of textblock using idler.
|
||||||
|
|
||||||
|
|
|
@ -2167,6 +2167,20 @@ EAPI void edje_object_part_text_select_all (const Evas_
|
||||||
*/
|
*/
|
||||||
EAPI void edje_object_part_text_insert (Evas_Object *obj, const char *part, const char *text);
|
EAPI void edje_object_part_text_insert (Evas_Object *obj, const char *part, const char *text);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Insert text for an object part.
|
||||||
|
*
|
||||||
|
* @param obj A valid Evas Object handle
|
||||||
|
* @param part The part name
|
||||||
|
* @param text The text string
|
||||||
|
*
|
||||||
|
* This function inserts the text for an object part at the end; It does not
|
||||||
|
* move the cursor.
|
||||||
|
*
|
||||||
|
* @since 1.1
|
||||||
|
*/
|
||||||
|
EAPI void edje_object_part_text_append(Evas_Object *obj, const char *part, const char *text);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Return a list of char anchor names.
|
* @brief Return a list of char anchor names.
|
||||||
*
|
*
|
||||||
|
|
|
@ -2043,6 +2043,27 @@ _edje_entry_text_markup_set(Edje_Real_Part *rp, const char *text)
|
||||||
_edje_entry_set_cursor_start(rp);
|
_edje_entry_set_cursor_start(rp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
_edje_entry_text_markup_append(Edje_Real_Part *rp, const char *text)
|
||||||
|
{
|
||||||
|
Entry *en = rp->entry_data;
|
||||||
|
Evas_Textblock_Cursor *end_cur;
|
||||||
|
if (!en) return;
|
||||||
|
end_cur = evas_object_textblock_cursor_new(rp->object);
|
||||||
|
evas_textblock_cursor_paragraph_last(end_cur);
|
||||||
|
|
||||||
|
_text_filter_markup_prepend(en, end_cur, text);
|
||||||
|
evas_textblock_cursor_free(end_cur);
|
||||||
|
|
||||||
|
/* We are updating according to the real cursor on purpose */
|
||||||
|
_anchors_get(en->cursor, rp->object, en);
|
||||||
|
_curs_update_from_curs(en->cursor, rp->object, en);
|
||||||
|
_edje_emit(rp->edje, "entry,changed", rp->part->name);
|
||||||
|
_edje_emit(rp->edje, "cursor,changed", rp->part->name);
|
||||||
|
|
||||||
|
_edje_entry_real_part_configure(rp);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
_edje_entry_text_markup_insert(Edje_Real_Part *rp, const char *text)
|
_edje_entry_text_markup_insert(Edje_Real_Part *rp, const char *text)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1770,6 +1770,7 @@ const char *_edje_entry_selection_get(Edje_Real_Part *rp);
|
||||||
const char *_edje_entry_text_get(Edje_Real_Part *rp);
|
const char *_edje_entry_text_get(Edje_Real_Part *rp);
|
||||||
void _edje_entry_text_markup_set(Edje_Real_Part *rp, const char *text);
|
void _edje_entry_text_markup_set(Edje_Real_Part *rp, const char *text);
|
||||||
void _edje_entry_text_markup_insert(Edje_Real_Part *rp, const char *text);
|
void _edje_entry_text_markup_insert(Edje_Real_Part *rp, const char *text);
|
||||||
|
void _edje_entry_text_markup_append(Edje_Real_Part *rp, const char *text);
|
||||||
void _edje_entry_set_cursor_start(Edje_Real_Part *rp);
|
void _edje_entry_set_cursor_start(Edje_Real_Part *rp);
|
||||||
void _edje_entry_set_cursor_end(Edje_Real_Part *rp);
|
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_cursor_copy(Edje_Real_Part *rp, Edje_Cursor cur, Edje_Cursor dst);
|
||||||
|
|
|
@ -1173,6 +1173,28 @@ edje_object_part_text_insert(Evas_Object *obj, const char *part, const char *tex
|
||||||
rp->edje->text_change.func(rp->edje->text_change.data, obj, part);
|
rp->edje->text_change.func(rp->edje->text_change.data, obj, part);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
edje_object_part_text_append(Evas_Object *obj, const char *part, const char *text)
|
||||||
|
{
|
||||||
|
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->type != EDJE_PART_TYPE_TEXTBLOCK)) return;
|
||||||
|
if (rp->part->entry_mode <= EDJE_ENTRY_EDIT_MODE_NONE) return;
|
||||||
|
_edje_entry_text_markup_append(rp, text);
|
||||||
|
rp->edje->dirty = 1;
|
||||||
|
#ifdef EDJE_CALC_CACHE
|
||||||
|
rp->invalidate = 1;
|
||||||
|
#endif
|
||||||
|
_edje_recalc(rp->edje);
|
||||||
|
if (rp->edje->text_change.func)
|
||||||
|
rp->edje->text_change.func(rp->edje->text_change.data, obj, part);
|
||||||
|
}
|
||||||
|
|
||||||
EAPI const Eina_List *
|
EAPI const Eina_List *
|
||||||
edje_object_part_text_anchor_list_get(const Evas_Object *obj, const char *part)
|
edje_object_part_text_anchor_list_get(const Evas_Object *obj, const char *part)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue