if (!rp || !rp->entry_data) return;
en = rp->entry_data;
- if (!en->imf_context) return;
+ if (!en || !en->imf_context) return;
ecore_imf_context_reset(en->imf_context);
ecore_imf_context_cursor_position_set(en->imf_context, evas_textblock_cursor_pos_get(en->cursor));
en->have_selection = EINA_FALSE;
if (en->selection)
{
- free(en->selection);
- en->selection = NULL;
+ free(en->selection);
+ en->selection = NULL;
}
}
en->have_selection = EINA_TRUE;
if (en->selection)
{
- free(en->selection);
- en->selection = NULL;
+ free(en->selection);
+ en->selection = NULL;
}
_edje_emit(en->rp->edje, "selection,start", en->rp->part->name);
}
evas_textblock_cursor_copy(c, en->sel_end);
if (en->selection)
{
- free(en->selection);
- en->selection = NULL;
+ free(en->selection);
+ en->selection = NULL;
}
_edje_emit(en->rp->edje, "selection,changed", en->rp->part->name);
}
evas_textblock_cursor_copy(c, en->sel_start);
if (en->selection)
{
- free(en->selection);
- en->selection = NULL;
+ free(en->selection);
+ en->selection = NULL;
}
_edje_emit(en->rp->edje, "selection,changed", en->rp->part->name);
}
en->had_sel = EINA_FALSE;
if (en->sel_start)
{
- evas_textblock_cursor_free(en->sel_start);
- evas_textblock_cursor_free(en->sel_end);
- en->sel_start = NULL;
- en->sel_end = NULL;
+ evas_textblock_cursor_free(en->sel_start);
+ evas_textblock_cursor_free(en->sel_end);
+ en->sel_start = NULL;
+ en->sel_end = NULL;
}
if (en->selection)
{
- free(en->selection);
- en->selection = NULL;
+ free(en->selection);
+ en->selection = NULL;
}
while (en->sel)
{
- Sel *sel;
-
- sel = en->sel->data;
- en->rp->edje->subobjs = eina_list_remove(en->rp->edje->subobjs, sel->obj_bg);
- en->rp->edje->subobjs = eina_list_remove(en->rp->edje->subobjs, sel->obj_fg);
- if (sel->obj_bg) evas_object_del(sel->obj_bg);
- if (sel->obj_fg) evas_object_del(sel->obj_fg);
- free(sel);
- en->sel = eina_list_remove_list(en->sel, en->sel);
+ Sel *sel;
+
+ sel = en->sel->data;
+ en->rp->edje->subobjs = eina_list_remove(en->rp->edje->subobjs, sel->obj_bg);
+ en->rp->edje->subobjs = eina_list_remove(en->rp->edje->subobjs, sel->obj_fg);
+ if (sel->obj_bg) evas_object_del(sel->obj_bg);
+ if (sel->obj_fg) evas_object_del(sel->obj_fg);
+ free(sel);
+ en->sel = eina_list_remove_list(en->sel, en->sel);
}
if (en->have_selection)
{
en->have_selection = EINA_FALSE;
- _edje_emit(en->rp->edje, "selection,cleared", en->rp->part->name);
+ _edje_emit(en->rp->edje, "selection,cleared", en->rp->part->name);
}
}
Sel *sel;
Evas_Coord x, y, w, h;
Evas_Object *smart, *clip;
-
+
smart = evas_object_smart_parent_get(o);
clip = evas_object_clip_get(o);
if (en->sel_start)
- range = evas_textblock_cursor_range_geometry_get(en->sel_start, en->sel_end);
+ range = evas_textblock_cursor_range_geometry_get(en->sel_start, en->sel_end);
else
- return;
+ return;
if (eina_list_count(range) != eina_list_count(en->sel))
{
- while (en->sel)
- {
- sel = en->sel->data;
- en->rp->edje->subobjs = eina_list_remove(en->rp->edje->subobjs, sel->obj_bg);
- en->rp->edje->subobjs = eina_list_remove(en->rp->edje->subobjs, sel->obj_fg);
- if (sel->obj_bg) evas_object_del(sel->obj_bg);
- if (sel->obj_fg) evas_object_del(sel->obj_fg);
- free(sel);
- en->sel = eina_list_remove_list(en->sel, en->sel);
- }
- if (en->have_selection)
- {
- for (l = range; l; l = eina_list_next(l))
- {
- Evas_Object *ob;
-
- sel = calloc(1, sizeof(Sel));
- en->sel = eina_list_append(en->sel, sel);
- ob = edje_object_add(en->rp->edje->evas);
- edje_object_file_set(ob, en->rp->edje->path, en->rp->part->source);
- evas_object_smart_member_add(ob, smart);
- evas_object_stack_below(ob, o);
- evas_object_clip_set(ob, clip);
- evas_object_pass_events_set(ob, 1);
- evas_object_show(ob);
- sel->obj_bg = ob;
- en->rp->edje->subobjs = eina_list_append(en->rp->edje->subobjs, sel->obj_bg);
-
- ob = edje_object_add(en->rp->edje->evas);
- edje_object_file_set(ob, en->rp->edje->path, en->rp->part->source2);
- evas_object_smart_member_add(ob, smart);
- evas_object_stack_above(ob, o);
- evas_object_clip_set(ob, clip);
- evas_object_pass_events_set(ob, 1);
- evas_object_show(ob);
- sel->obj_fg = ob;
- en->rp->edje->subobjs = eina_list_append(en->rp->edje->subobjs, sel->obj_fg);
- }
- }
+ while (en->sel)
+ {
+ sel = en->sel->data;
+ en->rp->edje->subobjs = eina_list_remove(en->rp->edje->subobjs, sel->obj_bg);
+ en->rp->edje->subobjs = eina_list_remove(en->rp->edje->subobjs, sel->obj_fg);
+ if (sel->obj_bg) evas_object_del(sel->obj_bg);
+ if (sel->obj_fg) evas_object_del(sel->obj_fg);
+ free(sel);
+ en->sel = eina_list_remove_list(en->sel, en->sel);
+ }
+ if (en->have_selection)
+ {
+ for (l = range; l; l = eina_list_next(l))
+ {
+ Evas_Object *ob;
+
+ sel = calloc(1, sizeof(Sel));
+ en->sel = eina_list_append(en->sel, sel);
+ ob = edje_object_add(en->rp->edje->evas);
+ edje_object_file_set(ob, en->rp->edje->path, en->rp->part->source);
+ evas_object_smart_member_add(ob, smart);
+ evas_object_stack_below(ob, o);
+ evas_object_clip_set(ob, clip);
+ evas_object_pass_events_set(ob, EINA_TRUE);
+ evas_object_show(ob);
+ sel->obj_bg = ob;
+ en->rp->edje->subobjs = eina_list_append(en->rp->edje->subobjs, sel->obj_bg);
+
+ ob = edje_object_add(en->rp->edje->evas);
+ edje_object_file_set(ob, en->rp->edje->path, en->rp->part->source2);
+ evas_object_smart_member_add(ob, smart);
+ evas_object_stack_above(ob, o);
+ evas_object_clip_set(ob, clip);
+ evas_object_pass_events_set(ob, EINA_TRUE);
+ evas_object_show(ob);
+ sel->obj_fg = ob;
+ en->rp->edje->subobjs = eina_list_append(en->rp->edje->subobjs, sel->obj_fg);
+ }
+ }
}
x = y = w = h = -1;
evas_object_geometry_get(o, &x, &y, &w, &h);
if (en->have_selection)
{
- EINA_LIST_FOREACH(en->sel, l, sel)
- {
- Evas_Textblock_Rectangle *r;
-
- r = range->data;
- if (sel->obj_bg)
- {
- evas_object_move(sel->obj_bg, x + r->x, y + r->y);
- evas_object_resize(sel->obj_bg, r->w, r->h);
- }
- if (sel->obj_fg)
- {
- evas_object_move(sel->obj_fg, x + r->x, y + r->y);
- evas_object_resize(sel->obj_fg, r->w, r->h);
- }
- *(&(sel->rect)) = *r;
- range = eina_list_remove_list(range, range);
- free(r);
- }
+ EINA_LIST_FOREACH(en->sel, l, sel)
+ {
+ Evas_Textblock_Rectangle *r;
+
+ r = range->data;
+ if (sel->obj_bg)
+ {
+ evas_object_move(sel->obj_bg, x + r->x, y + r->y);
+ evas_object_resize(sel->obj_bg, r->w, r->h);
+ }
+ if (sel->obj_fg)
+ {
+ evas_object_move(sel->obj_fg, x + r->x, y + r->y);
+ evas_object_resize(sel->obj_fg, r->w, r->h);
+ }
+ *(&(sel->rect)) = *r;
+ range = eina_list_remove_list(range, range);
+ free(r);
+ }
}
else
{
- while (range)
- {
- free(range->data);
- range = eina_list_remove_list(range, range);
- }
+ while (range)
+ {
+ free(range->data);
+ range = eina_list_remove_list(range, range);
+ }
}
}
int len;
int ignored;
Entry *en;
-
+
en = rp->entry_data;
if ((rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_EXPLICIT) &&
(en->select_allow))
- return;
+ return;
ignored = rp->part->ignore_flags & ev->event_flags;
if ((!ev->event_flags) || (!ignored))
{
- n = an->name;
- if (!n) n = "";
- len = 200 + strlen(n);
- buf = alloca(len);
+ n = an->name;
+ if (!n) n = "";
+ len = 200 + strlen(n);
+ buf = alloca(len);
if (ev->flags & EVAS_BUTTON_TRIPLE_CLICK)
- snprintf(buf, len, "anchor,mouse,down,%i,%s,triple", ev->button, n);
+ snprintf(buf, len, "anchor,mouse,down,%i,%s,triple", ev->button, n);
else if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK)
- snprintf(buf, len, "anchor,mouse,down,%i,%s,double", ev->button, n);
- else
- snprintf(buf, len, "anchor,mouse,down,%i,%s", ev->button, n);
- _edje_emit(rp->edje, buf, rp->part->name);
+ snprintf(buf, len, "anchor,mouse,down,%i,%s,double", ev->button, n);
+ else
+ snprintf(buf, len, "anchor,mouse,down,%i,%s", ev->button, n);
+ _edje_emit(rp->edje, buf, rp->part->name);
}
}
int len;
int ignored;
Entry *en;
-
+
en = rp->entry_data;
ignored = rp->part->ignore_flags & ev->event_flags;
if ((rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_EXPLICIT) &&
(en->select_allow))
- return;
+ return;
if ((!ev->event_flags) || (!ignored))
{
- n = an->name;
- if (!n) n = "";
- len = 200 + strlen(n);
- buf = alloca(len);
- snprintf(buf, len, "anchor,mouse,up,%i,%s", ev->button, n);
- _edje_emit(rp->edje, buf, rp->part->name);
+ n = an->name;
+ if (!n) n = "";
+ len = 200 + strlen(n);
+ buf = alloca(len);
+ snprintf(buf, len, "anchor,mouse,up,%i,%s", ev->button, n);
+ _edje_emit(rp->edje, buf, rp->part->name);
}
}
int len;
int ignored;
Entry *en;
-
+
en = rp->entry_data;
if ((rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_EXPLICIT) &&
(en->select_allow))
- return;
+ return;
ignored = rp->part->ignore_flags & ev->event_flags;
if ((!ev->event_flags) || (!ignored))
{
- n = an->name;
- if (!n) n = "";
- len = 200 + strlen(n);
- buf = alloca(len);
- snprintf(buf, len, "anchor,mouse,move,%s", n);
- _edje_emit(rp->edje, buf, rp->part->name);
+ n = an->name;
+ if (!n) n = "";
+ len = 200 + strlen(n);
+ buf = alloca(len);
+ snprintf(buf, len, "anchor,mouse,move,%s", n);
+ _edje_emit(rp->edje, buf, rp->part->name);
}
}
ignored = rp->part->ignore_flags & ev->event_flags;
if ((!ev->event_flags) || (!ignored))
{
- n = an->name;
- if (!n) n = "";
- len = 200 + strlen(n);
- buf = alloca(len);
- snprintf(buf, len, "anchor,mouse,in,%s", n);
- _edje_emit(rp->edje, buf, rp->part->name);
+ n = an->name;
+ if (!n) n = "";
+ len = 200 + strlen(n);
+ buf = alloca(len);
+ snprintf(buf, len, "anchor,mouse,in,%s", n);
+ _edje_emit(rp->edje, buf, rp->part->name);
}
}
ignored = rp->part->ignore_flags & ev->event_flags;
if ((!ev->event_flags) || (!ignored))
{
- n = an->name;
- if (!n) n = "";
- len = 200 + strlen(n);
- buf = alloca(len);
- snprintf(buf, len, "anchor,mouse,out,%s", n);
- _edje_emit(rp->edje, buf, rp->part->name);
+ n = an->name;
+ if (!n) n = "";
+ len = 200 + strlen(n);
+ buf = alloca(len);
+ snprintf(buf, len, "anchor,mouse,out,%s", n);
+ _edje_emit(rp->edje, buf, rp->part->name);
}
}
evas_object_smart_member_add(ob, smart);
evas_object_stack_above(ob, o);
evas_object_clip_set(ob, clip);
- evas_object_pass_events_set(ob, 1);
+ evas_object_pass_events_set(ob, EINA_TRUE);
evas_object_show(ob);
sel->obj = ob;
}
evas_object_smart_member_add(ob, smart);
evas_object_stack_below(ob, o);
evas_object_clip_set(ob, clip);
- evas_object_pass_events_set(ob, 1);
+ evas_object_pass_events_set(ob, EINA_TRUE);
evas_object_show(ob);
sel->obj_bg = ob;
en->rp->edje->subobjs = eina_list_append(en->rp->edje->subobjs, sel->obj_bg);
evas_object_smart_member_add(ob, smart);
evas_object_stack_above(ob, o);
evas_object_clip_set(ob, clip);
- evas_object_pass_events_set(ob, 1);
+ evas_object_pass_events_set(ob, EINA_TRUE);
evas_object_show(ob);
sel->obj_fg = ob;
en->rp->edje->subobjs = eina_list_append(en->rp->edje->subobjs, sel->obj_fg);
evas_object_smart_member_add(ob, smart);
evas_object_stack_above(ob, o);
evas_object_clip_set(ob, clip);
- evas_object_repeat_events_set(ob, 1);
+ evas_object_repeat_events_set(ob, EINA_TRUE);
evas_object_event_callback_add(ob, EVAS_CALLBACK_MOUSE_DOWN, _edje_anchor_mouse_down_cb, an);
evas_object_event_callback_add(ob, EVAS_CALLBACK_MOUSE_UP, _edje_anchor_mouse_up_cb, an);
evas_object_event_callback_add(ob, EVAS_CALLBACK_MOUSE_MOVE, _edje_anchor_mouse_move_cb, an);
{
while (en->anchorlist)
{
- free(en->anchorlist->data);
- en->anchorlist = eina_list_remove_list(en->anchorlist, en->anchorlist);
+ free(en->anchorlist->data);
+ en->anchorlist = eina_list_remove_list(en->anchorlist, en->anchorlist);
}
while (en->itemlist)
{
- free(en->itemlist->data);
- en->itemlist = eina_list_remove_list(en->itemlist, en->itemlist);
+ free(en->itemlist->data);
+ en->itemlist = eina_list_remove_list(en->itemlist, en->itemlist);
}
while (en->anchors)
{
- Anchor *an = en->anchors->data;
-
- evas_textblock_cursor_free(an->start);
- evas_textblock_cursor_free(an->end);
- while (an->sel)
- {
- Sel *sel = an->sel->data;
- en->rp->edje->subobjs = eina_list_remove(en->rp->edje->subobjs, sel->obj_bg);
- en->rp->edje->subobjs = eina_list_remove(en->rp->edje->subobjs, sel->obj_fg);
- if (sel->obj_bg) evas_object_del(sel->obj_bg);
- if (sel->obj_fg) evas_object_del(sel->obj_fg);
- if (sel->obj) evas_object_del(sel->obj);
- free(sel);
- an->sel = eina_list_remove_list(an->sel, an->sel);
- }
- free(an->name);
- free(an);
- en->anchors = eina_list_remove_list(en->anchors, en->anchors);
+ Anchor *an = en->anchors->data;
+
+ evas_textblock_cursor_free(an->start);
+ evas_textblock_cursor_free(an->end);
+ while (an->sel)
+ {
+ Sel *sel = an->sel->data;
+ en->rp->edje->subobjs = eina_list_remove(en->rp->edje->subobjs, sel->obj_bg);
+ en->rp->edje->subobjs = eina_list_remove(en->rp->edje->subobjs, sel->obj_fg);
+ if (sel->obj_bg) evas_object_del(sel->obj_bg);
+ if (sel->obj_fg) evas_object_del(sel->obj_fg);
+ if (sel->obj) evas_object_del(sel->obj);
+ free(sel);
+ an->sel = eina_list_remove_list(an->sel, an->sel);
+ }
+ free(an->name);
+ free(an);
+ en->anchors = eina_list_remove_list(en->anchors, en->anchors);
}
}
node = evas_textblock_node_format_first_get(o);
for (; node ; node = evas_textblock_node_format_next_get(node))
{
- const char *s;
+ const char *s;
evas_textblock_cursor_at_format_set(c1, node);
- s = evas_textblock_node_format_text_get(node);
- if (s)
- {
- if ((!strncmp(s, "+ a ", 4)) || (!strncmp(s, "+a ", 3)))
- {
- an = calloc(1, sizeof(Anchor));
- if (an)
- {
- char *p;
-
- an->en = en;
- p = strstr(s, "href=");
- if (p)
- {
- an->name = strdup(p + 5);
- }
- en->anchors = eina_list_append(en->anchors, an);
- an->start = evas_object_textblock_cursor_new(o);
- an->end = evas_object_textblock_cursor_new(o);
- evas_textblock_cursor_copy(c1, an->start);
- evas_textblock_cursor_copy(c1, an->end);
- }
- }
- else if ((!strcmp(s, "- a")) || (!strcmp(s, "-a")))
- {
- /* Close the anchor, if the anchor was without text, free it as well */
- if (an)
- {
+ s = evas_textblock_node_format_text_get(node);
+ if (s)
+ {
+ if ((!strncmp(s, "+ a ", 4)) || (!strncmp(s, "+a ", 3)))
+ {
+ an = calloc(1, sizeof(Anchor));
+ if (an)
+ {
+ char *p;
+
+ an->en = en;
+ p = strstr(s, "href=");
+ if (p)
+ {
+ an->name = strdup(p + 5);
+ }
+ en->anchors = eina_list_append(en->anchors, an);
+ an->start = evas_object_textblock_cursor_new(o);
+ an->end = evas_object_textblock_cursor_new(o);
+ evas_textblock_cursor_copy(c1, an->start);
+ evas_textblock_cursor_copy(c1, an->end);
+ }
+ }
+ else if ((!strcmp(s, "- a")) || (!strcmp(s, "-a")))
+ {
+ /* Close the anchor, if the anchor was without text, free it as well */
+ if (an)
+ {
evas_textblock_cursor_at_format_set(an->end, node);
/* Go before the format */
evas_textblock_cursor_char_prev(an->end);
- if (!evas_textblock_cursor_compare(an->start, an->end))
- {
- if (an->name) free(an->name);
- evas_textblock_cursor_free(an->start);
- evas_textblock_cursor_free(an->end);
- en->anchors = eina_list_remove(en->anchors, an);
- free(an);
- }
- an = NULL;
- }
- }
- else if (!strncmp(s, "+ item ", 7))
- {
- an = calloc(1, sizeof(Anchor));
- if (an)
- {
- char *p;
-
- an->en = en;
+ if (!evas_textblock_cursor_compare(an->start, an->end))
+ {
+ if (an->name) free(an->name);
+ evas_textblock_cursor_free(an->start);
+ evas_textblock_cursor_free(an->end);
+ en->anchors = eina_list_remove(en->anchors, an);
+ free(an);
+ }
+ an = NULL;
+ }
+ }
+ else if (!strncmp(s, "+ item ", 7))
+ {
+ an = calloc(1, sizeof(Anchor));
+ if (an)
+ {
+ char *p;
+
+ an->en = en;
an->item = 1;
- p = strstr(s, "href=");
- if (p)
- {
- an->name = strdup(p + 5);
- }
- en->anchors = eina_list_append(en->anchors, an);
- an->start = evas_object_textblock_cursor_new(o);
- an->end = evas_object_textblock_cursor_new(o);
- evas_textblock_cursor_copy(c1, an->start);
- evas_textblock_cursor_copy(c1, an->end);
- }
- }
- else if ((!strcmp(s, "- item")) || (!strcmp(s, "-item")))
- {
- if (an)
- {
-/*
- if (!firsttext)
- {
- if (an->name) free(an->name);
- evas_textblock_cursor_free(an->start);
- evas_textblock_cursor_free(an->end);
- en->anchors = eina_list_remove(en->anchors, an);
- free(an);
- }
- */
- an = NULL;
- }
- }
- }
+ p = strstr(s, "href=");
+ if (p)
+ {
+ an->name = strdup(p + 5);
+ }
+ en->anchors = eina_list_append(en->anchors, an);
+ an->start = evas_object_textblock_cursor_new(o);
+ an->end = evas_object_textblock_cursor_new(o);
+ evas_textblock_cursor_copy(c1, an->start);
+ evas_textblock_cursor_copy(c1, an->end);
+ }
+ }
+ else if ((!strcmp(s, "- item")) || (!strcmp(s, "-item")))
+ {
+ if (an)
+ {
+ /*
+ if (!firsttext)
+ {
+ if (an->name) free(an->name);
+ evas_textblock_cursor_free(an->start);
+ evas_textblock_cursor_free(an->end);
+ en->anchors = eina_list_remove(en->anchors, an);
+ free(an);
+ }
+ */
+ an = NULL;
+ }
+ }
+ }
}
evas_textblock_cursor_free(c1);
}
_backspace(Evas_Textblock_Cursor *c, Evas_Object *o __UNUSED__, Entry *en __UNUSED__)
{
if (evas_textblock_cursor_char_prev(c))
- evas_textblock_cursor_char_delete(c);
+ evas_textblock_cursor_char_delete(c);
}
static void
en = rp->entry_data;
if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) ||
(rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_EDITABLE))
- return;
+ return;
if (!ev->key) return;
#ifdef HAVE_ECORE_IMF
if (ecore_imf_context_filter_event(en->imf_context,
ECORE_IMF_EVENT_KEY_DOWN,
(Ecore_IMF_Event *)&ecore_ev))
- return;
+ return;
}
#endif
-
+
tc = evas_object_textblock_cursor_new(rp->object);
evas_textblock_cursor_copy(en->cursor, tc);
-
+
control = evas_key_modifier_is_set(ev->modifiers, "Control");
alt = evas_key_modifier_is_set(ev->modifiers, "Alt");
shift = evas_key_modifier_is_set(ev->modifiers, "Shift");
cursor_changed = EINA_FALSE;
if (!strcmp(ev->key, "Escape"))
{
- // dead keys here. Escape for now (should emit these)
+ // dead keys here. Escape for now (should emit these)
_edje_emit(ed, "entry,key,escape", rp->part->name);
- ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
+ ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
}
else if (!strcmp(ev->key, "Up"))
{
- if (multiline)
- {
+ if (multiline)
+ {
if (en->select_allow)
{
if (shift) _sel_start(en->cursor, rp->object, en);
else _sel_clear(en->cursor, rp->object, en);
}
- _curs_up(en->cursor, rp->object, en);
+ _curs_up(en->cursor, rp->object, en);
if (en->select_allow)
{
if (shift) _sel_extend(en->cursor, rp->object, en);
}
- ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- }
+ ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
+ }
_edje_emit(ed, "entry,key,up", rp->part->name);
}
else if (!strcmp(ev->key, "Down"))
{
- if (multiline)
- {
+ if (multiline)
+ {
if (en->select_allow)
{
if (shift) _sel_start(en->cursor, rp->object, en);
else _sel_clear(en->cursor, rp->object, en);
}
- _curs_down(en->cursor, rp->object, en);
+ _curs_down(en->cursor, rp->object, en);
if (en->select_allow)
{
if (shift) _sel_extend(en->cursor, rp->object, en);
}
- ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- }
+ ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
+ }
_edje_emit(ed, "entry,key,down", rp->part->name);
}
else if (!strcmp(ev->key, "Left"))
if (shift) _sel_start(en->cursor, rp->object, en);
else _sel_clear(en->cursor, rp->object, en);
}
- _curs_back(en->cursor, rp->object, en);
+ _curs_back(en->cursor, rp->object, en);
if (en->select_allow)
{
if (shift) _sel_extend(en->cursor, rp->object, en);
}
_edje_emit(ed, "entry,key,left", rp->part->name);
- ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
+ ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
}
else if (!strcmp(ev->key, "Right"))
{
if (shift) _sel_start(en->cursor, rp->object, en);
else _sel_clear(en->cursor, rp->object, en);
}
- _curs_next(en->cursor, rp->object, en);
+ _curs_next(en->cursor, rp->object, en);
if (en->select_allow)
{
if (shift) _sel_extend(en->cursor, rp->object, en);
}
_edje_emit(ed, "entry,key,right", rp->part->name);
- ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
+ ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
}
else if (!strcmp(ev->key, "BackSpace"))
{
- if (control)
- {
- // del to start of previous word
- }
- else if ((alt) && (shift))
- {
- // undo last action
- }
- else
- {
- if (en->have_selection)
- _range_del(en->cursor, rp->object, en);
- else
- _backspace(en->cursor, rp->object, en);
- }
- _sel_clear(en->cursor, rp->object, en);
- _curs_update_from_curs(en->cursor, rp->object, en);
- _anchors_get(en->cursor, rp->object, en);
- _edje_emit(ed, "entry,changed", rp->part->name);
+ if (control)
+ {
+ // del to start of previous word
+ }
+ else if ((alt) && (shift))
+ {
+ // undo last action
+ }
+ else
+ {
+ if (en->have_selection)
+ _range_del(en->cursor, rp->object, en);
+ else
+ _backspace(en->cursor, rp->object, en);
+ }
+ _sel_clear(en->cursor, rp->object, en);
+ _curs_update_from_curs(en->cursor, rp->object, en);
+ _anchors_get(en->cursor, rp->object, en);
+ _edje_emit(ed, "entry,changed", rp->part->name);
_edje_emit(ed, "entry,key,backspace", rp->part->name);
- ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
+ ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
}
else if (!strcmp(ev->key, "Delete"))
{
- if (control)
- {
- // del to end of next word
- }
- else if (shift)
- {
- // cut
- }
- else
- {
- if (en->have_selection)
- _range_del(en->cursor, rp->object, en);
- else
- _delete(en->cursor, rp->object, en);
- }
- _sel_clear(en->cursor, rp->object, en);
- _curs_update_from_curs(en->cursor, rp->object, en);
- _anchors_get(en->cursor, rp->object, en);
- _edje_emit(ed, "entry,changed", rp->part->name);
- _edje_emit(ed, "entry,key,delete", rp->part->name);
- ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
+ if (control)
+ {
+ // del to end of next word
+ }
+ else if (shift)
+ {
+ // cut
+ }
+ else
+ {
+ if (en->have_selection)
+ _range_del(en->cursor, rp->object, en);
+ else
+ _delete(en->cursor, rp->object, en);
+ }
+ _sel_clear(en->cursor, rp->object, en);
+ _curs_update_from_curs(en->cursor, rp->object, en);
+ _anchors_get(en->cursor, rp->object, en);
+ _edje_emit(ed, "entry,changed", rp->part->name);
+ _edje_emit(ed, "entry,key,delete", rp->part->name);
+ ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
}
else if (!strcmp(ev->key, "Home"))
{
if (shift) _sel_start(en->cursor, rp->object, en);
else _sel_clear(en->cursor, rp->object, en);
}
- if ((control) && (multiline))
- _curs_start(en->cursor, rp->object, en);
- else
- _curs_lin_start(en->cursor, rp->object, en);
+ if ((control) && (multiline))
+ _curs_start(en->cursor, rp->object, en);
+ else
+ _curs_lin_start(en->cursor, rp->object, en);
if (en->select_allow)
{
if (shift) _sel_extend(en->cursor, rp->object, en);
}
_edje_emit(ed, "entry,key,home", rp->part->name);
- ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
+ ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
}
else if (!strcmp(ev->key, "End"))
{
if (shift) _sel_start(en->cursor, rp->object, en);
else _sel_clear(en->cursor, rp->object, en);
}
- if ((control) && (multiline))
- _curs_end(en->cursor, rp->object, en);
- else
- _curs_lin_end(en->cursor, rp->object, en);
+ if ((control) && (multiline))
+ _curs_end(en->cursor, rp->object, en);
+ else
+ _curs_lin_end(en->cursor, rp->object, en);
if (en->select_allow)
{
if (shift) _sel_extend(en->cursor, rp->object, en);
}
_edje_emit(ed, "entry,key,end", rp->part->name);
- ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
+ ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
}
else if ((control) && (!strcmp(ev->key, "v")))
{
- _edje_emit(ed, "entry,paste,request", rp->part->name);
- ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
+ _edje_emit(ed, "entry,paste,request", rp->part->name);
+ ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
}
else if ((control) && ((!strcmp(ev->key, "c") || (!strcmp(ev->key, "Insert")))))
{
- // FIXME: copy - save selection
- _edje_emit(ed, "entry,copy,notify", rp->part->name);
- ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
+ // FIXME: copy - save selection
+ _edje_emit(ed, "entry,copy,notify", rp->part->name);
+ ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
}
else if ((control) && ((!strcmp(ev->key, "x") || (!strcmp(ev->key, "m")))))
{
- // FIXME: cut - save selection, delete seletion
- _curs_update_from_curs(en->cursor, rp->object, en);
- _edje_emit(ed, "entry,cut,notify", rp->part->name);
- ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
+ // FIXME: cut - save selection, delete seletion
+ _curs_update_from_curs(en->cursor, rp->object, en);
+ _edje_emit(ed, "entry,cut,notify", rp->part->name);
+ ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
}
else if ((control) && (!strcmp(ev->key, "z")))
{
- if (shift)
- {
- // redo
- }
- else
- {
- // undo
- }
- ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
+ if (shift)
+ {
+ // redo
+ }
+ else
+ {
+ // undo
+ }
+ ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
}
else if ((control) && (!strcmp(ev->key, "y")))
{
- // redo
- ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
+ // redo
+ ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
}
else if ((control) && (!strcmp(ev->key, "w")))
{
- _sel_clear(en->cursor, rp->object, en);
- // select current word
- ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
+ _sel_clear(en->cursor, rp->object, en);
+ // select current word
+ ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
}
else if (!strcmp(ev->key, "Tab"))
{
- if (multiline)
- {
- if (shift)
- {
- // remove a tab
- }
- else
- {
+ if (multiline)
+ {
+ if (shift)
+ {
+ // remove a tab
+ }
+ else
+ {
//yy
- evas_textblock_cursor_format_prepend(en->cursor, "\t");
- _curs_update_from_curs(en->cursor, rp->object, en);
- _anchors_get(en->cursor, rp->object, en);
- _edje_emit(ed, "entry,changed", rp->part->name);
- }
- ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- }
+ evas_textblock_cursor_format_prepend(en->cursor, "\t");
+ _curs_update_from_curs(en->cursor, rp->object, en);
+ _anchors_get(en->cursor, rp->object, en);
+ _edje_emit(ed, "entry,changed", rp->part->name);
+ }
+ ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
+ }
_edje_emit(ed, "entry,key,tab", rp->part->name);
}
else if ((!strcmp(ev->key, "ISO_Left_Tab")) && (multiline))
{
- // remove a tab
- ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
+ // remove a tab
+ ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
}
else if (!strcmp(ev->key, "Prior"))
{
if (shift) _sel_start(en->cursor, rp->object, en);
else _sel_clear(en->cursor, rp->object, en);
}
- _curs_jump_line_by(en->cursor, rp->object, en, -10);
+ _curs_jump_line_by(en->cursor, rp->object, en, -10);
if (en->select_allow)
{
if (shift) _sel_extend(en->cursor, rp->object, en);
}
_edje_emit(ed, "entry,key,pgup", rp->part->name);
- ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
+ ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
}
else if (!strcmp(ev->key, "Next"))
{
if (shift) _sel_start(en->cursor, rp->object, en);
else _sel_clear(en->cursor, rp->object, en);
}
- _curs_jump_line_by(en->cursor, rp->object, en, 10);
+ _curs_jump_line_by(en->cursor, rp->object, en, 10);
if (en->select_allow)
{
if (shift) _sel_extend(en->cursor, rp->object, en);
}
_edje_emit(ed, "entry,key,pgdn", rp->part->name);
- ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
+ ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
}
else if ((!strcmp(ev->key, "Return")) || (!strcmp(ev->key, "KP_Enter")))
{
- if (multiline)
- {
+ if (multiline)
+ {
if (en->have_selection)
- _range_del(en->cursor, rp->object, en);
+ _range_del(en->cursor, rp->object, en);
_sel_clear(en->cursor, rp->object, en);
if (shift)
{
{
evas_textblock_cursor_format_prepend(en->cursor, "ps");
}
- _curs_update_from_curs(en->cursor, rp->object, en);
- _anchors_get(en->cursor, rp->object, en);
- _edje_emit(ed, "entry,changed", rp->part->name);
- _edje_emit(ed, "cursor,changed", rp->part->name);
- cursor_changed = EINA_TRUE;
- ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- }
+ _curs_update_from_curs(en->cursor, rp->object, en);
+ _anchors_get(en->cursor, rp->object, en);
+ _edje_emit(ed, "entry,changed", rp->part->name);
+ _edje_emit(ed, "cursor,changed", rp->part->name);
+ cursor_changed = EINA_TRUE;
+ ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
+ }
_edje_emit(ed, "entry,key,enter", rp->part->name);
}
else
{
- if (ev->string)
- {
- if (en->have_selection)
- _range_del(en->cursor, rp->object, en);
- _sel_clear(en->cursor, rp->object, en);
+ if (ev->string)
+ {
+ if (en->have_selection)
+ _range_del(en->cursor, rp->object, en);
+ _sel_clear(en->cursor, rp->object, en);
//zz
- evas_textblock_cursor_text_prepend(en->cursor, ev->string);
- _curs_update_from_curs(en->cursor, rp->object, en);
- _anchors_get(en->cursor, rp->object, en);
- _edje_emit(ed, "entry,changed", rp->part->name);
- _edje_emit(ed, "cursor,changed", rp->part->name);
- cursor_changed = EINA_TRUE;
- ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- }
+ evas_textblock_cursor_text_prepend(en->cursor, ev->string);
+ _curs_update_from_curs(en->cursor, rp->object, en);
+ _anchors_get(en->cursor, rp->object, en);
+ _edje_emit(ed, "entry,changed", rp->part->name);
+ _edje_emit(ed, "cursor,changed", rp->part->name);
+ cursor_changed = EINA_TRUE;
+ ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
+ }
}
if ((evas_textblock_cursor_compare(tc, en->cursor)) && (!cursor_changed))
- _edje_emit(ed, "cursor,changed", rp->part->name);
+ _edje_emit(ed, "cursor,changed", rp->part->name);
#ifdef HAVE_ECORE_IMF
if (en->imf_context)
{
- ecore_imf_context_reset(en->imf_context);
- ecore_imf_context_cursor_position_set(en->imf_context,
+ ecore_imf_context_reset(en->imf_context);
+ ecore_imf_context_cursor_position_set(en->imf_context,
evas_textblock_cursor_pos_get(en->cursor));
}
#endif
-
+
evas_textblock_cursor_free(tc);
_edje_entry_real_part_configure(rp);
}
en = rp->entry_data;
if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) ||
(rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_EDITABLE))
- return;
+ return;
#ifdef HAVE_ECORE_IMF
if (en->imf_context)
if (ecore_imf_context_filter_event(en->imf_context,
ECORE_IMF_EVENT_KEY_UP,
(Ecore_IMF_Event *)&ecore_ev))
- return;
+ return;
}
#endif
}
Evas_Event_Mouse_Down *ev = event_info;
Entry *en;
Evas_Coord x, y, w, h;
-// Eina_Bool multiline;
+ // Eina_Bool multiline;
Evas_Textblock_Cursor *tc;
Eina_Bool dosel = EINA_FALSE;
if (!rp) return;
en = rp->entry_data;
if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) ||
(rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_SELECTABLE))
- return;
+ return;
if (ev->button == 2)
{
- _edje_emit(rp->edje, "entry,paste,request", rp->part->name);
+ _edje_emit(rp->edje, "entry,paste,request", rp->part->name);
return;
}
if (ev->button != 1) return;
en->select_mod_start = EINA_FALSE;
en->select_mod_end = EINA_FALSE;
if (rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_DEFAULT)
- dosel = EINA_TRUE;
+ dosel = EINA_TRUE;
else if (rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_EXPLICIT)
{
if (en->select_allow) dosel = EINA_TRUE;
}
tc = evas_object_textblock_cursor_new(rp->object);
evas_textblock_cursor_copy(en->cursor, tc);
-// multiline = rp->part->multiline;
+ // multiline = rp->part->multiline;
evas_object_geometry_get(rp->object, &x, &y, &w, &h);
en->cx = ev->canvas.x - x;
en->cy = ev->canvas.y - y;
line = evas_textblock_cursor_line_coord_set(en->cursor, en->cy);
if (line == -1)
- _curs_end(en->cursor, rp->object, en);
+ _curs_end(en->cursor, rp->object, en);
else
{
int lnum;
-
+
lnum = evas_textblock_cursor_line_geometry_get(en->cursor, &lx, &ly, &lw, &lh);
if (lnum < 0)
{
else
{
if (en->cx <= lx)
- _curs_lin_start(en->cursor, rp->object, en);
+ _curs_lin_start(en->cursor, rp->object, en);
else
- _curs_lin_end(en->cursor, rp->object, en);
+ _curs_lin_end(en->cursor, rp->object, en);
}
}
}
{
Eina_List *first, *last;
FLOAT_T sc;
-
+
first = en->sel;
last = eina_list_last(en->sel);
if (first && last)
{
Evas_Textblock_Rectangle *r1, *r2;
Evas_Coord d, d1, d2;
-
+
r1 = first->data;
r2 = last->data;
d = r1->x - en->cx;
}
}
if (evas_textblock_cursor_compare(tc, en->cursor))
- _edje_emit(rp->edje, "cursor,changed", rp->part->name);
+ _edje_emit(rp->edje, "cursor,changed", rp->part->name);
#ifdef HAVE_ECORE_IMF
if (en->imf_context)
{
- ecore_imf_context_reset(en->imf_context);
- ecore_imf_context_cursor_position_set(en->imf_context,
+ ecore_imf_context_reset(en->imf_context);
+ ecore_imf_context_cursor_position_set(en->imf_context,
evas_textblock_cursor_pos_get(en->cursor));
}
#endif
-
+
evas_textblock_cursor_free(tc);
_edje_entry_real_part_configure(rp);
}
en = rp->entry_data;
if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) ||
(rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_SELECTABLE))
- return;
+ return;
tc = evas_object_textblock_cursor_new(rp->object);
evas_textblock_cursor_copy(en->cursor, tc);
evas_object_geometry_get(rp->object, &x, &y, &w, &h);
line = evas_textblock_cursor_line_coord_set(en->cursor, en->cy);
if (line == -1)
- _curs_end(en->cursor, rp->object, en);
+ _curs_end(en->cursor, rp->object, en);
else
{
int lnum;
-
+
lnum = evas_textblock_cursor_line_geometry_get(en->cursor, &lx, &ly, &lw, &lh);
if (lnum < 0)
{
else
{
if (en->cx <= lx)
- _curs_lin_start(en->cursor, rp->object, en);
+ _curs_lin_start(en->cursor, rp->object, en);
else
- _curs_lin_end(en->cursor, rp->object, en);
+ _curs_lin_end(en->cursor, rp->object, en);
}
}
}
if (en->had_sel)
{
if (en->select_mod_end)
- _sel_extend(en->cursor, rp->object, en);
+ _sel_extend(en->cursor, rp->object, en);
else if (en->select_mod_start)
- _sel_preextend(en->cursor, rp->object, en);
+ _sel_preextend(en->cursor, rp->object, en);
}
else
- _sel_extend(en->cursor, rp->object, en);
-// evas_textblock_cursor_copy(en->cursor, en->sel_end);
+ _sel_extend(en->cursor, rp->object, en);
+ //evas_textblock_cursor_copy(en->cursor, en->sel_end);
}
}
else
- evas_textblock_cursor_copy(en->cursor, en->sel_end);
+ evas_textblock_cursor_copy(en->cursor, en->sel_end);
if (en->selecting)
{
if (en->have_selection)
- en->had_sel = EINA_TRUE;
+ en->had_sel = EINA_TRUE;
en->selecting = EINA_FALSE;
}
if (evas_textblock_cursor_compare(tc, en->cursor))
- _edje_emit(rp->edje, "cursor,changed", rp->part->name);
+ _edje_emit(rp->edje, "cursor,changed", rp->part->name);
evas_textblock_cursor_free(tc);
#ifdef HAVE_ECORE_IMF
evas_textblock_cursor_pos_get(en->cursor));
}
#endif
-
+
_edje_entry_real_part_configure(rp);
}
en = rp->entry_data;
if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) ||
(rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_SELECTABLE))
- return;
+ return;
if (en->selecting)
{
tc = evas_object_textblock_cursor_new(rp->object);
if (!evas_textblock_cursor_char_coord_set(en->cursor, en->cx, en->cy))
{
Evas_Coord lx, ly, lw, lh;
-
+
evas_textblock_cursor_line_coord_set(en->cursor, en->cy);
evas_textblock_cursor_line_geometry_get(en->cursor, &lx, &ly, &lw, &lh);
if (en->cx <= lx)
- _curs_lin_start(en->cursor, rp->object, en);
+ _curs_lin_start(en->cursor, rp->object, en);
else
- _curs_lin_end(en->cursor, rp->object, en);
+ _curs_lin_end(en->cursor, rp->object, en);
}
if (rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_EXPLICIT)
{
if (en->had_sel)
{
if (en->select_mod_end)
- _sel_extend(en->cursor, rp->object, en);
+ _sel_extend(en->cursor, rp->object, en);
else if (en->select_mod_start)
- _sel_preextend(en->cursor, rp->object, en);
+ _sel_preextend(en->cursor, rp->object, en);
}
else
- _sel_extend(en->cursor, rp->object, en);
+ _sel_extend(en->cursor, rp->object, en);
}
}
else
if (en->select_allow)
{
if (evas_textblock_cursor_compare(en->sel_start, en->sel_end) != 0)
- _sel_enable(en->cursor, rp->object, en);
+ _sel_enable(en->cursor, rp->object, en);
if (en->have_selection)
- _sel_update(en->cursor, rp->object, en);
+ _sel_update(en->cursor, rp->object, en);
}
if (evas_textblock_cursor_compare(tc, en->cursor))
- _edje_emit(rp->edje, "cursor,changed", rp->part->name);
+ _edje_emit(rp->edje, "cursor,changed", rp->part->name);
evas_textblock_cursor_free(tc);
#ifdef HAVE_ECORE_IMF
evas_textblock_cursor_pos_get(en->cursor));
}
#endif
-
+
_edje_entry_real_part_configure(rp);
}
}
Edje *ed = (Edje *)data;
if (evas_focus_get(e) == ed->obj) {
- _edje_focus_in_cb(data, NULL, NULL, NULL);
+ _edje_focus_in_cb(data, NULL, NULL, NULL);
}
}
Edje *ed = (Edje *)data;
if (evas_focus_get(e) == ed->obj) {
- _edje_focus_out_cb(data, NULL, NULL, NULL);
+ _edje_focus_out_cb(data, NULL, NULL, NULL);
}
}
_edje_entry_init(Edje *ed)
{
if (!ed->has_entries)
- return;
+ return;
if (ed->entries_inited)
- return;
+ return;
ed->entries_inited = EINA_TRUE;
evas_object_event_callback_add(ed->obj, EVAS_CALLBACK_FOCUS_IN, _edje_focus_in_cb, ed);
_edje_entry_shutdown(Edje *ed)
{
if (!ed->has_entries)
- return;
+ return;
if (!ed->entries_inited)
- return;
+ return;
ed->entries_inited = EINA_FALSE;
evas_object_event_callback_del(ed->obj, EVAS_CALLBACK_FOCUS_IN, _edje_focus_in_cb);
evas_object_event_callback_del(ed->obj, EVAS_CALLBACK_KEY_DOWN, _edje_key_down_cb);
evas_object_event_callback_del(ed->obj, EVAS_CALLBACK_KEY_UP, _edje_key_up_cb);
if (evas_event_callback_del_full(ed->evas, EVAS_CALLBACK_CANVAS_FOCUS_IN, _evas_focus_in_cb, ed) != ed)
- ERR("could not unregister EVAS_CALLBACK_FOCUS_IN");
+ ERR("could not unregister EVAS_CALLBACK_FOCUS_IN");
if (evas_event_callback_del_full(ed->evas, EVAS_CALLBACK_CANVAS_FOCUS_OUT, _evas_focus_out_cb, ed) != ed)
- ERR("could not unregister EVAS_CALLBACK_FOCUS_OUT");
+ ERR("could not unregister EVAS_CALLBACK_FOCUS_OUT");
}
void
const char *ctx_id;
const Ecore_IMF_Context_Info *ctx_info;
#endif
-
+
en = calloc(1, sizeof(Entry));
if (!en) return;
rp->entry_data = en;
evas_object_event_callback_add(rp->object, EVAS_CALLBACK_MOUSE_DOWN, _edje_part_mouse_down_cb, rp);
evas_object_event_callback_add(rp->object, EVAS_CALLBACK_MOUSE_UP, _edje_part_mouse_up_cb, rp);
evas_object_event_callback_add(rp->object, EVAS_CALLBACK_MOUSE_MOVE, _edje_part_mouse_move_cb, rp);
-
+
if (rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_DEFAULT)
- en->select_allow = 1;
+ en->select_allow = 1;
if (rp->part->entry_mode == EDJE_ENTRY_EDIT_MODE_PASSWORD)
{
- Edje_Part_Description_Text *txt;
+ Edje_Part_Description_Text *txt;
- txt = (Edje_Part_Description_Text *) rp->chosen_description;
+ txt = (Edje_Part_Description_Text *) rp->chosen_description;
en->select_allow = 0;
- if (txt && edje_string_get(&txt->text.repch))
- evas_object_textblock_replace_char_set(rp->object, edje_string_get(&txt->text.repch));
- else
- evas_object_textblock_replace_char_set(rp->object, "*");
+ if (txt && edje_string_get(&txt->text.repch))
+ evas_object_textblock_replace_char_set(rp->object, edje_string_get(&txt->text.repch));
+ else
+ evas_object_textblock_replace_char_set(rp->object, "*");
}
en->cursor_bg = edje_object_add(rp->edje->evas);
evas_object_smart_member_add(en->cursor_bg, rp->edje->obj);
evas_object_stack_below(en->cursor_bg, rp->object);
evas_object_clip_set(en->cursor_bg, evas_object_clip_get(rp->object));
- evas_object_pass_events_set(en->cursor_bg, 1);
+ evas_object_pass_events_set(en->cursor_bg, EINA_TRUE);
rp->edje->subobjs = eina_list_append(rp->edje->subobjs, en->cursor_bg);
-
+
en->cursor_fg = edje_object_add(rp->edje->evas);
edje_object_file_set(en->cursor_fg, rp->edje->path, rp->part->source4);
evas_object_smart_member_add(en->cursor_fg, rp->edje->obj);
evas_object_stack_above(en->cursor_fg, rp->object);
evas_object_clip_set(en->cursor_fg, evas_object_clip_get(rp->object));
- evas_object_pass_events_set(en->cursor_fg, 1);
+ evas_object_pass_events_set(en->cursor_fg, EINA_TRUE);
rp->edje->subobjs = eina_list_append(rp->edje->subobjs, en->cursor_fg);
-
+
if (rp->part->entry_mode >= EDJE_ENTRY_EDIT_MODE_EDITABLE)
{
- evas_object_show(en->cursor_bg);
- evas_object_show(en->cursor_fg);
+ evas_object_show(en->cursor_bg);
+ evas_object_show(en->cursor_fg);
#ifdef HAVE_ECORE_IMF
ecore_imf_init();
-
+
edje_object_signal_callback_add(rp->edje->obj, "focus,part,in", rp->part->name, _edje_entry_focus_in_cb, rp);
edje_object_signal_callback_add(rp->edje->obj, "focus,part,out", rp->part->name, _edje_entry_focus_out_cb, rp);
-
+
ctx_id = ecore_imf_context_default_id_get();
if (ctx_id)
{
}
}
else
- en->imf_context = NULL;
-
+ en->imf_context = NULL;
+
if (!en->imf_context) goto done;
-
+
ecore_imf_context_client_window_set(en->imf_context, rp->object);
ecore_imf_context_client_canvas_set(en->imf_context, rp->edje->evas);
-
+
ecore_imf_context_retrieve_surrounding_callback_set(en->imf_context, _edje_entry_imf_retrieve_surrounding_cb, rp);
en->imf_ee_handler_commit = ecore_event_handler_add(ECORE_IMF_EVENT_COMMIT, _edje_entry_imf_event_commit_cb, rp->edje);
en->imf_ee_handler_delete = ecore_event_handler_add(ECORE_IMF_EVENT_DELETE_SURROUNDING, _edje_entry_imf_event_delete_surrounding_cb, rp);
ECORE_IMF_INPUT_MODE_INVISIBLE : ECORE_IMF_INPUT_MODE_FULL);
#endif
}
- done:
+done:
en->cursor = (Evas_Textblock_Cursor *)evas_object_textblock_cursor_get(rp->object);
}
ecore_event_handler_del(en->imf_ee_handler_commit);
en->imf_ee_handler_commit = NULL;
}
-
+
if (en->imf_ee_handler_delete)
{
ecore_event_handler_del(en->imf_ee_handler_delete);
en->imf_ee_handler_delete = NULL;
}
-
+
if (en->imf_ee_handler_changed)
{
ecore_event_handler_del(en->imf_ee_handler_changed);
en->imf_ee_handler_changed = NULL;
}
-
+
ecore_imf_context_del(en->imf_context);
en->imf_context = NULL;
}
-
+
edje_object_signal_callback_del(rp->edje->obj, "focus,part,in", rp->part->name, _edje_entry_focus_in_cb);
edje_object_signal_callback_del(rp->edje->obj, "focus,part,out", rp->part->name, _edje_entry_focus_out_cb);
ecore_imf_shutdown();
}
#endif
-
+
free(en);
}
if (hh < 1) ww = 1;
if (en->cursor_bg)
{
- evas_object_move(en->cursor_bg, x + xx, y + yy);
- evas_object_resize(en->cursor_bg, ww, hh);
+ evas_object_move(en->cursor_bg, x + xx, y + yy);
+ evas_object_resize(en->cursor_bg, ww, hh);
}
if (en->cursor_fg)
{
- evas_object_move(en->cursor_fg, x + xx, y + yy);
- evas_object_resize(en->cursor_fg, ww, hh);
+ evas_object_move(en->cursor_fg, x + xx, y + yy);
+ evas_object_resize(en->cursor_fg, ww, hh);
}
}
if (!en) return NULL;
// get selection - convert to markup
if ((!en->selection) && (en->have_selection))
- en->selection = evas_textblock_cursor_range_text_get
- (en->sel_start, en->sel_end, EVAS_TEXTBLOCK_TEXT_MARKUP);
+ en->selection = evas_textblock_cursor_range_text_get
+ (en->sel_start, en->sel_end, EVAS_TEXTBLOCK_TEXT_MARKUP);
return en->selection;
}
// set text as markup
_sel_clear(en->cursor, rp->object, en);
evas_object_textblock_text_markup_set(rp->object, text);
-/*
+/*
evas_textblock_cursor_paragraph_last(en->cursor);
if (!evas_textblock_cursor_node_format_get(en->cursor))
{
- evas_textblock_cursor_format_append(en->cursor, "\n");
+ evas_textblock_cursor_format_append(en->cursor, "\n");
}
else if (!((!strcmp(evas_textblock_cursor_node_format_get(en->cursor), "\n")) ||
- (!strcmp(evas_textblock_cursor_node_format_get(en->cursor), "\\n"))))
+ (!strcmp(evas_textblock_cursor_node_format_get(en->cursor), "\\n"))))
{
- evas_textblock_cursor_format_append(en->cursor, "\n");
+ evas_textblock_cursor_format_append(en->cursor, "\n");
}
- */
+*/
_anchors_get(en->cursor, rp->object, en);
_edje_emit(rp->edje, "entry,changed", rp->part->name);
_edje_entry_set_cursor_start(rp);
if (!en) return;
// prepend markup @ cursor pos
if (en->have_selection)
- _range_del(en->cursor, rp->object, en);
+ _range_del(en->cursor, rp->object, en);
_sel_clear(en->cursor, rp->object, en);
//xx
evas_object_textblock_text_markup_prepend(en->cursor, text);
_anchors_get(en->cursor, rp->object, en);
_edje_emit(rp->edje, "entry,changed", rp->part->name);
_edje_emit(rp->edje, "cursor,changed", rp->part->name);
-
+
#ifdef HAVE_ECORE_IMF
if (en->imf_context)
{
evas_textblock_cursor_pos_get(en->cursor));
}
#endif
-
+
_edje_entry_real_part_configure(rp);
}
evas_textblock_cursor_pos_get(en->cursor));
}
#endif
-
+
_edje_entry_real_part_configure(rp);
}
evas_textblock_cursor_pos_get(en->cursor));
}
#endif
-
+
_edje_entry_real_part_configure(rp);
}
Entry *en = rp->entry_data;
Eina_List *l;
Anchor *an;
-
+
if (!en) return NULL;
EINA_LIST_FOREACH(en->anchors, l, an)
{
if (an->item) continue;
- if (!strcmp(anchor, an->name))
- return an->sel;
+ if (!strcmp(anchor, an->name))
+ return an->sel;
}
return NULL;
}
if (!en->anchorlist)
{
EINA_LIST_FOREACH(en->anchors, l, an)
- {
- const char *n = an->name;
+ {
+ const char *n = an->name;
if (an->item) continue;
- if (!n) n = "";
- anchors = eina_list_append(anchors, strdup(n));
- }
- en->anchorlist = anchors;
+ if (!n) n = "";
+ anchors = eina_list_append(anchors, strdup(n));
+ }
+ en->anchorlist = anchors;
}
return en->anchorlist;
}
Entry *en = rp->entry_data;
Eina_List *l;
Anchor *an;
-
+
if (!en) return EINA_FALSE;
EINA_LIST_FOREACH(en->anchors, l, an)
{
if (an->item) continue;
- if (!strcmp(item, an->name))
+ if (!strcmp(item, an->name))
{
evas_textblock_cursor_format_item_geometry_get(an->start, cx, cy, cw, ch);
return EINA_TRUE;
if (!en->itemlist)
{
EINA_LIST_FOREACH(en->anchors, l, an)
- {
- const char *n = an->name;
+ {
+ const char *n = an->name;
if (an->item) continue;
- if (!n) n = "";
- items = eina_list_append(items, strdup(n));
- }
- en->itemlist = items;
+ if (!n) n = "";
+ items = eina_list_append(items, strdup(n));
+ }
+ en->itemlist = items;
}
return en->itemlist;
}
{
Entry *en = rp->entry_data;
if (rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_DEFAULT)
- return;
+ return;
en->select_allow = allow;
}
Eina_Bool
_edje_entry_select_allow_get(const Edje_Real_Part *rp)
{
- const Entry *en = rp->entry_data;
- return en->select_allow;
+ const Entry *en = rp->entry_data;
+ return en->select_allow;
}
void
evas_textblock_cursor_pos_get(en->cursor));
}
#endif
-
+
_edje_entry_real_part_configure(rp);
}
}
switch (cur)
{
- case EDJE_CURSOR_MAIN:
- return en->cursor;
- case EDJE_CURSOR_SELECTION_BEGIN:
- return en->sel_start;
- case EDJE_CURSOR_SELECTION_END:
- return en->sel_end;
- case EDJE_CURSOR_PREEDIT_START:
- if (!en->preedit_start)
- en->preedit_start = evas_object_textblock_cursor_new(rp->object);
- return en->preedit_start;
- case EDJE_CURSOR_PREEDIT_END:
- if (!en->preedit_end)
- en->preedit_end = evas_object_textblock_cursor_new(rp->object);
- return en->preedit_end;
- case EDJE_CURSOR_USER:
- if (!en->cursor_user)
- en->cursor_user = evas_object_textblock_cursor_new(rp->object);
- return en->cursor_user;
- case EDJE_CURSOR_USER_EXTRA:
- if (!en->cursor_user_extra)
- en->cursor_user_extra = evas_object_textblock_cursor_new(rp->object);
- return en->cursor_user_extra;
- default:
- break;
+ case EDJE_CURSOR_MAIN:
+ return en->cursor;
+ case EDJE_CURSOR_SELECTION_BEGIN:
+ return en->sel_start;
+ case EDJE_CURSOR_SELECTION_END:
+ return en->sel_end;
+ case EDJE_CURSOR_PREEDIT_START:
+ if (!en->preedit_start)
+ en->preedit_start = evas_object_textblock_cursor_new(rp->object);
+ return en->preedit_start;
+ case EDJE_CURSOR_PREEDIT_END:
+ if (!en->preedit_end)
+ en->preedit_end = evas_object_textblock_cursor_new(rp->object);
+ return en->preedit_end;
+ case EDJE_CURSOR_USER:
+ if (!en->cursor_user)
+ en->cursor_user = evas_object_textblock_cursor_new(rp->object);
+ return en->cursor_user;
+ case EDJE_CURSOR_USER_EXTRA:
+ if (!en->cursor_user_extra)
+ en->cursor_user_extra = evas_object_textblock_cursor_new(rp->object);
+ return en->cursor_user_extra;
+ default:
+ break;
}
return NULL;
}
evas_textblock_cursor_pos_get(en->cursor));
}
#endif
-
+
_edje_emit(rp->edje, "cursor,changed", rp->part->name);
_edje_entry_real_part_configure(rp);
return EINA_TRUE;
if (!c) return EINA_FALSE;
if (!evas_textblock_cursor_char_prev(c))
{
- if (evas_textblock_cursor_paragraph_prev(c)) goto ok;
+ if (evas_textblock_cursor_paragraph_prev(c)) goto ok;
else return EINA_FALSE;
}
- ok:
+ok:
_curs_update_from_curs(c, rp->object, rp->entry_data);
_sel_update(c, rp->object, rp->entry_data);
evas_textblock_cursor_pos_get(en->cursor));
}
#endif
-
+
_edje_emit(rp->edje, "cursor,changed", rp->part->name);
_edje_entry_real_part_configure(rp);
return EINA_TRUE;
if (ln < 0) return EINA_FALSE;
if (!evas_object_textblock_line_number_geometry_get(rp->object, ln,
&lx, &ly, &lw, &lh))
- return EINA_FALSE;
+ return EINA_FALSE;
evas_textblock_cursor_char_geometry_get(c, &cx, &cy, &cw, &ch);
if (!evas_textblock_cursor_char_coord_set(c, cx, ly + (lh / 2)))
{
if (cx < (lx +(lw / 2)))
- evas_textblock_cursor_line_char_last(c);
+ evas_textblock_cursor_line_char_last(c);
else
- evas_textblock_cursor_line_char_last(c);
+ evas_textblock_cursor_line_char_last(c);
}
_curs_update_from_curs(c, rp->object, rp->entry_data);
_sel_update(c, rp->object, rp->entry_data);
#ifdef HAVE_ECORE_IMF
if (en->imf_context)
{
- ecore_imf_context_reset(en->imf_context);
- ecore_imf_context_cursor_position_set(en->imf_context,
+ ecore_imf_context_reset(en->imf_context);
+ ecore_imf_context_cursor_position_set(en->imf_context,
evas_textblock_cursor_pos_get(en->cursor));
}
#endif
-
+
_edje_emit(rp->edje, "cursor,changed", rp->part->name);
_edje_entry_real_part_configure(rp);
return EINA_TRUE;
ln++;
if (!evas_object_textblock_line_number_geometry_get(rp->object, ln,
&lx, &ly, &lw, &lh))
- return EINA_FALSE;
+ return EINA_FALSE;
evas_textblock_cursor_char_geometry_get(c, &cx, &cy, &cw, &ch);
if (!evas_textblock_cursor_char_coord_set(c, cx, ly + (lh / 2)))
{
if (cx < (lx +(lw / 2)))
- evas_textblock_cursor_line_char_last(c);
+ evas_textblock_cursor_line_char_last(c);
else
- evas_textblock_cursor_line_char_last(c);
+ evas_textblock_cursor_line_char_last(c);
}
_curs_update_from_curs(c, rp->object, rp->entry_data);
_sel_update(c, rp->object, rp->entry_data);
evas_textblock_cursor_pos_get(en->cursor));
}
#endif
-
+
_edje_emit(rp->edje, "cursor,changed", rp->part->name);
_edje_entry_real_part_configure(rp);
return EINA_TRUE;
evas_textblock_cursor_pos_get(en->cursor));
}
#endif
-
+
_edje_emit(rp->edje, "cursor,changed", rp->part->name);
_edje_entry_real_part_configure(rp);
}
evas_textblock_cursor_pos_get(en->cursor));
}
#endif
-
+
_edje_emit(rp->edje, "cursor,changed", rp->part->name);
_edje_entry_real_part_configure(rp);
}
evas_textblock_cursor_pos_get(en->cursor));
}
#endif
-
+
_edje_emit(rp->edje, "cursor,changed", rp->part->name);
_edje_entry_real_part_configure(rp);
}
evas_textblock_cursor_pos_get(en->cursor));
}
#endif
-
+
_edje_emit(rp->edje, "cursor,changed", rp->part->name);
_edje_entry_real_part_configure(rp);
}
evas_textblock_cursor_pos_get(en->cursor));
}
#endif
-
+
_edje_emit(rp->edje, "cursor,changed", rp->part->name);
_edje_entry_real_part_configure(rp);
}
Edje_Real_Part *rp = data;
Entry *en;
const char *str;
-
+
if (!rp) return 0;
en = rp->entry_data;
if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) ||
(rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_SELECTABLE))
- return 0;
-
+ return 0;
+
if (text)
{
str = _edje_entry_text_get(rp);
*text = str ? strdup(str) : strdup("");
}
-
+
if (cursor_pos)
{
*cursor_pos = evas_textblock_cursor_pos_get(en->cursor);
}
-
+
return 1;
}
en = rp->entry_data;
if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) ||
(rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_SELECTABLE))
- return ECORE_CALLBACK_PASS_ON;
+ return ECORE_CALLBACK_PASS_ON;
if (en->imf_context != ev->ctx) return ECORE_CALLBACK_PASS_ON;
if (en->have_composition)
{
- for (i = 0; i < en->comp_len; i++)
- _backspace(en->cursor, rp->object, en);
- _sel_clear(en->cursor, rp->object, en);
- en->have_composition = EINA_FALSE;
+ for (i = 0; i < en->comp_len; i++)
+ _backspace(en->cursor, rp->object, en);
+ _sel_clear(en->cursor, rp->object, en);
+ en->have_composition = EINA_FALSE;
}
//yy
en = rp->entry_data;
if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) ||
(rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_SELECTABLE))
- return ECORE_CALLBACK_PASS_ON;
+ return ECORE_CALLBACK_PASS_ON;
if (!en->imf_context) return ECORE_CALLBACK_PASS_ON;
// FIXME : check the maximum length of evas_textblock
if ( 0 /* check the maximum length of evas_textblock */ )
- return ECORE_CALLBACK_PASS_ON;
+ return ECORE_CALLBACK_PASS_ON;
if (en->have_selection)
{
if (en->have_composition)
{
- // delete the composing characters
- for (i = 0;i < en->comp_len; i++)
- _backspace(en->cursor, rp->object, en);
+ // delete the composing characters
+ for (i = 0;i < en->comp_len; i++)
+ _backspace(en->cursor, rp->object, en);
}
en->comp_len = length;
en = rp->entry_data;
if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) ||
(rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_SELECTABLE))
- return ECORE_CALLBACK_PASS_ON;
+ return ECORE_CALLBACK_PASS_ON;
if (en->imf_context != ev->ctx) return ECORE_CALLBACK_PASS_ON;