Ecore_Job *deferred_recalc_job;
Ecore_Event_Handler *sel_notify_handler;
Ecore_Event_Handler *sel_clear_handler;
- Ecore_Timer *longpress_timer;
Ecore_Timer *delay_write;
/* for deferred appending */
Ecore_Idler *append_text_idler;
wd->append_text_idler = NULL;
}
if (wd->matchlist_job) ecore_job_del(wd->matchlist_job);
- if (wd->longpress_timer) ecore_timer_del(wd->longpress_timer);
if (wd->mgf_proxy) evas_object_del(wd->mgf_proxy);
if (wd->mgf_bg) evas_object_del(wd->mgf_bg);
if (wd->mgf_clip) evas_object_del(wd->mgf_clip);
}
static Eina_Bool
-_long_press(void *data)
+_signal_long_pressed(void *data)
{
Widget_Data *wd = elm_widget_data_get(data);
if (!wd) return ECORE_CALLBACK_CANCEL;
wd->long_pressed = EINA_TRUE;
- if (wd->longpress_timer)
- {
- ecore_timer_del(wd->longpress_timer);
- wd->longpress_timer = NULL;
- }
-
_cancel(data, NULL, NULL);
_magnifier_create(data);
_magnifier_show(data);
elm_object_scroll_freeze_push(data);
- wd->longpress_timer = NULL;
evas_object_smart_callback_call(data, SIG_LONGPRESSED, NULL);
return ECORE_CALLBACK_CANCEL;
}
wd->downx = ev->canvas.x;
wd->downy = ev->canvas.y;
wd->long_pressed = EINA_FALSE;
- if (ev->button == 1)
- {
- if (wd->longpress_timer) ecore_timer_del(wd->longpress_timer);
- wd->longpress_timer = ecore_timer_add(_elm_config->longpress_timeout, _long_press, data);
- }
}
static void
if (!wd->double_clicked)
{
if ((wd->api) && (wd->api->obj_mouseup))
- {
- wd->api->obj_mouseup(data);
- }
+ wd->api->obj_mouseup(data);
}
-
- if (wd->longpress_timer)
- {
- ecore_timer_del(wd->longpress_timer);
- wd->longpress_timer = NULL;
- }
-
_magnifier_hide(data);
elm_object_scroll_freeze_pop(data);
if (wd->long_pressed)
- {
- _menu_press(data);
- }
-
+ _menu_press(data);
}
else if (ev->button == 3)
{
Evas_Event_Mouse_Move *ev = event_info;
if (!wd) return;
if (wd->disabled) return;
- if (!wd->selmode)
- {
- if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
- {
- if (wd->longpress_timer)
- {
- ecore_timer_del(wd->longpress_timer);
- wd->longpress_timer = NULL;
- }
- }
- else if (wd->longpress_timer)
- {
- Evas_Coord dx, dy;
-
- dx = wd->downx - ev->cur.canvas.x;
- dx *= dx;
- dy = wd->downy - ev->cur.canvas.y;
- dy *= dy;
- if ((dx + dy) >
- ((_elm_config->finger_size / 2) *
- (_elm_config->finger_size / 2)))
- {
- ecore_timer_del(wd->longpress_timer);
- wd->longpress_timer = NULL;
- }
- }
- }
- else if (wd->longpress_timer)
- {
- Evas_Coord dx, dy;
-
- dx = wd->downx - ev->cur.canvas.x;
- dx *= dx;
- dy = wd->downy - ev->cur.canvas.y;
- dy *= dy;
- if ((dx + dy) >
- ((_elm_config->finger_size / 2) *
- (_elm_config->finger_size / 2)))
- {
- ecore_timer_del(wd->longpress_timer);
- wd->longpress_timer = NULL;
- }
- }
if (ev->buttons == 1)
{
_entry_changed_common_handling(data, SIG_PREEDIT_CHANGED);
}
-
static void
_signal_handler_move_start(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
{
Widget_Data *wd = elm_widget_data_get(data);
+ if (!wd) return;
+
elm_object_scroll_freeze_push(data);
if ((wd->api) && (wd->api->obj_hidemenu))
_signal_handler_move_end(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
{
Widget_Data *wd = elm_widget_data_get(data);
+ if (!wd) return;
+
elm_object_scroll_freeze_pop(data);
if (wd->have_selection)
_magnifier_show(data);
}
+static Evas_Object *
+_viewport_obj_get(Evas_Object *data)
+{
+ Widget_Data *wd = elm_widget_data_get(data);
+ if (!wd) return NULL;
+
+ if(!data || !strlen(elm_widget_type_get(data)))
+ return NULL;
+
+ Evas_Coord x, y, w, h;
+ x = y = w = h = -1;
+
+ if (wd->scroll)
+ {
+ //evas_object_geometry_get(wd->scroller, &x, &y, &w, &h);
+ //printf(">>> wd->scroller (%d, %d, %d, %d) \n", x, y, w, h);
+ return wd->scroller;
+ }
+
+ Evas_Object *parent_obj = data;
+
+ while(parent_obj = elm_widget_parent_get(parent_obj))
+ {
+ //evas_object_geometry_get(parent_obj, &x, &y, &w, &h);
+ //printf(">>> %s (%d, %d, %d, %d) \n", elm_widget_type_get(parent_obj), x, y, w, h);
+ if (!strcmp(elm_widget_type_get(parent_obj), "scroller") ||
+ !strcmp(elm_widget_type_get(parent_obj), "genlist"))
+ return parent_obj;
+ }
+
+ return NULL;
+}
+
static void
_signal_selection_end(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
{
elm_selection_set(ELM_SEL_PRIMARY, data, ELM_SEL_FORMAT_MARKUP, txt);
}
#endif
+
+ if (!_elm_config->desktop_entry)
+ edje_object_part_text_viewport_object_set(wd->ent, "elm.text", _viewport_obj_get(data));
}
static void
evas_object_smart_callback_call(data, SIG_PRESS, NULL);
if ((wd->api) && (wd->api->obj_hidemenu))
- {
- wd->api->obj_hidemenu(data);
- }
+ wd->api->obj_hidemenu(data);
}
static void
Widget_Data *wd = elm_widget_data_get(data);
if (!wd) return;
evas_object_smart_callback_call(data, SIG_CLICKED, NULL);
+
+ if (!_elm_config->desktop_entry && !wd->double_clicked)
+ _cancel(data, NULL, NULL);
}
static void
_signal_selection_start, obj);
edje_object_signal_callback_add(wd->ent, "selection,end", "elm.text",
_signal_selection_end, obj);
+ edje_object_signal_callback_add(wd->ent, "long,pressed", "elm.text",
+ _signal_long_pressed, obj);
edje_object_signal_callback_add(wd->ent, "magnifier,changed", "elm.text",
_signal_magnifier_changed, obj);
edje_object_signal_callback_add(wd->ent, "selection,changed", "elm.text",
ext_mod->selectall = _selectall;
ext_mod->ent = wd->ent;
ext_mod->items = wd->items;
- ext_mod->longpress_timer = wd->longpress_timer;
ext_mod->editable = wd->editable;
ext_mod->have_selection = wd->have_selection;
ext_mod->password = wd->password;
ext_mod->cnpinit(data,obj,event_info);
elm_cbhm_helper_init(obj);
if (ext_mod->textonly)
- elm_cbhm_send_raw_data("show0");
+ elm_cbhm_send_raw_data("show0");
else
- elm_cbhm_send_raw_data("show1");
+ elm_cbhm_send_raw_data("show1");
evas_object_hide(obj);
// end for cbhm
}
(ext_mod->ent, "context_menu_orientation");
if ((context_menu_orientation) &&
(!strcmp(context_menu_orientation, "horizontal")))
- elm_ctxpopup_horizontal_set(ext_mod->popup, EINA_TRUE);
+ elm_ctxpopup_horizontal_set(ext_mod->popup, EINA_TRUE);
elm_widget_sub_object_add(obj, ext_mod->popup);
if (!ext_mod->selmode)
if (1) // need way to detect if someone has a selection
{
if (ext_mod->editable)
- elm_ctxpopup_item_append(ext_mod->popup, "Paste", NULL, _paste, obj );
+ elm_ctxpopup_item_append(ext_mod->popup, "Paste", NULL, _paste, obj );
}
//elm_ctxpopup_item_append(wd->ctxpopup, NULL, "Selectall",_select_all, obj );
// start for cbhm
{
elm_ctxpopup_item_append(ext_mod->popup, "Copy", NULL, _copy, obj );
if (ext_mod->editable)
- elm_ctxpopup_item_append(ext_mod->popup, "Cut", NULL, _cut, obj );
+ elm_ctxpopup_item_append(ext_mod->popup, "Cut", NULL, _cut, obj );
if (ext_mod->editable)
- elm_ctxpopup_item_append(ext_mod->popup, "Paste", NULL, _paste, obj );
+ elm_ctxpopup_item_append(ext_mod->popup, "Paste", NULL, _paste, obj );
}
else
{
if (1) // need way to detect if someone has a selection
{
if (ext_mod->editable)
- elm_ctxpopup_item_append(ext_mod->popup, "Paste", NULL, _paste, obj );
+ elm_ctxpopup_item_append(ext_mod->popup, "Paste", NULL, _paste, obj );
}
}
// start for cbhm
EAPI void
obj_mouseup(Evas_Object *obj)
{
- if (!obj || !ext_mod) {
- return;
- }
-
- /*update*/
- elm_entry_extension_module_data_get(obj,ext_mod);
- if (ext_mod->longpress_timer)
- {
- if (ext_mod->have_selection )
- {
- _cancel(obj,ext_mod->popup,NULL);
- }
- }
+ if (!obj || !ext_mod)
+ return;
}
EAPI void
obj_hidemenu(Evas_Object *obj)
{
- if (!obj || !ext_mod) {
- return;
- }
+ if (!obj || !ext_mod)
+ return;
evas_object_hide(ext_mod->popup);
// if (ext_mod->popup) evas_object_del(ext_mod->popup);