forked from enlightenment/efl
Evas textblock: Removed unused functions.
SVN revision: 56497
This commit is contained in:
parent
367e75aa70
commit
3d24e2daad
|
@ -2428,74 +2428,6 @@ _layout_word_start(const Eina_Unicode *str, int start)
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @internal
|
|
||||||
* Strips trailing whitespace from the item's text.
|
|
||||||
*
|
|
||||||
* @param c the context to work with - NOT NULL.
|
|
||||||
* @param fmt does nothing.
|
|
||||||
* @param it the item to strip.
|
|
||||||
*
|
|
||||||
* @return #EINA_TRUE if it stripped, #EINA_FALSE otherwise.
|
|
||||||
*/
|
|
||||||
static Eina_Bool
|
|
||||||
_layout_strip_trailing_whitespace(Ctxt *c, Evas_Object_Textblock_Format *fmt __UNUSED__, Evas_Object_Textblock_Item *it)
|
|
||||||
{
|
|
||||||
int p, tp, chr, adv, tw, th;
|
|
||||||
Evas_Object_Textblock_Text_Item *ti;
|
|
||||||
|
|
||||||
/*FIXME: Add support for removing tabs and other whites as well. */
|
|
||||||
if (it->type != EVAS_TEXTBLOCK_ITEM_TEXT) return EINA_FALSE;
|
|
||||||
ti = _ITEM_TEXT(it);
|
|
||||||
|
|
||||||
p = eina_unicode_strlen(ti->text) - 1;
|
|
||||||
tp = p;
|
|
||||||
if (p >= 0)
|
|
||||||
{
|
|
||||||
chr = GET_PREV(ti->text, p);
|
|
||||||
if (_is_white(chr))
|
|
||||||
{
|
|
||||||
_layout_item_text_cutoff(c, ti, tp);
|
|
||||||
adv = 0;
|
|
||||||
if (ti->parent.format->font.font)
|
|
||||||
adv = c->ENFN->font_h_advance_get(c->ENDT,
|
|
||||||
ti->parent.format->font.font,
|
|
||||||
ti->text, &ti->parent.text_props);
|
|
||||||
tw = th = 0;
|
|
||||||
if (ti->parent.format->font.font)
|
|
||||||
c->ENFN->font_string_size_get(c->ENDT,
|
|
||||||
ti->parent.format->font.font,
|
|
||||||
ti->text, &ti->parent.text_props, &tw, &th);
|
|
||||||
it->w = tw;
|
|
||||||
it->h = th;
|
|
||||||
it->adv = adv;
|
|
||||||
c->x = it->x + adv;
|
|
||||||
return EINA_TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return EINA_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* FIXME: document
|
|
||||||
*/
|
|
||||||
static int
|
|
||||||
_layout_item_abort(Ctxt *c, Evas_Object_Textblock_Format *fmt, Evas_Object_Textblock_Item *it)
|
|
||||||
{
|
|
||||||
Evas_Object_Textblock_Text_Item *ti = _ITEM_TEXT(it);
|
|
||||||
|
|
||||||
/*FIXME: handle it in some way? */
|
|
||||||
if (it->type != EVAS_TEXTBLOCK_ITEM_TEXT)
|
|
||||||
return 0;
|
|
||||||
_item_free(c->obj, NULL, _ITEM(ti));
|
|
||||||
if (c->ln->items)
|
|
||||||
{
|
|
||||||
it = (Evas_Object_Textblock_Item *)(EINA_INLIST_GET(c->ln->items))->last;
|
|
||||||
return _layout_strip_trailing_whitespace(c, fmt, it);
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
* returns the index of the words end starting from p
|
* returns the index of the words end starting from p
|
||||||
|
|
Loading…
Reference in New Issue