}
static void
- Evas_Coord_Rectangle ret_rect;
+_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))
+ wd->api->obj_hidemenu(data);
+
+ if (wd->magnifier_enabled)
+ {
+ _magnifier_create(data);
+ _magnifier_move(data);
+ _magnifier_show(data);
+ }
+}
+
+static void
+_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_hide(data);
+ _menu_press(data);
+ }
+}
+
+static void
+_signal_handler_moving(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;
+
+ if (wd->magnifier_enabled)
+ {
+ _magnifier_move(data);
+ _magnifier_show(data);
+ }
+}
+
+static Evas_Coord_Rectangle
+_intersection_region_get(Evas_Coord_Rectangle rect1, Evas_Coord_Rectangle rect2)
+{
+ Evas_Coord_Rectangle ret_rect;
+ Evas_Coord_Point l1, l2, r1, r2, p1, p2;
+
+ l1.x = rect1.x;
+ l1.y = rect1.y;
+ r1.x = rect1.x + rect1.w;
+ r1.y = rect1.y + rect1.h;
+
+ l2.x = rect2.x;
+ l2.y = rect2.y;
+ r2.x = rect2.x + rect2.w;
+ r2.y = rect2.y + rect2.h;
+
+ p1.x = (l1.x > l2.x) ? l1.x : l2.x;
+ p1.y = (l1.y > l2.y) ? l1.y : l2.y;
+ p2.x = (r1.x < r2.x) ? r1.x : r2.x;
+ p2.y = (r1.y < r2.y) ? r1.y : r2.y;
+
+ ret_rect.x = p1.x;
+ ret_rect.y = p1.y;
+ ret_rect.w = (p2.x > p1.x) ? p2.x - p1.x : -1;
+ ret_rect.h = (p2.y > p1.y) ? p2.y - p1.y : -1;
+
+ return ret_rect;
+}
+
+static Evas_Coord_Rectangle
+_viewport_region_get(Evas_Object *data)
+{
+ Evas_Coord_Rectangle geometry, ret_rect;
+ geometry.x = geometry.y = geometry.w = geometry.h = -1;
+ ret_rect = geometry;
+
+ Widget_Data *wd = elm_widget_data_get(data);
+ if (!wd) return geometry;
+ if (!data || !strlen(elm_widget_type_get(data))) return geometry;
+
+ if (wd->scroll)
+ {
+ evas_object_geometry_get(wd->scroller, &geometry.x, &geometry.y, &geometry.w, &geometry.h);
+ ret_rect = geometry;
+ }
+
+ Evas_Object *parent_obj = data;
+
+ while ((parent_obj = elm_widget_parent_get(parent_obj)))
+ {
+ if (!strcmp(elm_widget_type_get(parent_obj), "scroller") ||
+ !strcmp(elm_widget_type_get(parent_obj), "genlist"))
+ {
+ evas_object_geometry_get(parent_obj, &geometry.x, &geometry.y, &geometry.w, &geometry.h);
+ if ((ret_rect.w == -1) && (ret_rect.h == -1)) ret_rect = geometry;
+ ret_rect = _intersection_region_get(geometry, ret_rect);
+ }
+ }
+
+ return ret_rect;
+}
+
+static Evas_Coord_Rectangle
+_layout_region_get(Evas_Object *data)
+{
+ Evas_Coord_Rectangle geometry;
+ geometry.x = geometry.y = geometry.w = geometry.h = -1;
+
+ Widget_Data *wd = elm_widget_data_get(data);
+ if (!wd) return geometry;
+ if (!data || !strlen(elm_widget_type_get(data))) return geometry;
+
+ Evas_Object *child_obj = data;
+ Evas_Object *parent_obj;
+
+ while ((parent_obj = elm_widget_parent_get(child_obj)))
+ {
+ if (!strcmp(elm_widget_type_get(parent_obj), "conformant"))
+ {
+ evas_object_geometry_get(child_obj, &geometry.x, &geometry.y, &geometry.w, &geometry.h);
+ return geometry;
+ }
+ child_obj = parent_obj;
+ }
+
+ return geometry;
+}
+
+static void
+_region_get_job(void *data)
+{
+ Widget_Data *wd = elm_widget_data_get(data);
+ if (!wd) return;
+ wd->region_get_job = NULL;
+
+ if (!_elm_config->desktop_entry)
+ {
+ if (wd->region_recalc_job) ecore_job_del(wd->region_recalc_job);
+ wd->region_recalc_job = ecore_job_add(_region_recalc_job, data);
+
+ evas_smart_objects_calculate(evas_object_evas_get(data));
+ }
+}
+
+static void
+_region_recalc_job(void *data)
+{
+ Widget_Data *wd = elm_widget_data_get(data);
+ Evas_Coord_Rectangle ret_rect;
+ if (!wd) return;
+ wd->region_recalc_job = NULL;
+
+ if (!_elm_config->desktop_entry)
+ {
+ ret_rect = _viewport_region_get(data);
+ edje_object_part_text_viewport_region_set(wd->ent, "elm.text", ret_rect.x, ret_rect.y, ret_rect.w, ret_rect.h);
+ ret_rect = _layout_region_get(data);
+ edje_object_part_text_layout_region_set(wd->ent, "elm.text", ret_rect.x, ret_rect.y, ret_rect.w, ret_rect.h);
+ }
+}
+
+static void
+_signal_selection_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;
+
+ if (wd->magnifier_enabled)
+ _magnifier_hide(data);
+ _menu_press(data);
+}
+
+static void
_signal_entry_changed_user(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
{
Elm_Entry_Change_Info info;