forked from enlightenment/efl
next.prev char works.. a lot works. now i have to test text insertion at any
point, text deletion at any point... most querying seems good. also text format insertion at any pont... but need to do format deletion and format querying stuff... but then its back to the todo list (this wraps up current incomplete api)... SVN revision: 13279
This commit is contained in:
parent
897e45fbbc
commit
faf319ed5e
|
@ -1051,7 +1051,10 @@ evas_object_textblock_clear(Evas_Object *obj)
|
|||
evas_object_textblock_layout_clean(obj);
|
||||
o->len = 0;
|
||||
o->pos = 0;
|
||||
o->lines = 0;
|
||||
o->changed = 1;
|
||||
o->native.dirty = 1;
|
||||
o->format.dirty = 1;
|
||||
evas_object_change(obj);
|
||||
}
|
||||
|
||||
|
@ -1076,6 +1079,8 @@ void
|
|||
evas_object_textblock_cursor_pos_next(Evas_Object *obj)
|
||||
{
|
||||
Evas_Object_Textblock *o;
|
||||
Node *node;
|
||||
int ps = 0;
|
||||
|
||||
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||
return;
|
||||
|
@ -1084,13 +1089,31 @@ evas_object_textblock_cursor_pos_next(Evas_Object *obj)
|
|||
MAGIC_CHECK(o, Evas_Object_Textblock, MAGIC_OBJ_TEXTBLOCK);
|
||||
return;
|
||||
MAGIC_CHECK_END();
|
||||
/* FIXME: DO */
|
||||
node = evas_object_textblock_node_pos_get(obj, o->pos, &ps);
|
||||
if (node)
|
||||
{
|
||||
int chr;
|
||||
int npos;
|
||||
|
||||
npos = o->pos - ps;
|
||||
chr = evas_common_font_utf8_get_next(node->text, &npos);
|
||||
if ((!chr) || (npos >= node->text_len))
|
||||
{
|
||||
npos = ps + node->text_len;
|
||||
if (node)
|
||||
o->pos = npos;
|
||||
}
|
||||
else
|
||||
o->pos = npos + ps;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
evas_object_textblock_cursor_pos_prev(Evas_Object *obj)
|
||||
{
|
||||
Evas_Object_Textblock *o;
|
||||
Node *node;
|
||||
int ps = 0;
|
||||
|
||||
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||
return;
|
||||
|
@ -1099,7 +1122,47 @@ evas_object_textblock_cursor_pos_prev(Evas_Object *obj)
|
|||
MAGIC_CHECK(o, Evas_Object_Textblock, MAGIC_OBJ_TEXTBLOCK);
|
||||
return;
|
||||
MAGIC_CHECK_END();
|
||||
/* FIXME: DO */
|
||||
if (o->pos == o->len)
|
||||
{
|
||||
if (o->nodes)
|
||||
{
|
||||
node = (Node *)(((Evas_Object_List *)o->nodes)->last);
|
||||
while ((node) && (!node->text))
|
||||
node = (Node *)(((Evas_Object_List *)node)->prev);
|
||||
if (node)
|
||||
{
|
||||
int npos;
|
||||
|
||||
npos = evas_common_font_utf8_get_last(node->text, node->text_len);
|
||||
o->pos = o->pos - node->text_len + npos;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
node = evas_object_textblock_node_pos_get(obj, o->pos, &ps);
|
||||
if (node)
|
||||
{
|
||||
int chr;
|
||||
int npos;
|
||||
|
||||
npos = o->pos - ps;
|
||||
if (o->pos > ps)
|
||||
{
|
||||
chr = evas_common_font_utf8_get_prev(node->text, &npos);
|
||||
o->pos = npos + ps;
|
||||
}
|
||||
else
|
||||
{
|
||||
node = (Node *)(((Evas_Object_List *)node)->prev);
|
||||
while ((node) && (!node->text))
|
||||
node = (Node *)(((Evas_Object_List *)node)->prev);
|
||||
if (node)
|
||||
{
|
||||
npos = evas_common_font_utf8_get_last(node->text, node->text_len);
|
||||
o->pos = o->pos - node->text_len + npos;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -1315,6 +1378,8 @@ evas_object_textblock_char_pos_get(Evas_Object *obj, int pos, Evas_Coord *cx, Ev
|
|||
{
|
||||
int ret, x = 0, y = 0, w = 0, h = 0;
|
||||
|
||||
if (lnode->layout.font.font)
|
||||
{
|
||||
ret = ENFN->font_char_coords_get(ENDT, lnode->layout.font.font,
|
||||
lnode->text,
|
||||
pos - lnode->text_pos,
|
||||
|
@ -1328,6 +1393,7 @@ evas_object_textblock_char_pos_get(Evas_Object *obj, int pos, Evas_Coord *cx, Ev
|
|||
if (ch) *ch = h;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
evas_object_textblock_char_coords_get(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch)
|
||||
|
@ -1361,6 +1427,8 @@ evas_object_textblock_char_coords_get(Evas_Object *obj, Evas_Coord x, Evas_Coord
|
|||
{
|
||||
int ret, rx = 0, ry = 0, rw = 0, rh = 0;
|
||||
|
||||
if (lnode->layout.font.font)
|
||||
{
|
||||
ret = ENFN->font_char_at_coords_get(ENDT, lnode->layout.font.font,
|
||||
lnode->text,
|
||||
x - lnode->layout.line.x,
|
||||
|
@ -1398,6 +1466,8 @@ evas_object_textblock_char_coords_get(Evas_Object *obj, Evas_Coord x, Evas_Coord
|
|||
if (ch) *ch = rh;
|
||||
return ret + lnode->text_pos;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
@ -1815,7 +1885,7 @@ evas_object_textblock_format_direction_set(Evas_Object *obj, Evas_Format_Directi
|
|||
return;
|
||||
MAGIC_CHECK_END();
|
||||
if (o->format_dir == dir) return;
|
||||
/* FIXME: DO */
|
||||
/* FIXME: DOES NOTHING YET - FUTURE FEATRUE */
|
||||
o->native.dirty = 1;
|
||||
o->format.dirty = 1;
|
||||
o->changed = 1;
|
||||
|
|
Loading…
Reference in New Issue