} formatted, native;
unsigned char redraw : 1;
unsigned char changed : 1;
+ unsigned char content_changed : 1;
};
/* private methods for textblock objects */
static void _evas_textblock_node_format_free(Evas_Object_Textblock_Node_Format *n);
static void _evas_textblock_node_text_free(Evas_Object_Textblock_Node_Text *n);
static void _evas_textblock_changed(Evas_Object_Textblock *o, Evas_Object *obj);
+static void _evas_textblock_text_node_changed(Evas_Object_Textblock *o, Evas_Object *obj, Evas_Object_Textblock_Node_Text *n);
static void _evas_textblock_cursors_update_offset(const Evas_Textblock_Cursor *cur, const Evas_Object_Textblock_Node_Text *n, size_t start, int offset);
static void _evas_textblock_cursors_set_node(Evas_Object_Textblock *o, const Evas_Object_Textblock_Node_Text *n, Evas_Object_Textblock_Node_Text *new_node);
if (paragraphs) _paragraphs_clear(obj, paragraphs);
o->last_w = obj->cur.geometry.w;
o->changed = 0;
+ o->content_changed = 0;
o->redraw = 1;
}
o->style = NULL;
}
- _evas_textblock_changed(o, obj);
+ _evas_textblock_text_node_changed(o, obj, NULL);
}
/**
if (o->repch) eina_stringshare_del(o->repch);
if (ch) o->repch = eina_stringshare_add(ch);
else o->repch = NULL;
- _evas_textblock_changed(o, obj);
+ _evas_textblock_text_node_changed(o, obj, NULL);
}
/**
p++;
}
}
- _evas_textblock_changed(o, obj);
+ _evas_textblock_text_node_changed(o, obj, o->cursor->node);
}
o->formatted.valid = 0;
o->native.valid = 0;
o->changed = 1;
- if (o->markup_text)
- {
- free(o->markup_text);
- o->markup_text = NULL;
- }
evas_object_change(obj);
}
*
* @param o the textblock object.
* @param obj the evas object.
- * @param n the paragraph that changed.
+ * @param n the paragraph that changed - NULL means all.
*/
static void
-_evas_textblock_content_changed(Evas_Object_Textblock *o, Evas_Object *obj,
+_evas_textblock_text_node_changed(Evas_Object_Textblock *o, Evas_Object *obj,
Evas_Object_Textblock_Node_Text *n)
{
- n->dirty = EINA_TRUE;
- _evas_textblock_changed(o, obj);
+ if (!n)
+ {
+ Evas_Object_Textblock_Node_Text *itr;
+ EINA_INLIST_FOREACH(EINA_INLIST_GET(o->text_nodes), itr)
+ {
+ itr->dirty = EINA_TRUE;
+ }
+ }
+ else
+ {
+ n->dirty = EINA_TRUE;
+ }
+ o->formatted.valid = 0;
+ o->native.valid = 0;
+ o->content_changed = 1;
+ if (o->markup_text)
+ {
+ free(o->markup_text);
+ o->markup_text = NULL;
+ }
+
+ evas_object_change(obj);
}
/**
evas_bidi_paragraph_props_unref(n->bidi_props);
n->bidi_props = evas_bidi_paragraph_props_get(eina_ustrbuf_string_get(n->unicode));
#endif
- _evas_textblock_changed(o, cur->obj);
+ _evas_textblock_text_node_changed(o, cur->obj, n);
free(text);
return len;
}
}
}
- _evas_textblock_changed(o, cur->obj);
+ _evas_textblock_text_node_changed(o, cur->obj, cur->node);
return is_visible;
}
}
_evas_textblock_cursors_update_offset(cur, n, ppos, -(index - ppos));
- _evas_textblock_changed(o, cur->obj);
+ _evas_textblock_text_node_changed(o, cur->obj, cur->node);
}
/**
if (reset_cursor)
evas_textblock_cursor_copy(cur1, o->cursor);
- _evas_textblock_changed(o, cur1->obj);
+ _evas_textblock_text_node_changed(o, cur1->obj, cur1->node);
}
_paragraphs_clear(obj, o->paragraphs);
o->paragraphs = NULL;
}
- _evas_textblock_changed(o, obj);
+ _evas_textblock_text_node_changed(o, cur->obj, cur->node);
}
/**
/* then when this is done the object needs to figure if it changed and */
/* if so what and where and add the appropriate redraw textblocks */
o = (Evas_Object_Textblock *)(obj->object_data);
- if ((o->changed) ||
+ if ((o->changed) || (o->content_changed) ||
(o->last_w != obj->cur.geometry.w))
{
Evas_Object_Textblock_Paragraph *paragraphs;
o->redraw = 0;
evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, obj);
o->changed = 0;
+ o->content_changed = 0;
is_v = evas_object_is_visible(obj);
was_v = evas_object_was_visible(obj);
goto done;
evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, obj);
goto done;
}
- if (o->changed)
+ if (o->changed || o->content_changed)
{
evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, obj);
o->changed = 0;
+ o->content_changed = 0;
}
done:
evas_object_render_pre_effect_updates(&obj->layer->evas->clip_changes, obj, is_v, was_v);