summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2010-08-15 16:04:34 +0000
committerTom Hacohen <tom@stosb.com>2010-08-15 16:04:34 +0000
commit25d756472643474ea7fbf0d17ae849c82f1b61ee (patch)
tree9c68dcc8661f610281390d3ec4bb6aa2f4242841 /legacy
parent660a7b8ee4e4137d60893457fd34cbf7825d8d9b (diff)
Evas textblock: Fixed the bug with going up/down lines when the cursor points to an <item>.
With this fix I also fixed a couple of potential bugs with cursor geometry in places with mixed visible+invisible formatting. SVN revision: 51133
Diffstat (limited to 'legacy')
-rw-r--r--legacy/evas/src/lib/canvas/evas_object_textblock.c24
-rw-r--r--legacy/evas/src/lib/engines/common/evas_bidi_utils.h2
2 files changed, 18 insertions, 8 deletions
diff --git a/legacy/evas/src/lib/canvas/evas_object_textblock.c b/legacy/evas/src/lib/canvas/evas_object_textblock.c
index a7652b71e6..91517bf126 100644
--- a/legacy/evas/src/lib/canvas/evas_object_textblock.c
+++ b/legacy/evas/src/lib/canvas/evas_object_textblock.c
@@ -4681,7 +4681,7 @@ evas_textblock_cursor_line_char_first(Evas_Textblock_Cursor *cur)
4681 { 4681 {
4682 _find_layout_format_item_line_match(cur->obj, 4682 _find_layout_format_item_line_match(cur->obj,
4683 _evas_textblock_node_visible_at_pos_get( 4683 _evas_textblock_node_visible_at_pos_get(
4684 _evas_textblock_cursor_node_format_before_or_at_pos_get(cur)), 4684 _evas_textblock_cursor_node_format_at_pos_get(cur)),
4685 &ln, &fi); 4685 &ln, &fi);
4686 } 4686 }
4687 else 4687 else
@@ -4734,7 +4734,7 @@ evas_textblock_cursor_line_char_last(Evas_Textblock_Cursor *cur)
4734 { 4734 {
4735 _find_layout_format_item_line_match(cur->obj, 4735 _find_layout_format_item_line_match(cur->obj,
4736 _evas_textblock_node_visible_at_pos_get( 4736 _evas_textblock_node_visible_at_pos_get(
4737 _evas_textblock_cursor_node_format_before_or_at_pos_get(cur)), 4737 _evas_textblock_cursor_node_format_at_pos_get(cur)),
4738 &ln, &fi); 4738 &ln, &fi);
4739 } 4739 }
4740 else 4740 else
@@ -4786,9 +4786,11 @@ _evas_textblock_format_is_visible(const char *s)
4786{ 4786{
4787 if (!s) return EINA_FALSE; 4787 if (!s) return EINA_FALSE;
4788 const char *item; 4788 const char *item;
4789 Eina_Bool is_opener = EINA_TRUE;
4789 4790
4790 if (s[0] == '+' || s[0] == '-') 4791 if (s[0] == '+' || s[0] == '-')
4791 { 4792 {
4793 is_opener = (s[0] == '+') ? EINA_TRUE : EINA_FALSE;
4792 s++; 4794 s++;
4793 } 4795 }
4794 while ((item = _format_parse(&s))) 4796 while ((item = _format_parse(&s)))
@@ -4797,10 +4799,13 @@ _evas_textblock_format_is_visible(const char *s)
4797 tmp = alloca(s - item + 1); 4799 tmp = alloca(s - item + 1);
4798 strncpy(tmp, item, s - item); 4800 strncpy(tmp, item, s - item);
4799 tmp[s - item] = '\0'; 4801 tmp[s - item] = '\0';
4802 /* We care about all of the formats even after a - except for
4803 * item which we don't care after a - because it's just a standard
4804 * closing */
4800 if (((!strcmp(item, "\n")) || (!strcmp(item, "\\n"))) || 4805 if (((!strcmp(item, "\n")) || (!strcmp(item, "\\n"))) ||
4801 ((!strcmp(item, "\t")) || (!strcmp(item, "\\t"))) || 4806 ((!strcmp(item, "\t")) || (!strcmp(item, "\\t"))) ||
4802 (!strcmp(item, "ps")) || 4807 (!strcmp(item, "ps")) ||
4803 (!strcmp(item, "item"))) 4808 (!strncmp(item, "item", 4) && is_opener)) /*FIXME: formats like item2 will break it. */
4804 return EINA_TRUE; 4809 return EINA_TRUE;
4805 } 4810 }
4806 return EINA_FALSE; 4811 return EINA_FALSE;
@@ -6109,8 +6114,9 @@ evas_textblock_cursor_char_geometry_get(const Evas_Textblock_Cursor *cur, Evas_C
6109 if (!o->formatted.valid) _relayout(cur->obj); 6114 if (!o->formatted.valid) _relayout(cur->obj);
6110 if (evas_textblock_cursor_format_is_visible_get(cur)) 6115 if (evas_textblock_cursor_format_is_visible_get(cur))
6111 { 6116 {
6112 _find_layout_format_item_line_match(cur->obj, 6117 _find_layout_format_item_line_match(cur->obj,
6113 _evas_textblock_cursor_node_format_at_pos_get(cur), 6118 _evas_textblock_node_visible_at_pos_get(
6119 _evas_textblock_cursor_node_format_at_pos_get(cur)),
6114 &ln, &fi); 6120 &ln, &fi);
6115 } 6121 }
6116 else 6122 else
@@ -6202,7 +6208,7 @@ evas_textblock_cursor_line_geometry_get(const Evas_Textblock_Cursor *cur, Evas_C
6202 { 6208 {
6203 _find_layout_format_item_line_match(cur->obj, 6209 _find_layout_format_item_line_match(cur->obj,
6204 _evas_textblock_node_visible_at_pos_get( 6210 _evas_textblock_node_visible_at_pos_get(
6205 _evas_textblock_cursor_node_format_before_or_at_pos_get(cur)), 6211 _evas_textblock_cursor_node_format_at_pos_get(cur)),
6206 &ln, &fi); 6212 &ln, &fi);
6207 } 6213 }
6208 else 6214 else
@@ -6446,11 +6452,13 @@ evas_textblock_cursor_format_item_geometry_get(const Evas_Textblock_Cursor *cur,
6446 Evas_Object_Textblock_Format_Item *fi = NULL; 6452 Evas_Object_Textblock_Format_Item *fi = NULL;
6447 Evas_Coord x, y, w, h; 6453 Evas_Coord x, y, w, h;
6448 6454
6449 if (!cur) return 0; 6455 if (!cur || !evas_textblock_cursor_format_is_visible_get(cur)) return 0;
6450 o = (Evas_Object_Textblock *)(cur->obj->object_data); 6456 o = (Evas_Object_Textblock *)(cur->obj->object_data);
6451 if (!o->formatted.valid) _relayout(cur->obj); 6457 if (!o->formatted.valid) _relayout(cur->obj);
6452 _find_layout_format_item_line_match(cur->obj, 6458 _find_layout_format_item_line_match(cur->obj,
6453 _evas_textblock_cursor_node_format_before_or_at_pos_get(cur), &ln, &fi); 6459 _evas_textblock_node_visible_at_pos_get(
6460 _evas_textblock_cursor_node_format_at_pos_get(cur)),
6461 &ln, &fi);
6454 if ((!ln) || (!fi)) return 0; 6462 if ((!ln) || (!fi)) return 0;
6455 x = ln->x + fi->x; 6463 x = ln->x + fi->x;
6456 y = ln->y + ln->baseline + fi->y; 6464 y = ln->y + ln->baseline + fi->y;
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 6902cd7dd7..0d516754a0 100644
--- a/legacy/evas/src/lib/engines/common/evas_bidi_utils.h
+++ b/legacy/evas/src/lib/engines/common/evas_bidi_utils.h
@@ -80,6 +80,8 @@ struct _Evas_BiDi_Props {
80 80
81 81
82#ifdef USE_FRIBIDI 82#ifdef USE_FRIBIDI
83
84
83#define EVAS_BIDI_PARAGRAPH_NATURAL FRIBIDI_PAR_ON 85#define EVAS_BIDI_PARAGRAPH_NATURAL FRIBIDI_PAR_ON
84#define EVAS_BIDI_PARAGRAPH_LTR FRIBIDI_PAR_LTR 86#define EVAS_BIDI_PARAGRAPH_LTR FRIBIDI_PAR_LTR
85#define EVAS_BIDI_PARAGRAPH_RTL FRIBIDI_PAR_RTL 87#define EVAS_BIDI_PARAGRAPH_RTL FRIBIDI_PAR_RTL