} font;
struct {
struct {
- unsigned char r, g, b, a;
+ unsigned char r, g, b, a;
} normal, underline, underline2, underline_dash, outline, shadow, glow, glow2, backing,
- strikethrough;
+ strikethrough;
} color;
struct {
int l, r;
/* private methods for textblock objects */
static void evas_object_textblock_init(Evas_Object *eo_obj);
static void evas_object_textblock_render(Evas_Object *eo_obj,
- Evas_Object_Protected_Data *obj,
- void *type_private_data,
- void *output, void *context, void *surface,
- int x, int y, Eina_Bool do_async);
+ Evas_Object_Protected_Data *obj,
+ void *type_private_data,
+ void *output, void *context, void *surface,
+ int x, int y, Eina_Bool do_async);
static void evas_object_textblock_free(Evas_Object *eo_obj);
static void evas_object_textblock_render_pre(Evas_Object *eo_obj,
- Evas_Object_Protected_Data *obj,
- void *type_private_data);
+ Evas_Object_Protected_Data *obj,
+ void *type_private_data);
static void evas_object_textblock_render_post(Evas_Object *eo_obj,
- Evas_Object_Protected_Data *obj,
- void *type_private_data);
+ Evas_Object_Protected_Data *obj,
+ void *type_private_data);
static Evas_Object_Textblock_Node_Text *_evas_textblock_node_text_new(void);
static unsigned int evas_object_textblock_id_get(Evas_Object *eo_obj);
static void *evas_object_textblock_engine_data_get(Evas_Object *eo_obj);
static int evas_object_textblock_is_opaque(Evas_Object *eo_obj,
- Evas_Object_Protected_Data *obj,
- void *type_private_data);
+ Evas_Object_Protected_Data *obj,
+ void *type_private_data);
static int evas_object_textblock_was_opaque(Evas_Object *eo_obj,
- Evas_Object_Protected_Data *obj,
- void *type_private_data);
+ Evas_Object_Protected_Data *obj,
+ void *type_private_data);
static void evas_object_textblock_coords_recalc(Evas_Object *eo_obj,
- Evas_Object_Protected_Data *obj,
- void *type_private_data);
+ Evas_Object_Protected_Data *obj,
+ void *type_private_data);
static void evas_object_textblock_scale_update(Evas_Object *eo_obj,
- Evas_Object_Protected_Data *obj,
- void *type_private_data);
+ Evas_Object_Protected_Data *obj,
+ void *type_private_data);
static const Evas_Object_Func object_func =
{
if (ts->default_tag) free(ts->default_tag);
while (ts->tags)
{
- Evas_Object_Style_Tag *tag;
+ Evas_Object_Style_Tag *tag;
- tag = (Evas_Object_Style_Tag *)ts->tags;
- ts->tags = (Evas_Object_Style_Tag *)eina_inlist_remove(EINA_INLIST_GET(ts->tags), EINA_INLIST_GET(tag));
- free(tag->tag.tag);
- free(tag->tag.replace);
- free(tag);
+ tag = (Evas_Object_Style_Tag *)ts->tags;
+ ts->tags = (Evas_Object_Style_Tag *)eina_inlist_remove(EINA_INLIST_GET(ts->tags), EINA_INLIST_GET(tag));
+ free(tag->tag.tag);
+ free(tag->tag.replace);
+ free(tag);
}
ts->default_tag = NULL;
ts->tags = NULL;
/* Try the style tags */
EINA_INLIST_FOREACH(ts->tags, tag)
{
- if (tag->tag.tag_len != tag_len) continue;
- if (!strncmp(tag->tag.tag, s, tag_len))
- {
- *replace_len = tag->tag.replace_len;
- return tag->tag.replace;
- }
+ if (tag->tag.tag_len != tag_len) continue;
+ if (!strncmp(tag->tag.tag, s, tag_len))
+ {
+ *replace_len = tag->tag.replace_len;
+ return tag->tag.replace;
+ }
}
/* Try the default tags */
Evas_Textblock_Data *o = eo_data_scope_get(eo_obj, MY_CLASS);
while (o->text_nodes)
{
- Evas_Object_Textblock_Node_Text *n;
+ Evas_Object_Textblock_Node_Text *n;
- n = o->text_nodes;
+ n = o->text_nodes;
o->text_nodes = _NODE_TEXT(eina_inlist_remove(
EINA_INLIST_GET(o->text_nodes), EINA_INLIST_GET(n)));
_evas_textblock_node_text_free(n);
/* Don't do much for the meanwhile. */
static inline void
_layout_paragraph_render(Evas_Textblock_Data *o,
- Evas_Object_Textblock_Paragraph *par)
+ Evas_Object_Textblock_Paragraph *par)
{
if (par->rendered)
return;
{
if (!key_start)
{
- if (!isspace((unsigned char)(*p)))
- {
- key_start = p;
- }
+ if (!isspace((unsigned char)(*p)))
+ key_start = p;
}
else if (!key_stop)
{
- if ((*p == '=') || (isspace((unsigned char)(*p))))
- {
- key_stop = p;
- }
+ if ((*p == '=') || (isspace((unsigned char)(*p))))
+ key_stop = p;
}
else if (!val_start)
{
{
node = _NODE_TEXT(EINA_INLIST_GET(node)->last);
cur->node = node;
- cur->pos = 0;
- evas_textblock_cursor_paragraph_char_last(cur);
+ cur->pos = 0;
+
+ evas_textblock_cursor_paragraph_char_last(cur);
}
else
{
- cur->node = NULL;
- cur->pos = 0;
+ cur->node = NULL;
+ cur->pos = 0;
+
}
}
{
size_t ind;
- cur->node = it->text_node;
- cur->pos = it->text_pos;
+ cur->node = it->text_node;
+ cur->pos = it->text_pos;
if (it->type == EVAS_TEXTBLOCK_ITEM_TEXT)
{
ind = _ITEM_TEXT(it)->text_props.text_len - 1;
if ((!cur1->node) || (!cur2->node)) return 0;
if (cur1->node == cur2->node)
{
- if (cur1->pos < cur2->pos) return -1; /* cur1 < cur2 */
- else if (cur1->pos > cur2->pos) return 1; /* cur2 < cur1 */
- return 0;
+ if (cur1->pos < cur2->pos) return -1; /* cur1 < cur2 */
+ else if (cur1->pos > cur2->pos) return 1; /* cur2 < cur1 */
+ return 0;
}
for (l1 = EINA_INLIST_GET(cur1->node),
l2 = EINA_INLIST_GET(cur1->node); (l1) || (l2);)
{
- if (l1 == EINA_INLIST_GET(cur2->node)) return 1; /* cur2 < cur 1 */
- else if (l2 == EINA_INLIST_GET(cur2->node)) return -1; /* cur1 < cur 2 */
- else if (!l1) return -1; /* cur1 < cur 2 */
- else if (!l2) return 1; /* cur2 < cur 1 */
- l1 = l1->prev;
- l2 = l2->next;
+ if (l1 == EINA_INLIST_GET(cur2->node)) return 1; /* cur2 < cur 1 */
+ else if (l2 == EINA_INLIST_GET(cur2->node)) return -1; /* cur1 < cur 2 */
+ else if (!l1) return -1; /* cur1 < cur 2 */
+ else if (!l2) return 1; /* cur2 < cur 1 */
+ l1 = l1->prev;
+ l2 = l2->next;
}
return 0;
}
o->content_changed = 1;
if (o->markup_text)
{
- free(o->markup_text);
- o->markup_text = NULL;
+ free(o->markup_text);
+ o->markup_text = NULL;
}
evas_object_change(eo_obj, obj);
format = n->format;
if (!cur->node)
{
- o->format_nodes = _NODE_FORMAT(eina_inlist_append(
+ o->format_nodes = _NODE_FORMAT(eina_inlist_append(
EINA_INLIST_GET(o->format_nodes),
EINA_INLIST_GET(n)));
- cur->pos = 0;
+ cur->pos = 0;
n->text_node = (EINA_INLIST_GET(n)->prev) ?
_NODE_FORMAT(EINA_INLIST_GET(n)->prev)->text_node :
o->text_nodes;
- cur->node = n->text_node;
+ cur->node = n->text_node;
}
else
{
if (cur->pos == eina_ustrbuf_length_get(n->unicode))
{
- n2 = _NODE_TEXT(EINA_INLIST_GET(n)->next);
- if (n2)
- {
- cur->node = n2;
- cur->pos = 0;
- }
+ n2 = _NODE_TEXT(EINA_INLIST_GET(n)->next);
+ if (n2)
+ {
+ cur->node = n2;
+ cur->pos = 0;
+ }
}
_evas_textblock_cursors_update_offset(cur, n, ppos, -(ind - ppos));
Evas_Textblock_Data *o = eo_data_scope_get(cur1->obj, MY_CLASS);
if (evas_textblock_cursor_compare(cur1, cur2) > 0)
{
- Evas_Textblock_Cursor *tc;
+ Evas_Textblock_Cursor *tc;
- tc = cur1;
- cur1 = cur2;
- cur2 = tc;
+ tc = cur1;
+ cur1 = cur2;
+ cur2 = tc;
}
n1 = cur1->node;
n2 = cur2->node;
if (evas_textblock_cursor_compare(cur1, _cur2) > 0)
{
- const Evas_Textblock_Cursor *tc;
+ const Evas_Textblock_Cursor *tc;
- tc = cur1;
- cur1 = _cur2;
- _cur2 = tc;
+ tc = cur1;
+ cur1 = _cur2;
+ _cur2 = tc;
}
/* Work on a local copy of the cur */
cur2 = alloca(sizeof(Evas_Textblock_Cursor));
if (evas_textblock_cursor_compare(cur1, _cur2) > 0)
{
- const Evas_Textblock_Cursor *tc;
+ const Evas_Textblock_Cursor *tc;
- tc = cur1;
- cur1 = _cur2;
- _cur2 = tc;
+ tc = cur1;
+ cur1 = _cur2;
+ _cur2 = tc;
}
n1 = cur1->node;
n2 = _cur2->node;
{
x = ln->x;
}
- y = ln->par->y + ln->y;
- h = ln->h;
+ y = ln->par->y + ln->y;
+ h = ln->h;
}
else if (ln && fi)
{
}
else
{
- return -1;
+ return -1;
}
if (cx) *cx = x;
if (cy) *cy = y;
if (evas_textblock_cursor_compare(cur1, cur2) > 0)
{
- const Evas_Textblock_Cursor *tc;
+ const Evas_Textblock_Cursor *tc;
- tc = cur1;
- cur1 = cur2;
- cur2 = tc;
+ tc = cur1;
+ cur1 = cur2;
+ cur2 = tc;
}
ln1 = ln2 = NULL;
}
while (lni && (lni != ln2))
{
- tr = calloc(1, sizeof(Evas_Textblock_Rectangle));
- rects = eina_list_append(rects, tr);
- tr->x = lni->x;
- tr->y = lni->par->y + lni->y;
- tr->h = lni->h;
- tr->w = lni->w;
+ tr = calloc(1, sizeof(Evas_Textblock_Rectangle));
+ rects = eina_list_append(rects, tr);
+ tr->x = lni->x;
+ tr->y = lni->par->y + lni->y;
+ tr->h = lni->h;
+ tr->w = lni->w;
plni = lni;
lni = (Evas_Object_Textblock_Line *) EINA_INLIST_GET(lni)->next;
if (!lni && (plni->par != ln2->par))
evas_object_async_block(obj);
if (o->paragraphs)
{
- _paragraphs_free(eo_obj, o->paragraphs);
- o->paragraphs = NULL;
+ _paragraphs_free(eo_obj, o->paragraphs);
+ o->paragraphs = NULL;
}
_nodes_clear(eo_obj);
o->cursor->pos = 0;
EINA_LIST_FOREACH(o->cursors, l, cur)
{
- cur->node = NULL;
- cur->pos = 0;
+ cur->node = NULL;
+ cur->pos = 0;
+
}
_evas_textblock_changed(o, eo_obj);
o->native.w = wmax;
o->native.h = hmax;
- o->native.valid = 1;
+ o->native.valid = 1;
o->content_changed = 0;
o->format_changed = EINA_FALSE;
}
free(o->cursor);
while (o->cursors)
{
- Evas_Textblock_Cursor *cur;
+ Evas_Textblock_Cursor *cur;
- cur = (Evas_Textblock_Cursor *)o->cursors->data;
- o->cursors = eina_list_remove_list(o->cursors, o->cursors);
- free(cur);
+ cur = (Evas_Textblock_Cursor *)o->cursors->data;
+ o->cursors = eina_list_remove_list(o->cursors, o->cursors);
+ free(cur);
}
if (o->repch) eina_stringshare_del(o->repch);
if (o->ellip_ti) _item_free(eo_obj, NULL, _ITEM(o->ellip_ti));
static void
evas_object_textblock_render(Evas_Object *eo_obj EINA_UNUSED,
- Evas_Object_Protected_Data *obj,
- void *type_private_data,
- void *output, void *context, void *surface,
- int x, int y, Eina_Bool do_async)
+ Evas_Object_Protected_Data *obj,
+ void *type_private_data,
+ void *output, void *context, void *surface,
+ int x, int y, Eina_Bool do_async)
{
Evas_Object_Textblock_Paragraph *par, *start = NULL;
Evas_Object_Textblock_Item *itr;
int na, nr, ng, nb;
const char vals[5][5] =
{
- {0, 1, 2, 1, 0},
- {1, 3, 4, 3, 1},
- {2, 4, 5, 4, 2},
- {1, 3, 4, 3, 1},
- {0, 1, 2, 1, 0}
+ {0, 1, 2, 1, 0},
+ {1, 3, 4, 3, 1},
+ {2, 4, 5, 4, 2},
+ {1, 3, 4, 3, 1},
+ {0, 1, 2, 1, 0}
};
/* [FIXME!!!] rare case when relayout was not called: cache.clip made
static void
evas_object_textblock_render_pre(Evas_Object *eo_obj,
- Evas_Object_Protected_Data *obj,
- void *type_private_data)
+ Evas_Object_Protected_Data *obj,
+ void *type_private_data)
{
Evas_Textblock_Data *o = type_private_data;
int is_v, was_v;