diff options
author | Tom Hacohen <tom@stosb.com> | 2016-06-13 08:40:38 +0100 |
---|---|---|
committer | Tom Hacohen <tom@stosb.com> | 2016-06-13 08:40:38 +0100 |
commit | db0d4b1e53b61eb553b4e36c6c084d68cca9f6dc (patch) | |
tree | ab229339874883f6c64873f2d85ee68a42ec831a | |
parent | a88e93196c0259bbbed021407b578a961dec1d60 (diff) | |
download | efl-db0d4b1e53b61eb553b4e36c6c084d68cca9f6dc.tar.gz |
Ui text interactive: Remove unused code.
-rw-r--r-- | src/lib/elementary/efl_ui_internal_text_interactive.c | 80 |
1 files changed, 5 insertions, 75 deletions
diff --git a/src/lib/elementary/efl_ui_internal_text_interactive.c b/src/lib/elementary/efl_ui_internal_text_interactive.c index a319eafcd4..24310acbba 100644 --- a/src/lib/elementary/efl_ui_internal_text_interactive.c +++ b/src/lib/elementary/efl_ui_internal_text_interactive.c @@ -15,7 +15,6 @@ typedef struct _Efl_Ui_Internal_Text_Interactive_Data { Evas_Textblock_Cursor *sel_start, *sel_end; Evas_Textblock_Cursor *preedit_start, *preedit_end; - Eina_List *sel; Eina_List *seq; char *selection; Eina_Bool multiline : 1; @@ -37,12 +36,6 @@ typedef struct _Efl_Ui_Internal_Text_Interactive_Data #endif } Efl_Ui_Internal_Text_Interactive_Data; -typedef struct _Sel -{ - Evas_Textblock_Rectangle rect; - Evas_Object *obj_fg, *obj_bg, *obj, *sobj; -} Sel; - static void _range_del_emit(Evas_Textblock_Cursor *cur, Evas_Object *obj, Efl_Ui_Internal_Text_Interactive_Data *en); static void _sel_start(Evas_Textblock_Cursor *c, Evas_Object *o, Efl_Ui_Internal_Text_Interactive_Data *en); static void _sel_enable(Evas_Textblock_Cursor *c EINA_UNUSED, Evas_Object *o EINA_UNUSED, Efl_Ui_Internal_Text_Interactive_Data *en); @@ -622,16 +615,6 @@ _sel_clear(Evas_Textblock_Cursor *c EINA_UNUSED, Evas_Object *o, Efl_Ui_Internal free(en->selection); en->selection = NULL; } - while (en->sel) - { - Sel *sel; - - sel = en->sel->data; - 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; @@ -1217,68 +1200,15 @@ _mouse_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj EIN if (dosel) { - if ((en->have_selection) && - 1) // (rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_EXPLICIT)) + if ((en->have_selection) && (shift)) { - if (shift) - _sel_extend(cur, obj, en); - else - { - Eina_List *first, *last; - double sc = 1.0; - - 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 - cx; - d1 = d * d; - d = (r1->y + (r1->h / 2)) - cy; - d1 += d * d; - d = r2->x + r2->w - 1 - cx; - d2 = d * d; - d = (r2->y + (r2->h / 2)) - cy; - d2 += d * d; -#if 0 - sc = en->ed->scale / en->ed->file->base_scale; - if (EINA_DOUBLE_EQUAL(sc, 0)) sc = _scale / en->ed->file->base_scale; -#endif - d = (Evas_Coord) 20 * sc; // FIXME: maxing number! - d = d * d; - if (d1 < d2) - { - if (d1 <= d) - { - en->select_mod_start = EINA_TRUE; - en->selecting = EINA_TRUE; - } - } - else - { - if (d2 <= d) - { - en->select_mod_end = EINA_TRUE; - en->selecting = EINA_TRUE; - } - } - } - } + _sel_extend(cur, obj, en); } else { - if ((en->have_selection) && (shift)) - _sel_extend(cur, obj, en); - else - { - en->selecting = EINA_TRUE; - _sel_clear(cur, obj, en); - _sel_start(cur, obj, en); - } + en->selecting = EINA_TRUE; + _sel_clear(cur, obj, en); + _sel_start(cur, obj, en); } } |