forked from enlightenment/efl
Elm entry/scrolled_enry: Added *_entry_append API.
This is very useful when you want to feed an entry from a socket for example and you don't want to wait until all the information is received SVN revision: 60267
This commit is contained in:
parent
fda013920d
commit
9b3ec1000e
|
@ -1360,6 +1360,7 @@ extern "C" {
|
|||
EAPI Eina_Bool elm_entry_password_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||
EAPI void elm_entry_entry_set(Evas_Object *obj, const char *entry) EINA_ARG_NONNULL(1);
|
||||
EAPI const char *elm_entry_entry_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||
EAPI void elm_entry_entry_append(Evas_Object *obj, const char *entry) EINA_ARG_NONNULL(1);
|
||||
EAPI Eina_Bool elm_entry_is_empty(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||
EAPI const char *elm_entry_selection_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||
EAPI void elm_entry_entry_insert(Evas_Object *obj, const char *entry) EINA_ARG_NONNULL(1);
|
||||
|
@ -2592,6 +2593,7 @@ EAPI Elm_Genlist_Item *elm_genlist_item_sorted_insert(Evas_Object *obj, const El
|
|||
EAPI Eina_Bool elm_scrolled_entry_password_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||
EAPI void elm_scrolled_entry_entry_set(Evas_Object *obj, const char *entry) EINA_ARG_NONNULL(1);
|
||||
EAPI const char *elm_scrolled_entry_entry_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||
EAPI void elm_scrolled_entry_entry_append(Evas_Object *obj, const char *entry) EINA_ARG_NONNULL(1);
|
||||
EAPI Eina_Bool elm_scrolled_entry_is_empty(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||
EAPI const char *elm_scrolled_entry_selection_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||
EAPI void elm_scrolled_entry_entry_insert(Evas_Object *obj, const char *entry) EINA_ARG_NONNULL(1);
|
||||
|
|
|
@ -743,6 +743,23 @@ elm_scrolled_entry_entry_set(Evas_Object *obj, const char *entry)
|
|||
elm_entry_entry_set(wd->entry, entry);
|
||||
}
|
||||
|
||||
/**
|
||||
* This appends @p entry to the scrolled entry
|
||||
*
|
||||
* @param obj The scrolled entry object
|
||||
* @param entry The text to be displayed
|
||||
*
|
||||
* @ingroup Scrolled_Entry
|
||||
*/
|
||||
EAPI void
|
||||
elm_scrolled_entry_entry_append(Evas_Object *obj, const char *entry)
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return;
|
||||
elm_entry_entry_append(wd->entry, entry);
|
||||
}
|
||||
|
||||
/**
|
||||
* This returns the text currently shown in object @p entry.
|
||||
* See also elm_scrolled_entry_entry_set().
|
||||
|
|
|
@ -1906,6 +1906,45 @@ elm_entry_entry_set(Evas_Object *obj, const char *entry)
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This appends @p entry to the text of the entry.
|
||||
*
|
||||
* @param obj The entry object
|
||||
* @param entry The text to be displayed
|
||||
*
|
||||
* @ingroup Entry
|
||||
*/
|
||||
EAPI void
|
||||
elm_entry_entry_append(Evas_Object *obj, const char *entry)
|
||||
{
|
||||
int len = 0;
|
||||
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return;
|
||||
if (!entry) entry = "";
|
||||
wd->changed = EINA_TRUE;
|
||||
|
||||
len = strlen(entry);
|
||||
if (wd->append_text_left)
|
||||
{
|
||||
char *tmpbuf;
|
||||
tmpbuf = realloc(wd->append_text_left, wd->append_text_len + len + 1);
|
||||
if (!tmpbuf)
|
||||
{
|
||||
/* Do something */
|
||||
return;
|
||||
}
|
||||
wd->append_text_left = tmpbuf;
|
||||
memcpy(wd->append_text_left + wd->append_text_len, entry, len + 1);
|
||||
wd->append_text_len += len;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* FIXME: Add chunked appending here (like in entry_set) */
|
||||
edje_object_part_text_append(wd->ent, "elm.text", entry);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This returns the text currently shown in object @p entry.
|
||||
* See also elm_entry_entry_set().
|
||||
|
|
Loading…
Reference in New Issue