Evas bidi: Added defines for bidi paragraph types (instead of using the fribidi defines).

SVN revision: 51131
This commit is contained in:
Tom Hacohen 2010-08-15 14:36:20 +00:00
parent b2b95df2be
commit 660a7b8ee4
3 changed files with 17 additions and 7 deletions

View File

@ -1457,7 +1457,7 @@ evas_object_text_new(void)
o->prev = o->cur;
o->cur.intl_props.props = &o->cur.paragraph_bidi_props;
#ifdef BIDI_SUPPORT
o->cur.intl_props.props->direction = FRIBIDI_PAR_ON;
o->cur.intl_props.props->direction = EVAS_BIDI_PARAGRAPH_NATURAL;
#endif
return o;
}

View File

@ -1860,10 +1860,8 @@ _layout_line_align_get(Ctxt *c)
if (c->align_auto && c->ln && c->ln->items)
{
if (c->ln->items->source_node &&
((c->ln->items->source_node->bidi_props.direction ==
FRIBIDI_PAR_RTL) ||
(c->ln->items->source_node->bidi_props.direction ==
FRIBIDI_PAR_WRTL)))
EVAS_BIDI_PARAGRAPH_DIRECTION_IS_RTL(
c->ln->items->source_node->bidi_props.direction))
{
/* Align right*/
return 1.0;
@ -5231,7 +5229,7 @@ _evas_textblock_node_text_new(void)
n = calloc(1, sizeof(Evas_Object_Textblock_Node_Text));
n->unicode = eina_ustrbuf_new();
#ifdef BIDI_SUPPORT
n->bidi_props.direction = FRIBIDI_PAR_ON;
n->bidi_props.direction = EVAS_BIDI_PARAGRAPH_NATURAL;
#endif
return n;
@ -5475,7 +5473,7 @@ evas_textblock_cursor_text_append(Evas_Textblock_Cursor *cur, const char *_text)
fnode->offset += len;
#ifdef BIDI_SUPPORT
/* Reset paragraph direction */
n->bidi_props.direction = FRIBIDI_PAR_ON;
n->bidi_props.direction = EVAS_BIDI_PARAGRAPH_NATURAL;
evas_bidi_update_props(eina_ustrbuf_string_get(n->unicode), &n->bidi_props);
#endif
_evas_textblock_changed(o, cur->obj);

View File

@ -25,6 +25,7 @@
# define BIDI_SUPPORT
#endif
#include <Eina.h>
#include "evas_common.h"
#ifdef USE_FRIBIDI
@ -79,6 +80,17 @@ struct _Evas_BiDi_Props {
#ifdef USE_FRIBIDI
#define EVAS_BIDI_PARAGRAPH_NATURAL FRIBIDI_PAR_ON
#define EVAS_BIDI_PARAGRAPH_LTR FRIBIDI_PAR_LTR
#define EVAS_BIDI_PARAGRAPH_RTL FRIBIDI_PAR_RTL
#define EVAS_BIDI_PARAGRAPH_WLTR FRIBIDI_PAR_WLTR
#define EVAS_BIDI_PARAGRAPH_WRTL FRIBIDI_PAR_WRTL
#define EVAS_BIDI_PARAGRAPH_DIRECTION_IS_RTL(direction) \
(((direction == EVAS_BIDI_PARAGRAPH_RTL) || \
(direction == EVAS_BIDI_PARAGRAPH_WRTL)) ? \
EINA_TRUE : EINA_FALSE)
# define EVAS_BIDI_IS_BIDI_PROP(intl_props) ((intl_props) && (intl_props)->char_types)
# define evas_bidi_position_visual_to_logical(list, position) \