forked from enlightenment/efl
Evas textblock: Renamed newline_mode_set/get -> legacy_newline_set/get.
SVN revision: 61992
This commit is contained in:
parent
c63715e01d
commit
19363f446e
|
@ -7703,20 +7703,20 @@ EAPI const char *evas_object_textblock_bidi_delimiters_get(cons
|
||||||
* as a paragraph separator.
|
* as a paragraph separator.
|
||||||
*
|
*
|
||||||
* @param obj The given textblock object.
|
* @param obj The given textblock object.
|
||||||
* @param mode EINA_TRUE for PS mode, EINA_FALSE otherwise.
|
* @param mode EINA_TRUE for legacy mode, EINA_FALSE otherwise.
|
||||||
* @since 1.1.0
|
* @since 1.1.0
|
||||||
*/
|
*/
|
||||||
EAPI void evas_object_textblock_newline_mode_set(Evas_Object *obj, Eina_Bool mode) EINA_ARG_NONNULL(1);
|
EAPI void evas_object_textblock_legacy_newline_set(Evas_Object *obj, Eina_Bool mode) EINA_ARG_NONNULL(1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Gets newline mode. When true, newline character behaves
|
* @brief Gets newline mode. When true, newline character behaves
|
||||||
* as a paragraph separator.
|
* as a paragraph separator.
|
||||||
*
|
*
|
||||||
* @param obj The given textblock object.
|
* @param obj The given textblock object.
|
||||||
* @return EINA_TRUE if in PS mode, EINA_FALSE otherwise.
|
* @return EINA_TRUE if in legacy mode, EINA_FALSE otherwise.
|
||||||
* @since 1.1.0
|
* @since 1.1.0
|
||||||
*/
|
*/
|
||||||
EAPI Eina_Bool evas_object_textblock_newline_mode_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
|
EAPI Eina_Bool evas_object_textblock_legacy_newline_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -429,7 +429,7 @@ struct _Evas_Object_Textblock
|
||||||
Eina_Bool content_changed : 1;
|
Eina_Bool content_changed : 1;
|
||||||
Eina_Bool format_changed : 1;
|
Eina_Bool format_changed : 1;
|
||||||
Eina_Bool have_ellipsis : 1;
|
Eina_Bool have_ellipsis : 1;
|
||||||
Eina_Bool newline_is_ps : 1;
|
Eina_Bool legacy_newline : 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* private methods for textblock objects */
|
/* private methods for textblock objects */
|
||||||
|
@ -2993,7 +2993,7 @@ _format_finalize(Evas_Object *obj, Evas_Object_Textblock_Format *fmt)
|
||||||
*/
|
*/
|
||||||
#define _IS_PARAGRAPH_SEPARATOR(o, item) \
|
#define _IS_PARAGRAPH_SEPARATOR(o, item) \
|
||||||
(!strcmp(item, "ps") || \
|
(!strcmp(item, "ps") || \
|
||||||
(o->newline_is_ps && _IS_LINE_SEPARATOR(item))) /* Paragraph separator */
|
(o->legacy_newline && _IS_LINE_SEPARATOR(item))) /* Paragraph separator */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
|
@ -3794,7 +3794,7 @@ _layout_par(Ctxt *c)
|
||||||
* mode, or we are in newline compat mode, and this is
|
* mode, or we are in newline compat mode, and this is
|
||||||
* not used as a paragraph separator, advance */
|
* not used as a paragraph separator, advance */
|
||||||
if (fi->item && _IS_LINE_SEPARATOR(fi->item) &&
|
if (fi->item && _IS_LINE_SEPARATOR(fi->item) &&
|
||||||
(!c->o->newline_is_ps ||
|
(!c->o->legacy_newline ||
|
||||||
eina_list_next(i)))
|
eina_list_next(i)))
|
||||||
{
|
{
|
||||||
adv_line = 1;
|
adv_line = 1;
|
||||||
|
@ -4555,22 +4555,22 @@ evas_object_textblock_replace_char_set(Evas_Object *obj, const char *ch)
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
evas_object_textblock_newline_mode_set(Evas_Object *obj, Eina_Bool mode)
|
evas_object_textblock_legacy_newline_set(Evas_Object *obj, Eina_Bool mode)
|
||||||
{
|
{
|
||||||
TB_HEAD();
|
TB_HEAD();
|
||||||
if (o->newline_is_ps == mode)
|
if (o->legacy_newline == mode)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
o->newline_is_ps = mode;
|
o->legacy_newline = mode;
|
||||||
/* FIXME: Should recreate all the textnodes... For now, it's just
|
/* FIXME: Should recreate all the textnodes... For now, it's just
|
||||||
* for new text inserted. */
|
* for new text inserted. */
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI Eina_Bool
|
EAPI Eina_Bool
|
||||||
evas_object_textblock_newline_mode_get(const Evas_Object *obj)
|
evas_object_textblock_legacy_newline_get(const Evas_Object *obj)
|
||||||
{
|
{
|
||||||
TB_HEAD_RETURN(EINA_FALSE);
|
TB_HEAD_RETURN(EINA_FALSE);
|
||||||
return o->newline_is_ps;
|
return o->legacy_newline;
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
|
@ -8596,7 +8596,7 @@ evas_object_textblock_init(Evas_Object *obj)
|
||||||
|
|
||||||
o = (Evas_Object_Textblock *)(obj->object_data);
|
o = (Evas_Object_Textblock *)(obj->object_data);
|
||||||
o->cursor->obj = obj;
|
o->cursor->obj = obj;
|
||||||
o->newline_is_ps = EINA_TRUE;
|
o->legacy_newline = EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *
|
static void *
|
||||||
|
|
|
@ -35,7 +35,7 @@ static const char *style_buf =
|
||||||
evas_font_hinting_set(evas, EVAS_FONT_HINTING_AUTO); \
|
evas_font_hinting_set(evas, EVAS_FONT_HINTING_AUTO); \
|
||||||
tb = evas_object_textblock_add(evas); \
|
tb = evas_object_textblock_add(evas); \
|
||||||
fail_if(!tb); \
|
fail_if(!tb); \
|
||||||
evas_object_textblock_newline_mode_set(tb, EINA_FALSE); \
|
evas_object_textblock_legacy_newline_set(tb, EINA_FALSE); \
|
||||||
st = evas_textblock_style_new(); \
|
st = evas_textblock_style_new(); \
|
||||||
fail_if(!st); \
|
fail_if(!st); \
|
||||||
evas_textblock_style_set(st, style_buf); \
|
evas_textblock_style_set(st, style_buf); \
|
||||||
|
|
Loading…
Reference in New Issue