summaryrefslogtreecommitdiff
path: root/src/lib/evas/common/language
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2013-02-21 13:39:37 +0000
committerTom Hacohen <tom@stosb.com>2013-02-21 13:39:37 +0000
commitd6dababe7815c2abdc62e5cfcb498c9da045dc97 (patch)
tree8dab8aeffac3ba58c44583df706b35f1e6f8f318 /src/lib/evas/common/language
parent8a818ad79d8d728764946f6088beecdb5295366b (diff)
Evas text: Fixed bug with the text object direction detection.
Diffstat (limited to 'src/lib/evas/common/language')
-rw-r--r--src/lib/evas/common/language/evas_bidi_utils.h32
1 files changed, 28 insertions, 4 deletions
diff --git a/src/lib/evas/common/language/evas_bidi_utils.h b/src/lib/evas/common/language/evas_bidi_utils.h
index ff2f41a641..37a4e65964 100644
--- a/src/lib/evas/common/language/evas_bidi_utils.h
+++ b/src/lib/evas/common/language/evas_bidi_utils.h
@@ -90,12 +90,36 @@ struct _Evas_BiDi_Props
90#define EVAS_BIDI_PARAGRAPH_WLTR FRIBIDI_PAR_WLTR 90#define EVAS_BIDI_PARAGRAPH_WLTR FRIBIDI_PAR_WLTR
91#define EVAS_BIDI_PARAGRAPH_WRTL FRIBIDI_PAR_WRTL 91#define EVAS_BIDI_PARAGRAPH_WRTL FRIBIDI_PAR_WRTL
92 92
93#define EVAS_BIDI_PARAGRAPH_DIRECTION_IS_RTL(x) \ 93#define EVAS_BIDI_DIRECTION_IS_RTL(x) \
94 (((x) && \ 94 ((((x) == EVAS_BIDI_PARAGRAPH_RTL) || \
95 ((x->direction == EVAS_BIDI_PARAGRAPH_RTL) || \ 95 ((x) == EVAS_BIDI_PARAGRAPH_WRTL)) ? \
96 (x->direction == EVAS_BIDI_PARAGRAPH_WRTL))) ? \
97 EINA_TRUE : EINA_FALSE) 96 EINA_TRUE : EINA_FALSE)
98 97
98#define EVAS_BIDI_PARAGRAPH_DIRECTION_IS_RTL(x) \
99 ((x) && EVAS_BIDI_DIRECTION_IS_RTL((x)->direction))
100
101#define EVAS_BIDI_PAR_TYPE_TO_DIRECTION(x) \
102 _evas_bidi_par_type_to_direction(x)
103
104static inline Evas_BiDi_Direction
105_evas_bidi_par_type_to_direction(EvasBiDiParType par_type)
106{
107 switch (par_type)
108 {
109 case EVAS_BIDI_PARAGRAPH_LTR:
110 case EVAS_BIDI_PARAGRAPH_WLTR:
111 return EVAS_BIDI_DIRECTION_LTR;
112 break;
113 case EVAS_BIDI_PARAGRAPH_RTL:
114 case EVAS_BIDI_PARAGRAPH_WRTL:
115 return EVAS_BIDI_DIRECTION_RTL;
116 break;
117 case EVAS_BIDI_PARAGRAPH_NEUTRAL:
118 default:
119 return EVAS_BIDI_DIRECTION_NEUTRAL;
120 break;
121 }
122}
99 123
100# define evas_bidi_position_visual_to_logical(list, position) \ 124# define evas_bidi_position_visual_to_logical(list, position) \
101 (list) ? list[position] : position; 125 (list) ? list[position] : position;