free(sel);
an->sel = eina_list_remove_list(an->sel, an->sel);
}
- if (range)
+ Evas_Textblock_Rectangle *r, *r_last;
+
+ r = range->data;
+ r_last = eina_list_last_data_get(range);
+ if (r->y != r_last->y)
+ {
+ /* For multiple range */
+ r->h = r->y + r_last->y + r_last->h;
+ }
+ /* For vertically layout entry */
+ /******************************************************************************************
+ * TIZEN_ONLY(20161207): force update anchors when a API is called to get list of anchors *
+ ******************************************************************************************
+ if (_is_anchors_outside_viewport(y, r->y, r->h, vy, tvh))
+ */
+ if (!force_update && _is_anchors_outside_viewport(y, r->y, r->h, vy, tvh))
+ /*******
+ * END *
+ *******/
+ {
+ EINA_LIST_FREE(range, r)
+ free(r);
+ continue;
+ }
+ else
{
- Evas_Textblock_Rectangle *r, *r_last;
+ /* XXX: Should consider for horizontal entry but has
+ * very minimal usage. Probably we should get the min x
+ * and max w for range and then decide whether it is in
+ * the viewport or not. Unnecessary calculation for this
+ * minimal usage. Please test with large number of anchors
+ * after implementing it, if its needed to be.
+ */
+ }
+ for (ll = range; ll; ll = eina_list_next(ll))
+ {
+ Evas_Object *ob;
- r = range->data;
- r_last = eina_list_last_data_get(range);
- if (r->y != r_last->y)
+ sel = calloc(1, sizeof(Sel));
+ if (!sel)
{
- /* For multiple range */
- r->h = r->y + r_last->y + r_last->h;
+ ERR("Running very low on memory");
+ break;
}
- /* For vertically layout entry */
- /******************************************************************************************
- * TIZEN_ONLY(20161207): force update anchors when a API is called to get list of anchors *
- ******************************************************************************************
- if (_is_anchors_outside_viewport(y, r->y, r->h, vy, tvh))
- */
- if (!force_update && _is_anchors_outside_viewport(y, r->y, r->h, vy, tvh))
- /*******
- * END *
- *******/
+ an->sel = eina_list_append(an->sel, sel);
+ if (en->rp->part->source5)
{
- EINA_LIST_FREE(range, r)
- free(r);
- continue;
+ ob = edje_object_add(ed->base.evas);
+ edje_object_file_set(ob, ed->path, en->rp->part->source5);
+ 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);
+ sel->obj_bg = ob;
+ _edje_subobj_register(ed, sel->obj_bg);
+ /***********************************************************************************
+ * TIZEN_ONLY_FEATURE: apply Tizen's color_class features. *
+ ***********************************************************************************/
+ edje_object_color_class_parent_set(sel->obj_bg, ed->obj);
+ /*******
+ * END *
+ *******/
}
- else
- {
- Evas_Textblock_Rectangle *r, *r_last;
- r = range->data;
- r_last = eina_list_last_data_get(range);
- if (r->y != r_last->y)
- {
- /* For multiple range */
- r->h = r->y + r_last->y + r_last->h;
- }
- /* For vertically layout entry */
- if (_is_anchors_outside_viewport(y, r->y, r->h, vy, tvh))
- {
- ob = edje_object_add(ed->base.evas);
- edje_object_file_set(ob, ed->path, en->rp->part->source5);
- 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);
- sel->obj_bg = ob;
- _edje_subobj_register(ed, sel->obj_bg);
- /***********************************************************************************
- * TIZEN_ONLY_FEATURE: apply Tizen's color_class features. *
- ***********************************************************************************/
- edje_object_color_class_parent_set(sel->obj_bg, ed->obj);
- /*******
- * END *
- *******/
- }
- else
- {
- /* XXX: Should consider for horizontal entry but has
- * very minimal usage. Probably we should get the min x
- * and max w for range and then decide whether it is in
- * the viewport or not. Unnecessary calculation for this
- * minimal usage. Please test with large number of anchors
- * after implementing it, if its needed to be.
- */
- }
- for (ll = range; ll; ll = eina_list_next(ll))
- {
- Evas_Object *ob;
-
- sel = calloc(1, sizeof(Sel));
- if (!sel)
- {
- ERR("Running very low on memory");
- break;
- }
- an->sel = eina_list_append(an->sel, sel);
- if (en->rp->part->source5)
- {
- ob = edje_object_add(ed->base.evas);
- edje_object_file_set(ob, ed->path, en->rp->part->source5);
- 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);
- sel->obj_bg = ob;
- _edje_subobj_register(ed, sel->obj_bg);
- }
-
- if (en->rp->part->source6)
- {
- ob = edje_object_add(ed->base.evas);
- edje_object_file_set(ob, ed->path, en->rp->part->source6);
- 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);
- sel->obj_fg = ob;
- _edje_subobj_register(ed, sel->obj_fg);
- }
-
- ob = evas_object_rectangle_add(ed->base.evas);
- evas_object_color_set(ob, 0, 0, 0, 0);
- 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);
- sel->obj_fg = ob;
- _edje_subobj_register(ed, sel->obj_fg);
- /***********************************************************************************
- * TIZEN_ONLY_FEATURE: apply Tizen's color_class features. *
- ***********************************************************************************/
- edje_object_color_class_parent_set(sel->obj_fg, ed->obj);
- /*******
- * END *
- *******/
- }
+ if (en->rp->part->source6)
+ {
+ ob = edje_object_add(ed->base.evas);
+ edje_object_file_set(ob, ed->path, en->rp->part->source6);
+ 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);
+ sel->obj_fg = ob;
+ _edje_subobj_register(ed, sel->obj_fg);
+ /***********************************************************************************
+ * TIZEN_ONLY_FEATURE: apply Tizen's color_class features. *
+ ***********************************************************************************/
+ edje_object_color_class_parent_set(sel->obj_fg, ed->obj);
+ /*******
+ * END *
+ *******/
}
+
+ ob = evas_object_rectangle_add(ed->base.evas);
+ evas_object_color_set(ob, 0, 0, 0, 0);
+ 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, 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);
+ evas_object_event_callback_add(ob, EVAS_CALLBACK_MOUSE_IN, _edje_anchor_mouse_in_cb, an);
+ evas_object_event_callback_add(ob, EVAS_CALLBACK_MOUSE_OUT, _edje_anchor_mouse_out_cb, an);
+ sel->obj = ob;
}
}