forked from enlightenment/efl
[Edje_Entry] Add selection handlers to entry
Add selection handlers to entry. https://phab.enlightenment.org/D117 Conflicts: ChangeLog NEWS
This commit is contained in:
parent
97806103eb
commit
c38a2a6bb8
|
@ -1,3 +1,7 @@
|
|||
2013-05-13 Thiep Ha
|
||||
|
||||
* Edje: Added selection handlers to entry.
|
||||
|
||||
2013-05-11 Jiyou Park
|
||||
|
||||
* Evas: Fix crash if app use native surface in wrong engine.
|
||||
|
|
1
NEWS
1
NEWS
|
@ -85,6 +85,7 @@ Additions:
|
|||
- textblock: Added support for size_range.
|
||||
- table: Added spread.{w,h} to repeat and automatically name an item in a TABLE part.
|
||||
- add embryo fill support for proxy parts
|
||||
- entry: Added selection handlers.
|
||||
* Ecore_x: Add atom related with indicator type.
|
||||
* Ecore_x: Add manual render code before deiconify
|
||||
* Eeze: Add a dummy libmount replacement for when libmount is not there.
|
||||
|
|
|
@ -224,6 +224,8 @@ static void st_collections_group_parts_part_source3(void);
|
|||
static void st_collections_group_parts_part_source4(void);
|
||||
static void st_collections_group_parts_part_source5(void);
|
||||
static void st_collections_group_parts_part_source6(void);
|
||||
static void st_collections_group_parts_part_source7(void);
|
||||
static void st_collections_group_parts_part_source8(void);
|
||||
static void st_collections_group_parts_part_entry_mode(void);
|
||||
static void st_collections_group_parts_part_select_mode(void);
|
||||
static void st_collections_group_parts_part_cursor_mode(void);
|
||||
|
@ -501,6 +503,8 @@ New_Statement_Handler statement_handlers[] =
|
|||
{"collections.group.parts.part.source4", st_collections_group_parts_part_source4},
|
||||
{"collections.group.parts.part.source5", st_collections_group_parts_part_source5},
|
||||
{"collections.group.parts.part.source6", st_collections_group_parts_part_source6},
|
||||
{"collections.group.parts.part.source7", st_collections_group_parts_part_source7},
|
||||
{"collections.group.parts.part.source8", st_collections_group_parts_part_source8},
|
||||
{"collections.group.parts.part.dragable.x", st_collections_group_parts_part_dragable_x},
|
||||
{"collections.group.parts.part.dragable.y", st_collections_group_parts_part_dragable_y},
|
||||
{"collections.group.parts.part.dragable.confine", st_collections_group_parts_part_dragable_confine},
|
||||
|
@ -2656,6 +2660,8 @@ st_collections_group_inherit(void)
|
|||
ep->source4 = STRDUP(ep2->source4);
|
||||
ep->source5 = STRDUP(ep2->source5);
|
||||
ep->source6 = STRDUP(ep2->source6);
|
||||
ep->source7 = STRDUP(ep2->source7);
|
||||
ep->source8 = STRDUP(ep2->source8);
|
||||
|
||||
data_queue_copied_part_lookup(pc, &(ep2->clip_to_id), &(ep->clip_to_id));
|
||||
|
||||
|
@ -3938,6 +3944,48 @@ st_collections_group_parts_part_source6(void)
|
|||
data_queue_group_lookup(current_part->source6, current_part);
|
||||
}
|
||||
|
||||
/**
|
||||
@page edcref
|
||||
@property
|
||||
source7
|
||||
@parameters
|
||||
[another group's name]
|
||||
@effect
|
||||
Only available to TEXTBLOCK parts. It is used for the group to be
|
||||
loaded and used for the start selection handler display.
|
||||
@endproperty
|
||||
*/
|
||||
static void
|
||||
st_collections_group_parts_part_source7(void)
|
||||
{
|
||||
check_arg_count(1);
|
||||
|
||||
//FIXME: validate this somehow (need to decide on the format also)
|
||||
current_part->source7 = parse_str(0);
|
||||
data_queue_group_lookup(current_part->source7, current_part);
|
||||
}
|
||||
|
||||
/**
|
||||
@page edcref
|
||||
@property
|
||||
source8
|
||||
@parameters
|
||||
[another group's name]
|
||||
@effect
|
||||
Only available to TEXTBLOCK parts. It is used for the group to be
|
||||
loaded and used for the end selection handler display.
|
||||
@endproperty
|
||||
*/
|
||||
static void
|
||||
st_collections_group_parts_part_source8(void)
|
||||
{
|
||||
check_arg_count(1);
|
||||
|
||||
//FIXME: validate this somehow (need to decide on the format also)
|
||||
current_part->source8 = parse_str(0);
|
||||
data_queue_group_lookup(current_part->source8, current_part);
|
||||
}
|
||||
|
||||
/**
|
||||
@page edcref
|
||||
|
||||
|
@ -4061,7 +4109,7 @@ st_collections_group_parts_part_select_mode(void)
|
|||
current_part->select_mode = parse_enum(0,
|
||||
"DEFAULT", EDJE_ENTRY_SELECTION_MODE_DEFAULT,
|
||||
"EXPLICIT", EDJE_ENTRY_SELECTION_MODE_EXPLICIT,
|
||||
"BLOCK_HANDLE", EDJE_ENTRY_SELECTION_MODE_DEFAULT,
|
||||
"BLOCK_HANDLE", EDJE_ENTRY_SELECTION_MODE_BLOCK_HANDLE,
|
||||
NULL);
|
||||
}
|
||||
|
||||
|
|
|
@ -336,6 +336,8 @@ _edje_collection_convert(Eet_File *ef, Edje_Part_Collection_Directory_Entry *ce,
|
|||
replacement->source4 = part->source4;
|
||||
replacement->source5 = part->source5;
|
||||
replacement->source6 = part->source6;
|
||||
replacement->source7 = part->source7;
|
||||
replacement->source8 = part->source8;
|
||||
replacement->id = part->id;
|
||||
replacement->clip_to_id = part->clip_to_id;
|
||||
replacement->dragable = part->dragable;
|
||||
|
|
|
@ -92,7 +92,7 @@ struct _Old_Edje_Part
|
|||
const char *name; /* the name if any of the part */
|
||||
Old_Edje_Part_Description *default_desc; /* the part descriptor for default */
|
||||
Eina_List *other_desc; /* other possible descriptors */
|
||||
const char *source, *source2, *source3, *source4, *source5, *source6;
|
||||
const char *source, *source2, *source3, *source4, *source5, *source6, *source7, *source8;
|
||||
int id; /* its id number */
|
||||
int clip_to_id; /* the part id to clip this one to */
|
||||
Edje_Part_Dragable dragable;
|
||||
|
|
|
@ -422,6 +422,8 @@ _edje_edd_old_init(void)
|
|||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "source4", source4, EET_T_STRING);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "source5", source5, EET_T_STRING);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "source6", source6, EET_T_STRING);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "source7", source7, EET_T_STRING);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "source8", source8, EET_T_STRING);
|
||||
EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_old_edje_part, Old_Edje_Part, "items", items, _edje_edd_old_edje_pack_element);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "api.name", api.name, EET_T_STRING);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "api.description", api.description, EET_T_STRING);
|
||||
|
|
|
@ -377,6 +377,8 @@ _edje_collection_convert(Edje_File *file, Old_Edje_Part_Collection *oedc)
|
|||
replacement->source4 = part->source4;
|
||||
replacement->source5 = part->source5;
|
||||
replacement->source6 = part->source6;
|
||||
replacement->source7 = part->source7;
|
||||
replacement->source8 = part->source8;
|
||||
replacement->id = part->id;
|
||||
replacement->clip_to_id = part->clip_to_id;
|
||||
replacement->dragable = part->dragable;
|
||||
|
|
|
@ -89,7 +89,7 @@ struct _Old_Edje_Part
|
|||
const char *name; /* the name if any of the part */
|
||||
Old_Edje_Part_Description *default_desc; /* the part descriptor for default */
|
||||
Eina_List *other_desc; /* other possible descriptors */
|
||||
const char *source, *source2, *source3, *source4, *source5, *source6;
|
||||
const char *source, *source2, *source3, *source4, *source5, *source6, *source7, *source8;
|
||||
int id; /* its id number */
|
||||
int clip_to_id; /* the part id to clip this one to */
|
||||
Edje_Part_Dragable dragable;
|
||||
|
|
|
@ -922,6 +922,8 @@ _edje_edd_init(void)
|
|||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "source4", source4, EET_T_STRING);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "source5", source5, EET_T_STRING);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "source6", source6, EET_T_STRING);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "source7", source7, EET_T_STRING);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "source8", source8, EET_T_STRING);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "id", id, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "clip_to_id", clip_to_id, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "dragable.x", dragable.x, EET_T_CHAR);
|
||||
|
|
|
@ -20,8 +20,10 @@ struct _Entry
|
|||
{
|
||||
Edje_Real_Part *rp;
|
||||
Edje *ed;
|
||||
Evas_Coord ox, oy;
|
||||
Evas_Object *cursor_bg;
|
||||
Evas_Object *cursor_fg, *cursor_fg2;
|
||||
Evas_Object *sel_handler_start, *sel_handler_end;
|
||||
Evas_Textblock_Cursor *cursor;
|
||||
Evas_Textblock_Cursor *sel_start, *sel_end;
|
||||
Evas_Textblock_Cursor *cursor_user, *cursor_user_extra;
|
||||
|
@ -551,6 +553,14 @@ _sel_extend(Edje *ed, Evas_Textblock_Cursor *c, Evas_Object *o, Entry *en)
|
|||
if (!en->sel_end) return;
|
||||
_sel_enable(ed, c, o, en);
|
||||
if (!evas_textblock_cursor_compare(c, en->sel_end)) return;
|
||||
|
||||
if (en->sel_handler_start && en->sel_handler_end)
|
||||
{
|
||||
/* Do NOT allow sel_handler_end pass sel_handler_start */
|
||||
if (evas_textblock_cursor_compare(c, en->sel_start) <= 0)
|
||||
evas_textblock_cursor_pos_set(c, evas_textblock_cursor_pos_get(en->sel_start) + 1);
|
||||
}
|
||||
|
||||
evas_textblock_cursor_copy(c, en->sel_end);
|
||||
|
||||
_edje_entry_imf_cursor_info_set(en);
|
||||
|
@ -569,6 +579,14 @@ _sel_preextend(Edje *ed, Evas_Textblock_Cursor *c, Evas_Object *o, Entry *en)
|
|||
if (!en->sel_end) return;
|
||||
_sel_enable(ed, c, o, en);
|
||||
if (!evas_textblock_cursor_compare(c, en->sel_start)) return;
|
||||
|
||||
if (en->sel_handler_start && en->sel_handler_end)
|
||||
{
|
||||
/* Do NOT allow sel_handler_start pass sel_handler_end */
|
||||
if (evas_textblock_cursor_compare(c, en->sel_end) >= 0)
|
||||
evas_textblock_cursor_pos_set(c, evas_textblock_cursor_pos_get(en->sel_end) - 1);
|
||||
}
|
||||
|
||||
evas_textblock_cursor_copy(c, en->sel_start);
|
||||
|
||||
_edje_entry_imf_cursor_info_set(en);
|
||||
|
@ -612,6 +630,10 @@ _sel_clear(Edje *ed, Evas_Textblock_Cursor *c EINA_UNUSED, Evas_Object *o EINA_U
|
|||
en->have_selection = EINA_FALSE;
|
||||
_edje_emit(ed, "selection,cleared", en->rp->part->name);
|
||||
}
|
||||
if (en->sel_handler_start)
|
||||
edje_object_signal_emit(en->sel_handler_start, "edje,handler,hide", "edje");
|
||||
if (en->sel_handler_end)
|
||||
edje_object_signal_emit(en->sel_handler_end, "edje,handler,hide", "edje");
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -672,11 +694,15 @@ _sel_update(Edje *ed, Evas_Textblock_Cursor *c EINA_UNUSED, Evas_Object *o, Entr
|
|||
evas_object_geometry_get(o, &x, &y, &w, &h);
|
||||
if (en->have_selection)
|
||||
{
|
||||
int lc, li = 0;
|
||||
lc = eina_list_count(en->sel);
|
||||
|
||||
EINA_LIST_FOREACH(en->sel, l, sel)
|
||||
{
|
||||
Evas_Textblock_Rectangle *r;
|
||||
|
||||
r = range->data;
|
||||
li++;
|
||||
if (sel->obj_bg)
|
||||
{
|
||||
evas_object_move(sel->obj_bg, x + r->x, y + r->y);
|
||||
|
@ -687,6 +713,19 @@ _sel_update(Edje *ed, Evas_Textblock_Cursor *c EINA_UNUSED, Evas_Object *o, Entr
|
|||
evas_object_move(sel->obj_fg, x + r->x, y + r->y);
|
||||
evas_object_resize(sel->obj_fg, r->w, r->h);
|
||||
}
|
||||
if (en->rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_BLOCK_HANDLE)
|
||||
{
|
||||
if (li == 1)
|
||||
{
|
||||
evas_object_move(en->sel_handler_start, x + r->x, y + r->y + r->h);
|
||||
edje_object_signal_emit(en->sel_handler_start, "edje,handler,show", "edje");
|
||||
}
|
||||
if (li == lc)
|
||||
{
|
||||
evas_object_move(en->sel_handler_end, x + r->x + r->w, y + r->y + r->h);
|
||||
edje_object_signal_emit(en->sel_handler_end, "edje,handler,show", "edje");
|
||||
}
|
||||
}
|
||||
*(&(sel->rect)) = *r;
|
||||
range = eina_list_remove_list(range, range);
|
||||
free(r);
|
||||
|
@ -702,6 +741,168 @@ _sel_update(Edje *ed, Evas_Textblock_Cursor *c EINA_UNUSED, Evas_Object *o, Entr
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_edje_start_handler_mouse_down_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
|
||||
{
|
||||
Evas_Event_Mouse_Down *ev = event_info;
|
||||
Edje_Real_Part *rp = data;
|
||||
Evas_Coord ex, ey;
|
||||
Evas_Coord cx, cy, cw, ch;
|
||||
Evas_Textblock_Cursor_Type cur_type;
|
||||
Entry *en;
|
||||
|
||||
if (ev->button != 1) return;
|
||||
if ((rp->type != EDJE_RP_TYPE_TEXT) ||
|
||||
(!rp->typedata.text)) return;
|
||||
en = rp->typedata.text->entry_data;
|
||||
|
||||
evas_object_geometry_get(rp->object, &ex, &ey, NULL, NULL);
|
||||
switch (rp->part->cursor_mode)
|
||||
{
|
||||
case EDJE_ENTRY_CURSOR_MODE_BEFORE:
|
||||
cur_type = EVAS_TEXTBLOCK_CURSOR_BEFORE;
|
||||
break;
|
||||
case EDJE_ENTRY_CURSOR_MODE_UNDER:
|
||||
/* no break for a reason */
|
||||
default:
|
||||
cur_type = EVAS_TEXTBLOCK_CURSOR_UNDER;
|
||||
}
|
||||
evas_textblock_cursor_geometry_get(en->sel_start, &cx, &cy, &cw, &ch, NULL, cur_type);
|
||||
en->ox = ev->canvas.x - (ex + cx + cw/2);
|
||||
en->oy = ev->canvas.y - (ey + cy + ch/2);
|
||||
|
||||
en->select_mod_start = EINA_TRUE;
|
||||
en->selecting = EINA_TRUE;
|
||||
|
||||
_edje_emit(en->ed, "handler,move,start", rp->part->name);
|
||||
}
|
||||
|
||||
static void
|
||||
_edje_start_handler_mouse_up_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
{
|
||||
Edje_Real_Part *rp = data;
|
||||
Entry *en;
|
||||
|
||||
if ((rp->type != EDJE_RP_TYPE_TEXT) ||
|
||||
(!rp->typedata.text)) return;
|
||||
en = rp->typedata.text->entry_data;
|
||||
|
||||
en->selecting = EINA_FALSE;
|
||||
en->select_mod_start = EINA_FALSE;
|
||||
|
||||
_edje_emit(en->ed, "handler,move,end", rp->part->name);
|
||||
}
|
||||
|
||||
static void
|
||||
_edje_start_handler_mouse_move_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
|
||||
{
|
||||
Evas_Event_Mouse_Move *ev = event_info;
|
||||
Edje_Real_Part *rp = data;
|
||||
Entry *en;
|
||||
Evas_Coord ex, ey;
|
||||
Evas_Coord cx, cy;
|
||||
|
||||
if (ev->buttons != 1) return;
|
||||
if ((rp->type != EDJE_RP_TYPE_TEXT) ||
|
||||
(!rp->typedata.text)) return;
|
||||
en = rp->typedata.text->entry_data;
|
||||
|
||||
evas_object_geometry_get(rp->object, &ex, &ey, NULL, NULL);
|
||||
cx = ev->cur.canvas.x - en->ox - ex;
|
||||
cy = ev->cur.canvas.y - en->oy - ey;
|
||||
if (cx <= 0) cx = 1;
|
||||
evas_textblock_cursor_char_coord_set(en->cursor, cx, cy);
|
||||
|
||||
if (en->select_allow)
|
||||
{
|
||||
if (en->select_mod_start)
|
||||
_sel_preextend(en->ed, en->cursor, rp->object, en);
|
||||
}
|
||||
_edje_entry_real_part_configure(en->ed, rp);
|
||||
_edje_emit(en->ed, "handler,moving", rp->part->name);
|
||||
}
|
||||
|
||||
static void
|
||||
_edje_end_handler_mouse_down_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
|
||||
{
|
||||
Evas_Event_Mouse_Down *ev = event_info;
|
||||
Edje_Real_Part *rp = data;
|
||||
Entry *en;
|
||||
Evas_Coord ex, ey;
|
||||
Evas_Coord cx, cy, cw, ch;
|
||||
Evas_Textblock_Cursor_Type cur_type;
|
||||
|
||||
if (ev->button != 1) return;
|
||||
if ((rp->type != EDJE_RP_TYPE_TEXT) ||
|
||||
(!rp->typedata.text)) return;
|
||||
en = rp->typedata.text->entry_data;
|
||||
|
||||
evas_object_geometry_get(rp->object, &ex, &ey, NULL, NULL);
|
||||
switch (rp->part->cursor_mode)
|
||||
{
|
||||
case EDJE_ENTRY_CURSOR_MODE_BEFORE:
|
||||
cur_type = EVAS_TEXTBLOCK_CURSOR_BEFORE;
|
||||
break;
|
||||
case EDJE_ENTRY_CURSOR_MODE_UNDER:
|
||||
/* no break for a reason */
|
||||
default:
|
||||
cur_type = EVAS_TEXTBLOCK_CURSOR_UNDER;
|
||||
}
|
||||
evas_textblock_cursor_geometry_get(en->sel_end, &cx, &cy, &cw, &ch, NULL, cur_type);
|
||||
en->ox = ev->canvas.x - (ex + cx + cw/2);
|
||||
en->oy = ev->canvas.y - (ey + cy + ch/2);
|
||||
|
||||
en->select_mod_end = EINA_TRUE;
|
||||
en->selecting = EINA_TRUE;
|
||||
|
||||
_edje_emit(en->ed, "handler,move,end", rp->part->name);
|
||||
}
|
||||
|
||||
static void
|
||||
_edje_end_handler_mouse_up_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
{
|
||||
Edje_Real_Part *rp = data;
|
||||
Entry *en;
|
||||
|
||||
if ((rp->type != EDJE_RP_TYPE_TEXT) ||
|
||||
(!rp->typedata.text)) return;
|
||||
en = rp->typedata.text->entry_data;
|
||||
|
||||
en->selecting = EINA_FALSE;
|
||||
en->select_mod_end = EINA_FALSE;
|
||||
|
||||
_edje_emit(en->ed, "handler,move,end", rp->part->name);
|
||||
}
|
||||
|
||||
static void
|
||||
_edje_end_handler_mouse_move_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
|
||||
{
|
||||
Evas_Event_Mouse_Move *ev = event_info;
|
||||
Edje_Real_Part *rp = data;
|
||||
Entry *en;
|
||||
Evas_Coord ex, ey;
|
||||
Evas_Coord cx, cy;
|
||||
|
||||
if (ev->buttons != 1) return;
|
||||
if ((rp->type != EDJE_RP_TYPE_TEXT) ||
|
||||
(!rp->typedata.text)) return;
|
||||
en = rp->typedata.text->entry_data;
|
||||
|
||||
evas_object_geometry_get(rp->object, &ex, &ey, NULL, NULL);
|
||||
cx = ev->cur.canvas.x - en->ox - ex;
|
||||
cy = ev->cur.canvas.y - en->oy - ey;
|
||||
if (cx <= 0) cx = 1;
|
||||
evas_textblock_cursor_char_coord_set(en->cursor, cx, cy);
|
||||
|
||||
if (en->select_allow)
|
||||
{
|
||||
if (en->select_mod_end)
|
||||
_sel_extend(en->ed, en->cursor, rp->object, en);
|
||||
}
|
||||
_edje_entry_real_part_configure(en->ed, rp);
|
||||
_edje_emit(en->ed, "handler,moving", rp->part->name);
|
||||
}
|
||||
|
||||
static void
|
||||
_edje_anchor_mouse_down_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
|
||||
{
|
||||
|
@ -1908,7 +2109,8 @@ _edje_part_mouse_down_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_
|
|||
en->select_mod_end = EINA_FALSE;
|
||||
if (rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_DEFAULT)
|
||||
dosel = EINA_TRUE;
|
||||
else if (rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_EXPLICIT)
|
||||
else if ((rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_EXPLICIT) ||
|
||||
(rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_BLOCK_HANDLE))
|
||||
{
|
||||
if (en->select_allow) dosel = EINA_TRUE;
|
||||
}
|
||||
|
@ -2020,7 +2222,8 @@ _edje_part_mouse_down_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_
|
|||
if (dosel)
|
||||
{
|
||||
if ((en->have_selection) &&
|
||||
(rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_EXPLICIT))
|
||||
((rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_EXPLICIT) ||
|
||||
(rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_BLOCK_HANDLE)))
|
||||
{
|
||||
if (shift)
|
||||
_sel_extend(en->ed, en->cursor, rp->object, en);
|
||||
|
@ -2179,7 +2382,8 @@ _edje_part_mouse_up_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UN
|
|||
}
|
||||
}
|
||||
}
|
||||
if (rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_EXPLICIT)
|
||||
if ((rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_EXPLICIT) ||
|
||||
(rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_BLOCK_HANDLE))
|
||||
{
|
||||
if (en->select_allow)
|
||||
{
|
||||
|
@ -2278,7 +2482,8 @@ _edje_part_mouse_move_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_
|
|||
_curs_lin_end(en->cursor, rp->object, en);
|
||||
}
|
||||
}
|
||||
if (rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_EXPLICIT)
|
||||
if ((rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_EXPLICIT) ||
|
||||
(rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_BLOCK_HANDLE))
|
||||
{
|
||||
if (en->select_allow)
|
||||
{
|
||||
|
@ -2431,6 +2636,36 @@ _edje_entry_real_part_init(Edje *ed, Edje_Real_Part *rp)
|
|||
evas_object_pass_events_set(en->cursor_fg, EINA_TRUE);
|
||||
_edje_subobj_register(ed, en->cursor_fg);
|
||||
|
||||
if (rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_BLOCK_HANDLE)
|
||||
{
|
||||
if (rp->part->source7)
|
||||
{
|
||||
en->sel_handler_start = edje_object_add(ed->base->evas);
|
||||
edje_object_file_set(en->sel_handler_start, ed->path, rp->part->source7);
|
||||
evas_object_show(en->sel_handler_start);
|
||||
_edje_subobj_register(ed, en->sel_handler_start);
|
||||
evas_object_event_callback_add(en->sel_handler_start, EVAS_CALLBACK_MOUSE_DOWN,
|
||||
_edje_start_handler_mouse_down_cb, rp);
|
||||
evas_object_event_callback_add(en->sel_handler_start, EVAS_CALLBACK_MOUSE_UP,
|
||||
_edje_start_handler_mouse_up_cb, rp);
|
||||
evas_object_event_callback_add(en->sel_handler_start, EVAS_CALLBACK_MOUSE_MOVE,
|
||||
_edje_start_handler_mouse_move_cb, rp);
|
||||
}
|
||||
if (rp->part->source8)
|
||||
{
|
||||
en->sel_handler_end = edje_object_add(ed->base->evas);
|
||||
edje_object_file_set(en->sel_handler_end, ed->path, rp->part->source8);
|
||||
evas_object_show(en->sel_handler_end);
|
||||
_edje_subobj_register(ed, en->sel_handler_end);
|
||||
evas_object_event_callback_add(en->sel_handler_end, EVAS_CALLBACK_MOUSE_DOWN,
|
||||
_edje_end_handler_mouse_down_cb, rp);
|
||||
evas_object_event_callback_add(en->sel_handler_end, EVAS_CALLBACK_MOUSE_UP,
|
||||
_edje_end_handler_mouse_up_cb, rp);
|
||||
evas_object_event_callback_add(en->sel_handler_end, EVAS_CALLBACK_MOUSE_MOVE,
|
||||
_edje_end_handler_mouse_move_cb, rp);
|
||||
}
|
||||
}
|
||||
|
||||
/* A proxy to the main cursor. */
|
||||
if (rp->part->cursor_mode == EDJE_ENTRY_CURSOR_MODE_BEFORE)
|
||||
{
|
||||
|
@ -2527,6 +2762,16 @@ _edje_entry_real_part_shutdown(Edje *ed, Edje_Real_Part *rp)
|
|||
evas_object_del(en->cursor_bg);
|
||||
evas_object_del(en->cursor_fg);
|
||||
evas_object_del(en->cursor_fg2);
|
||||
if (en->sel_handler_start)
|
||||
{
|
||||
evas_object_del(en->sel_handler_start);
|
||||
en->sel_handler_start = NULL;
|
||||
}
|
||||
if (en->sel_handler_end)
|
||||
{
|
||||
evas_object_del(en->sel_handler_end);
|
||||
en->sel_handler_end = NULL;
|
||||
}
|
||||
|
||||
if (en->pw_timer)
|
||||
{
|
||||
|
|
|
@ -419,6 +419,7 @@ typedef struct _Edje_Signal_Callback_Custom Edje_Signal_Callback_Custom;
|
|||
|
||||
#define EDJE_ENTRY_SELECTION_MODE_DEFAULT 0
|
||||
#define EDJE_ENTRY_SELECTION_MODE_EXPLICIT 1
|
||||
#define EDJE_ENTRY_SELECTION_MODE_BLOCK_HANDLE 2
|
||||
|
||||
#define EDJE_ENTRY_CURSOR_MODE_UNDER 0
|
||||
#define EDJE_ENTRY_CURSOR_MODE_BEFORE 1
|
||||
|
@ -958,7 +959,7 @@ struct _Edje_Part
|
|||
|
||||
Edje_Part_Description_List other; /* other possible descriptors */
|
||||
|
||||
const char *source, *source2, *source3, *source4, *source5, *source6;
|
||||
const char *source, *source2, *source3, *source4, *source5, *source6, *source7, *source8;
|
||||
int id; /* its id number */
|
||||
int clip_to_id; /* the part id to clip this one to */
|
||||
Edje_Part_Dragable dragable;
|
||||
|
|
Loading…
Reference in New Issue