summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2010-08-15 14:36:20 +0000
committerTom Hacohen <tom@stosb.com>2010-08-15 14:36:20 +0000
commit660a7b8ee4e4137d60893457fd34cbf7825d8d9b (patch)
treee168fdf5774cc816d8077ec75039546f35c6d32b
parentb2b95df2bee67dc57892d291a147f47ac82b731a (diff)
Evas bidi: Added defines for bidi paragraph types (instead of using the fribidi defines).
SVN revision: 51131
-rw-r--r--legacy/evas/src/lib/canvas/evas_object_text.c2
-rw-r--r--legacy/evas/src/lib/canvas/evas_object_textblock.c10
-rw-r--r--legacy/evas/src/lib/engines/common/evas_bidi_utils.h12
3 files changed, 17 insertions, 7 deletions
diff --git a/legacy/evas/src/lib/canvas/evas_object_text.c b/legacy/evas/src/lib/canvas/evas_object_text.c
index b94624bdea..a47b3ab2e2 100644
--- a/legacy/evas/src/lib/canvas/evas_object_text.c
+++ b/legacy/evas/src/lib/canvas/evas_object_text.c
@@ -1457,7 +1457,7 @@ evas_object_text_new(void)
1457 o->prev = o->cur; 1457 o->prev = o->cur;
1458 o->cur.intl_props.props = &o->cur.paragraph_bidi_props; 1458 o->cur.intl_props.props = &o->cur.paragraph_bidi_props;
1459#ifdef BIDI_SUPPORT 1459#ifdef BIDI_SUPPORT
1460 o->cur.intl_props.props->direction = FRIBIDI_PAR_ON; 1460 o->cur.intl_props.props->direction = EVAS_BIDI_PARAGRAPH_NATURAL;
1461#endif 1461#endif
1462 return o; 1462 return o;
1463} 1463}
diff --git a/legacy/evas/src/lib/canvas/evas_object_textblock.c b/legacy/evas/src/lib/canvas/evas_object_textblock.c
index b2198cb9e8..a7652b71e6 100644
--- a/legacy/evas/src/lib/canvas/evas_object_textblock.c
+++ b/legacy/evas/src/lib/canvas/evas_object_textblock.c
@@ -1860,10 +1860,8 @@ _layout_line_align_get(Ctxt *c)
1860 if (c->align_auto && c->ln && c->ln->items) 1860 if (c->align_auto && c->ln && c->ln->items)
1861 { 1861 {
1862 if (c->ln->items->source_node && 1862 if (c->ln->items->source_node &&
1863 ((c->ln->items->source_node->bidi_props.direction == 1863 EVAS_BIDI_PARAGRAPH_DIRECTION_IS_RTL(
1864 FRIBIDI_PAR_RTL) || 1864 c->ln->items->source_node->bidi_props.direction))
1865 (c->ln->items->source_node->bidi_props.direction ==
1866 FRIBIDI_PAR_WRTL)))
1867 { 1865 {
1868 /* Align right*/ 1866 /* Align right*/
1869 return 1.0; 1867 return 1.0;
@@ -5231,7 +5229,7 @@ _evas_textblock_node_text_new(void)
5231 n = calloc(1, sizeof(Evas_Object_Textblock_Node_Text)); 5229 n = calloc(1, sizeof(Evas_Object_Textblock_Node_Text));
5232 n->unicode = eina_ustrbuf_new(); 5230 n->unicode = eina_ustrbuf_new();
5233#ifdef BIDI_SUPPORT 5231#ifdef BIDI_SUPPORT
5234 n->bidi_props.direction = FRIBIDI_PAR_ON; 5232 n->bidi_props.direction = EVAS_BIDI_PARAGRAPH_NATURAL;
5235#endif 5233#endif
5236 5234
5237 return n; 5235 return n;
@@ -5475,7 +5473,7 @@ evas_textblock_cursor_text_append(Evas_Textblock_Cursor *cur, const char *_text)
5475 fnode->offset += len; 5473 fnode->offset += len;
5476#ifdef BIDI_SUPPORT 5474#ifdef BIDI_SUPPORT
5477 /* Reset paragraph direction */ 5475 /* Reset paragraph direction */
5478 n->bidi_props.direction = FRIBIDI_PAR_ON; 5476 n->bidi_props.direction = EVAS_BIDI_PARAGRAPH_NATURAL;
5479 evas_bidi_update_props(eina_ustrbuf_string_get(n->unicode), &n->bidi_props); 5477 evas_bidi_update_props(eina_ustrbuf_string_get(n->unicode), &n->bidi_props);
5480#endif 5478#endif
5481 _evas_textblock_changed(o, cur->obj); 5479 _evas_textblock_changed(o, cur->obj);
diff --git a/legacy/evas/src/lib/engines/common/evas_bidi_utils.h b/legacy/evas/src/lib/engines/common/evas_bidi_utils.h
index 5c23b87d35..6902cd7dd7 100644
--- a/legacy/evas/src/lib/engines/common/evas_bidi_utils.h
+++ b/legacy/evas/src/lib/engines/common/evas_bidi_utils.h
@@ -25,6 +25,7 @@
25# define BIDI_SUPPORT 25# define BIDI_SUPPORT
26#endif 26#endif
27 27
28#include <Eina.h>
28#include "evas_common.h" 29#include "evas_common.h"
29 30
30#ifdef USE_FRIBIDI 31#ifdef USE_FRIBIDI
@@ -79,6 +80,17 @@ struct _Evas_BiDi_Props {
79 80
80 81
81#ifdef USE_FRIBIDI 82#ifdef USE_FRIBIDI
83#define EVAS_BIDI_PARAGRAPH_NATURAL FRIBIDI_PAR_ON
84#define EVAS_BIDI_PARAGRAPH_LTR FRIBIDI_PAR_LTR
85#define EVAS_BIDI_PARAGRAPH_RTL FRIBIDI_PAR_RTL
86#define EVAS_BIDI_PARAGRAPH_WLTR FRIBIDI_PAR_WLTR
87#define EVAS_BIDI_PARAGRAPH_WRTL FRIBIDI_PAR_WRTL
88
89#define EVAS_BIDI_PARAGRAPH_DIRECTION_IS_RTL(direction) \
90 (((direction == EVAS_BIDI_PARAGRAPH_RTL) || \
91 (direction == EVAS_BIDI_PARAGRAPH_WRTL)) ? \
92 EINA_TRUE : EINA_FALSE)
93
82 94
83# define EVAS_BIDI_IS_BIDI_PROP(intl_props) ((intl_props) && (intl_props)->char_types) 95# define EVAS_BIDI_IS_BIDI_PROP(intl_props) ((intl_props) && (intl_props)->char_types)
84# define evas_bidi_position_visual_to_logical(list, position) \ 96# define evas_bidi_position_visual_to_logical(list, position) \