From: Govindaraju SM Date: Tue, 7 Dec 2010 16:08:38 +0000 (+0530) Subject: [Autoscroll] elm_widget_imp_region_get_hook_set, get_imp_region_get APIs removed... X-Git-Tag: REL_I9200_20110603-1~595^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bc2423d6acc69083f5b7f0f778f24fff6a491450;p=framework%2Fuifw%2Felementary.git [Autoscroll] elm_widget_imp_region_get_hook_set, get_imp_region_get APIs removed & elm_widget_show_region_set used. --- diff --git a/src/lib/elc_scrolled_entry.c b/src/lib/elc_scrolled_entry.c index 8008a17..de2a4f5 100644 --- a/src/lib/elc_scrolled_entry.c +++ b/src/lib/elc_scrolled_entry.c @@ -128,17 +128,6 @@ _on_focus_hook(void *data __UNUSED__, Evas_Object *obj) elm_widget_focus_steal(wd->entry); } -#ifdef HAVE_CONFORMANT_AUTOSCROLL -static Evas_Object * -_imp_region_get_hook(const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h) -{ - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; - elm_widget_imp_region_get(wd->entry, x, y, w, h); - return wd->scroller; -} -#endif - static void _disable_hook(Evas_Object *obj) { @@ -156,7 +145,6 @@ _signal_emit_hook(Evas_Object *obj, const char *emission, const char *source) elm_object_signal_emit(wd->scroller, emission, source); } - static void _entry_changed(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { @@ -289,11 +277,9 @@ elm_scrolled_entry_add(Evas_Object *parent) elm_widget_can_focus_set(obj, 1); elm_widget_theme_hook_set(obj, _theme_hook); elm_widget_signal_emit_hook_set(obj, _signal_emit_hook); -#ifdef HAVE_CONFORMANT_AUTOSCROLL - elm_widget_imp_region_get_hook_set(obj, _imp_region_get_hook, NULL); -#endif wd->scroller = elm_scroller_add(parent); + elm_widget_sub_object_add(obj, wd->scroller); elm_widget_resize_object_set(obj, wd->scroller); elm_scroller_bounce_set(wd->scroller, 0, 0); elm_scroller_propagate_events_set(wd->scroller, 1); @@ -381,7 +367,6 @@ elm_scrolled_entry_single_line_get(const Evas_Object *obj) return elm_entry_single_line_get(wd->entry); } - /** * This sets the scrolled entry object to password mode. All text entered * and/or displayed within the widget will be replaced with asterisks (*). @@ -419,7 +404,6 @@ elm_scrolled_entry_password_get(const Evas_Object *obj) return elm_entry_password_get(wd->entry); } - /** * This sets the text displayed within the scrolled entry to @p entry. * @@ -570,7 +554,6 @@ elm_scrolled_entry_editable_get(const Evas_Object *obj) return elm_entry_editable_get(wd->entry); } - /** * This drops any existing text selection within the scrolled entry. * diff --git a/src/lib/elm_conform.c b/src/lib/elm_conform.c index f1e44d7..3f9d0bd 100644 --- a/src/lib/elm_conform.c +++ b/src/lib/elm_conform.c @@ -11,43 +11,33 @@ */ typedef struct _Widget_Data Widget_Data; -struct _Widget_Data +struct _Widget_Data { Evas_Object *base; - Evas_Object *shelf, *panel; + Evas_Object *shelf, *panel, *virtualkeypad; Evas_Object *content; -#ifdef HAVE_CONFORMANT_AUTOSCROLL - Evas_Object *virtualkeypad; - Evas_Object *focus_obj; Evas_Object *scroller; - Evas_Coord frelx, frely; int vkeypad_height; Ecore_X_Virtual_Keyboard_State vkeypad_state; -#endif Ecore_Event_Handler *prop_hdl; - struct { - Ecore_Animator *animator; // animaton timer - double start; // time started - Evas_Coord auto_x, auto_y; // desired delta - Evas_Coord x, y; // current delta - } delta; }; /* local function prototypes */ static const char *widtype = NULL; -#ifdef HAVE_CONFORMANT_AUTOSCROLL -static const char SIG_IMPREGION_CHANGED[] = "impregion,changed"; -#endif -static void _del_hook(Evas_Object *obj); -static void _theme_hook(Evas_Object *obj); -static void _swallow_conformant_parts(Evas_Object *obj); -static void _sizing_eval(Evas_Object *obj); -static Eina_Bool _prop_change(void *data, int type, void *event); - +static void +_del_hook(Evas_Object *obj); +static void +_theme_hook(Evas_Object *obj); +static void +_swallow_conformant_parts(Evas_Object *obj); +static void +_sizing_eval(Evas_Object *obj); +static Eina_Bool +_prop_change(void *data, int type, void *event); /* local functions */ -static void -_del_hook(Evas_Object *obj) +static void +_del_hook(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -55,22 +45,24 @@ _del_hook(Evas_Object *obj) free(wd); } -static void -_theme_hook(Evas_Object *obj) +static void +_theme_hook(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; - _elm_theme_object_set(obj, wd->base, "conformant", "base", elm_widget_style_get(obj)); + _elm_theme_object_set(obj, wd->base, "conformant", "base", + elm_widget_style_get(obj)); _swallow_conformant_parts(obj); - if (wd->content) - edje_object_part_swallow(wd->base, "elm.swallow.content", wd->content); - edje_object_scale_set(wd->base, elm_widget_scale_get(obj) * _elm_config->scale); + if (wd->content) edje_object_part_swallow(wd->base, "elm.swallow.content", + wd->content); + edje_object_scale_set(wd->base, elm_widget_scale_get(obj) + * _elm_config->scale); _sizing_eval(obj); } -static void -_sizing_eval(Evas_Object *obj) +static void +_sizing_eval(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord mw = -1, mh = -1; @@ -94,33 +86,30 @@ _swallow_conformant_parts(Evas_Object *obj) ecore_x_e_illume_indicator_geometry_get(zone, NULL, NULL, NULL, &sh); if (sh < 0) sh = 0; - if (!wd->shelf) - wd->shelf = evas_object_rectangle_add(evas_object_evas_get(obj)); + if(!wd->shelf) + wd->shelf = evas_object_rectangle_add(evas_object_evas_get(obj)); evas_object_color_set(wd->shelf, 0, 0, 0, 0); evas_object_size_hint_min_set(wd->shelf, -1, sh); evas_object_size_hint_max_set(wd->shelf, -1, sh); edje_object_part_swallow(wd->base, "elm.swallow.shelf", wd->shelf); -#ifdef HAVE_CONFORMANT_AUTOSCROLL wd->scroller = NULL; - wd->focus_obj = NULL; sh = -1; ecore_x_e_illume_keyboard_geometry_get(zone, NULL, NULL, NULL, &sh); if (sh < 0) sh = 0; wd->vkeypad_height = sh; - if (!wd->virtualkeypad) - wd->virtualkeypad= evas_object_rectangle_add(evas_object_evas_get(obj)); + if(!wd->virtualkeypad) + wd->virtualkeypad= evas_object_rectangle_add(evas_object_evas_get(obj)); evas_object_color_set(wd->virtualkeypad, 0, 0, 0, 0); evas_object_size_hint_min_set(wd->virtualkeypad, -1, sh); evas_object_size_hint_max_set(wd->virtualkeypad, -1, sh); edje_object_part_swallow(wd->base, "elm.swallow.virtualkeypad", wd->virtualkeypad); -#endif sh = -1; ecore_x_e_illume_softkey_geometry_get(zone, NULL, NULL, NULL, &sh); if (sh < 0) sh = 0; - if (!wd->panel) - wd->panel = evas_object_rectangle_add(evas_object_evas_get(obj)); + if(!wd->panel) + wd->panel = evas_object_rectangle_add(evas_object_evas_get(obj)); evas_object_color_set(wd->panel, 0, 0, 0, 0); evas_object_size_hint_min_set(wd->panel, -1, sh); evas_object_size_hint_max_set(wd->panel, -1, sh); @@ -143,137 +132,55 @@ _sub_del(void *data __UNUSED__, Evas_Object *obj, void *event_info) Evas_Object *sub = event_info; if (!wd) return; if (sub == wd->content) - { - evas_object_event_callback_del_full(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, - _changed_size_hints, obj); - wd->content = NULL; - _sizing_eval(obj); - } -} - -#ifdef HAVE_CONFORMANT_AUTOSCROLL -static Evas_Object * -_focus_object_get(const Evas_Object *obj) -{ - Evas_Object *parent = NULL, *foc = NULL; - parent = elm_widget_top_get(obj); - if (!parent) return NULL; - foc = elm_widget_focused_object_get(parent); - return foc; -} - -static void -_imp_region_show(void *data, Evas_Object *obj) -{ - Evas_Coord x = 0, y = 0, w = 0, h = 0; - Evas_Object * immed_scroll = NULL; - Widget_Data *wd = elm_widget_data_get(data); - if (!wd) return; - if (!wd->scroller) return; - if (!wd->focus_obj) return; - immed_scroll = elm_widget_imp_region_get(wd->focus_obj, &x, &y, &w, &h); - if (x < 0) x = 0; - if (y < 0) y = 0; - x = x + wd->frelx; - y = y + wd->frely; - //if (wd->vkeypad_state == ECORE_X_VIRTUAL_KEYBOARD_STATE_ON) - elm_scroller_region_bring_in(wd->scroller, x, y, w, h); + { + evas_object_event_callback_del_full(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, + _changed_size_hints, obj); + wd->content = NULL; + _sizing_eval(obj); + } } static void -_imp_region_changed_cb(void *data, Evas_Object *obj, void *event_info) +_content_resize_event_cb(void *data, Evas *e, Evas_Object *obj, + void *event_info) { - _imp_region_show(data, obj); -} - -static void -_scroller_resize_event_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) -{ - _imp_region_show(data, obj); -} + Evas_Object *focus_obj = elm_widget_focused_object_get(obj); + if (focus_obj) + { + Evas_Coord x, y, w, h; -static Eina_Bool -_focus_object_region_calc(void *data, int *kh, Eina_Bool reg_scrol_resz_evnt) -{ - Evas_Coord fx = 0, fy = 0, fw = 0, fh = 0; - Evas_Coord sx = 0, sy = 0, sw = 0, sh = 0; - Evas_Coord tsx = 0, tsy = 0, tsw = 0, tsh = 0; + elm_widget_show_region_get(focus_obj, &x, &y, &w, &h); - Widget_Data *wd = elm_widget_data_get(data); - if (!wd) return EINA_FALSE; - if (!wd->scroller) return EINA_FALSE; - if (!wd->focus_obj) return EINA_FALSE; - evas_object_geometry_get(wd->focus_obj, &fx, &fy, &fw, &fh); - evas_object_geometry_get(wd->scroller, &sx, &sy, &sw, &sh); - elm_scroller_region_get(wd->scroller, &tsx, &tsy, &tsw, &tsh); - if (sy > 0) - { - fy = fy - sy; - } - wd->frelx = tsx + fx; - wd->frely = tsy + fy; -} - -static Eina_Bool -_get_scroller(void *data, Evas_Object * foc_obj, Eina_Bool reg_scrol_resz_evnt) -{ - Evas_Coord x = 0, y = 0, w = 0, h = 0; - Evas_Object * parent = NULL; - Evas_Object * immed_scroll=NULL; - Evas_Object * root_scroller = NULL; - Evas_Object *win=NULL; - const char * type=NULL; - Widget_Data *wd = elm_widget_data_get(data); - if (!wd) return EINA_FALSE; - win = elm_widget_top_get(foc_obj); - if (!win) return EINA_FALSE; - immed_scroll = elm_widget_imp_region_get(foc_obj, &x, &y, &w, &h); - parent = elm_object_parent_widget_get( foc_obj ); - do - { - type=elm_widget_type_get(parent); - if (!strcmp(type,"scroller")) - { - root_scroller = parent; - // break; - } - parent = elm_object_parent_widget_get( parent ); - } - while (parent && (parent !=win)); - if (root_scroller) - wd->scroller = root_scroller; - else if (immed_scroll) - wd->scroller = immed_scroll; - else - { - wd->scroller = NULL; - return EINA_FALSE; - } - return EINA_TRUE; + if (h < _elm_config->finger_size) h = _elm_config->finger_size; + elm_widget_show_region_set(focus_obj, x, y, w, h); + } } static void _autoscroll_mode_enable(void *data) { - Evas_Object * focused_object=NULL; - Eina_Bool ret = EINA_FALSE; - + char *type; + Evas_Object *scrl_obj = NULL; + Evas_Object *conformant = (Evas_Object *) data; Widget_Data *wd = elm_widget_data_get(data); if (!wd) return; - focused_object=_focus_object_get(data); - if (focused_object) - { - wd->focus_obj = focused_object; - ret = _get_scroller(data, focused_object, EINA_TRUE); - } - if (ret == EINA_TRUE) - { - ret = _focus_object_region_calc(data, NULL, EINA_TRUE); - evas_object_event_callback_add(wd->scroller, EVAS_CALLBACK_RESIZE, - _scroller_resize_event_cb, data); - evas_object_smart_callback_add(wd->focus_obj, SIG_IMPREGION_CHANGED, - _imp_region_changed_cb, data); - } + scrl_obj = elm_widget_focused_object_get(conformant); + + //Look up for Top most scroller in the Focus Object hierarchy inside Conformant. + while (scrl_obj) + { + type = elm_widget_type_get(scrl_obj); + if (!strcmp(type, "conformant")) break; + if (!strcmp(type, "scroller") || !strcmp(type, "genlist")) + wd->scroller = scrl_obj; + + scrl_obj = elm_object_parent_widget_get(scrl_obj); + } + + if (wd->scroller) evas_object_event_callback_add(wd->scroller, + EVAS_CALLBACK_RESIZE, + _content_resize_event_cb, + data); } static void @@ -281,109 +188,95 @@ _autoscroll_mode_disable(void *data) { Widget_Data *wd = elm_widget_data_get(data); if (!wd) return; - evas_object_event_callback_del(wd->scroller, EVAS_CALLBACK_RESIZE, _scroller_resize_event_cb); - evas_object_smart_callback_del(wd->focus_obj, SIG_IMPREGION_CHANGED, _imp_region_changed_cb); + evas_object_event_callback_del(wd->scroller, EVAS_CALLBACK_RESIZE, + _content_resize_event_cb); wd->scroller = NULL; - wd->focus_obj = NULL; } -#endif - static Eina_Bool -_prop_change(void *data, int type __UNUSED__, void *event) +_prop_change(void *data, int type __UNUSED__, void *event) { #ifdef HAVE_ELEMENTARY_X -#ifdef HAVE_CONFORMANT_AUTOSCROLL - int indicator_height=57; + int indicator_height=0; Ecore_X_Virtual_Keyboard_State virt_keypad_state = ECORE_X_VIRTUAL_KEYBOARD_STATE_UNKNOWN; -#endif Ecore_X_Event_Window_Property *ev; Widget_Data *wd = elm_widget_data_get(data); if (!wd) return ECORE_CALLBACK_PASS_ON; ev = event; - if (ev->atom == ECORE_X_ATOM_E_ILLUME_ZONE) - { - Ecore_X_Window zone; - int sh = -1; - - zone = ecore_x_e_illume_zone_get(ev->win); - ecore_x_e_illume_indicator_geometry_get(zone, NULL, NULL, NULL, &sh); -#ifdef HAVE_CONFORMANT_AUTOSCROLL - if (sh < 0) sh = indicator_height; -#else - if (sh < 0) sh = 0; -#endif - evas_object_size_hint_min_set(wd->shelf, -1, sh); - evas_object_size_hint_max_set(wd->shelf, -1, sh); -#ifdef HAVE_CONFORMANT_AUTOSCROLL - sh = -1; - zone = ecore_x_e_illume_zone_get(ev->win); - ecore_x_e_illume_keyboard_geometry_get(zone, NULL, NULL, NULL, &sh); - if (sh < 0) sh = 0; - evas_object_size_hint_min_set(wd->virtualkeypad, -1, sh); - evas_object_size_hint_max_set(wd->virtualkeypad, -1, sh); -#endif - sh = -1; - ecore_x_e_illume_softkey_geometry_get(zone, NULL, NULL, NULL, &sh); - if (sh < 0) sh = 0; - evas_object_size_hint_min_set(wd->panel, -1, sh); - evas_object_size_hint_max_set(wd->panel, -1, sh); - } - else if (ev->atom == ECORE_X_ATOM_E_ILLUME_INDICATOR_GEOMETRY) - { - Ecore_X_Window zone; - int sh = -1; - - zone = ecore_x_e_illume_zone_get(ev->win); - ecore_x_e_illume_indicator_geometry_get(zone, NULL, NULL, NULL, &sh); - if (sh < 0) sh = 0; - evas_object_size_hint_min_set(wd->shelf, -1, sh); - evas_object_size_hint_max_set(wd->shelf, -1, sh); - } - else if (ev->atom == ECORE_X_ATOM_E_ILLUME_SOFTKEY_GEOMETRY) - { - Ecore_X_Window zone; - int sh = -1; - - zone = ecore_x_e_illume_zone_get(ev->win); - ecore_x_e_illume_softkey_geometry_get(zone, NULL, NULL, NULL, &sh); - if (sh < 0) sh = 0; - evas_object_size_hint_min_set(wd->panel, -1, sh); - evas_object_size_hint_max_set(wd->panel, -1, sh); - } -#ifdef HAVE_CONFORMANT_AUTOSCROLL - else if (ev->atom == ECORE_X_ATOM_E_ILLUME_KEYBOARD_GEOMETRY) - { - Ecore_X_Window zone; - int ky = -1, kh = -1; - - printf("Keyboard Geometry Changed\n"); - zone = ecore_x_e_illume_zone_get(ev->win); - ecore_x_e_illume_keyboard_geometry_get(zone, NULL, &ky, NULL, &kh); - printf("\tGeom: %d\n", ky); - if (kh < 0) kh = 0; - if (kh == wd->vkeypad_height) return ECORE_CALLBACK_PASS_ON; - wd->vkeypad_height = kh; - evas_object_size_hint_min_set(wd->virtualkeypad, -1, kh); - evas_object_size_hint_max_set(wd->virtualkeypad, -1, kh); - } + if (ev->atom == ECORE_X_ATOM_E_ILLUME_ZONE) + { + Ecore_X_Window zone; + int sh = -1; + + zone = ecore_x_e_illume_zone_get(ev->win); + ecore_x_e_illume_indicator_geometry_get(zone, NULL, NULL, NULL, &sh); + if (sh < 0) sh = indicator_height; + + evas_object_size_hint_min_set(wd->shelf, -1, sh); + evas_object_size_hint_max_set(wd->shelf, -1, sh); + sh = -1; + zone = ecore_x_e_illume_zone_get(ev->win); + ecore_x_e_illume_keyboard_geometry_get(zone, NULL, NULL, NULL, &sh); + if (sh < 0) sh = 0; + evas_object_size_hint_min_set(wd->virtualkeypad, -1, sh); + evas_object_size_hint_max_set(wd->virtualkeypad, -1, sh); + sh = -1; + ecore_x_e_illume_softkey_geometry_get(zone, NULL, NULL, NULL, &sh); + if (sh < 0) sh = 0; + evas_object_size_hint_min_set(wd->panel, -1, sh); + evas_object_size_hint_max_set(wd->panel, -1, sh); + } + else if (ev->atom == ECORE_X_ATOM_E_ILLUME_INDICATOR_GEOMETRY) + { + Ecore_X_Window zone; + int sh = -1; + + zone = ecore_x_e_illume_zone_get(ev->win); + ecore_x_e_illume_indicator_geometry_get(zone, NULL, NULL, NULL, &sh); + if (sh < 0) sh = 0; + evas_object_size_hint_min_set(wd->shelf, -1, sh); + evas_object_size_hint_max_set(wd->shelf, -1, sh); + } + else if (ev->atom == ECORE_X_ATOM_E_ILLUME_SOFTKEY_GEOMETRY) + { + Ecore_X_Window zone; + int sh = -1; + + zone = ecore_x_e_illume_zone_get(ev->win); + ecore_x_e_illume_softkey_geometry_get(zone, NULL, NULL, NULL, &sh); + if (sh < 0) sh = 0; + evas_object_size_hint_min_set(wd->panel, -1, sh); + evas_object_size_hint_max_set(wd->panel, -1, sh); + } + else if (ev->atom == ECORE_X_ATOM_E_ILLUME_KEYBOARD_GEOMETRY) + { + Ecore_X_Window zone; + int ky = -1, kh = -1; + + zone = ecore_x_e_illume_zone_get(ev->win); + ecore_x_e_illume_keyboard_geometry_get(zone, NULL, &ky, NULL, &kh); + if (kh < 0) kh = 0; + if (kh == wd->vkeypad_height) return ECORE_CALLBACK_PASS_ON; + wd->vkeypad_height = kh; + evas_object_size_hint_min_set(wd->virtualkeypad, -1, kh); + evas_object_size_hint_max_set(wd->virtualkeypad, -1, kh); + } else if (ev->atom == ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_STATE) - { - Ecore_X_Window zone; - zone = ecore_x_e_illume_zone_get(ev->win); - virt_keypad_state = ecore_x_e_virtual_keyboard_state_get(zone); - if (virt_keypad_state == wd->vkeypad_state) return ECORE_CALLBACK_PASS_ON; - wd->vkeypad_state = virt_keypad_state; - if(wd->vkeypad_state == ECORE_X_VIRTUAL_KEYBOARD_STATE_ON) - { - _autoscroll_mode_enable(data); - } - else if (wd->vkeypad_state == ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF) - { - _autoscroll_mode_disable(data); - } - } -#endif + { + Ecore_X_Window zone; + zone = ecore_x_e_illume_zone_get(ev->win); + virt_keypad_state = ecore_x_e_virtual_keyboard_state_get(zone); + if (virt_keypad_state == wd->vkeypad_state) return ECORE_CALLBACK_PASS_ON; + wd->vkeypad_state = virt_keypad_state; + if(wd->vkeypad_state == ECORE_X_VIRTUAL_KEYBOARD_STATE_ON) + { + _autoscroll_mode_enable(data); + } + else if(wd->vkeypad_state == ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF) + { + _autoscroll_mode_disable(data); + } + } #endif return ECORE_CALLBACK_PASS_ON; @@ -398,7 +291,7 @@ _prop_change(void *data, int type __UNUSED__, void *event) * @ingroup Conformant */ EAPI Evas_Object * -elm_conformant_add(Evas_Object *parent) +elm_conformant_add(Evas_Object *parent) { Evas_Object *obj; Evas *evas; @@ -423,11 +316,9 @@ elm_conformant_add(Evas_Object *parent) #ifdef HAVE_ELEMENTARY_X wd->prop_hdl = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_PROPERTY, - _prop_change, obj); -#ifdef HAVE_CONFORMANT_AUTOSCROLL + _prop_change, obj); wd->vkeypad_state = ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF; #endif -#endif evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj); @@ -457,12 +348,12 @@ elm_conformant_content_set(Evas_Object *obj, Evas_Object *content) if (wd->content) evas_object_del(wd->content); wd->content = content; if (content) - { - elm_widget_sub_object_add(obj, content); - evas_object_event_callback_add(content, EVAS_CALLBACK_CHANGED_SIZE_HINTS, - _changed_size_hints, obj); - edje_object_part_swallow(wd->base, "elm.swallow.content", content); - } + { + elm_widget_sub_object_add(obj, content); + evas_object_event_callback_add(content, EVAS_CALLBACK_CHANGED_SIZE_HINTS, + _changed_size_hints, obj); + edje_object_part_swallow(wd->base, "elm.swallow.content", content); + } _sizing_eval(obj); } diff --git a/src/lib/elm_editfield.c b/src/lib/elm_editfield.c index 42c15db..d7cdafe 100644 --- a/src/lib/elm_editfield.c +++ b/src/lib/elm_editfield.c @@ -36,11 +36,6 @@ static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *eve static void _on_focus_hook(void *data, Evas_Object *obj); static Eina_Bool _empty_entry(Evas_Object *entry); -#ifdef HAVE_CONFORMANT_AUTOSCROLL -static const char SIG_CURSOR_CHANGED[] = "cursor,changed"; -static const char SIG_IMPREGION_CHANGED[] = "impregion,changed"; -#endif - static void _del_hook(Evas_Object *obj) { @@ -50,23 +45,12 @@ _del_hook(Evas_Object *obj) free(wd); } -#ifdef HAVE_CONFORMANT_AUTOSCROLL -static Evas_Object * -_imp_region_get_hook(const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h) -{ - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; - elm_widget_imp_region_get(wd->entry, x, y, w, h); - return NULL; -} -#endif - static void _on_focus_hook(void *data, Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); if (!wd || !wd->base) - return ; + return; if (!elm_widget_focus_get(obj) && !(elm_widget_disabled_get(obj)) ) { evas_object_smart_callback_call(obj, "unfocused", NULL); @@ -203,15 +187,6 @@ _entry_changed_cb(void *data, Evas_Object *obj, void* event_info) } } -#ifdef HAVE_CONFORMANT_AUTOSCROLL -static void -_entry_cursor_changed_cb(void *data, Evas_Object *obj, void* event_info) -{ - Evas_Object *ef_obj = (Evas_Object *)data; - evas_object_smart_callback_call(ef_obj, SIG_IMPREGION_CHANGED, NULL); -} -#endif - static void _signal_mouse_clicked(void *data, Evas_Object *obj, const char *emission, const char *source) { @@ -293,9 +268,6 @@ elm_editfield_add(Evas_Object *parent) elm_widget_on_focus_hook_set( obj, _on_focus_hook, NULL ); elm_widget_signal_emit_hook_set(obj, _signal_emit_hook); elm_widget_can_focus_set(obj, EINA_TRUE); -#ifdef HAVE_CONFORMANT_AUTOSCROLL - elm_widget_imp_region_get_hook_set(obj, _imp_region_get_hook, NULL); -#endif wd->base = edje_object_add(e); _elm_theme_object_set(obj, wd->base, "editfield", "base", "default"); @@ -321,10 +293,6 @@ elm_editfield_add(Evas_Object *parent) edje_object_part_swallow(wd->base, "elm.swallow.content", wd->entry); evas_object_smart_callback_add(wd->entry, "changed", _entry_changed_cb, obj); elm_widget_sub_object_add(obj, wd->entry); -#ifdef HAVE_CONFORMANT_AUTOSCROLL - evas_object_smart_callback_add(wd->entry, SIG_CURSOR_CHANGED, _entry_cursor_changed_cb, obj); -#endif - _sizing_eval(obj); return obj; diff --git a/src/lib/elm_entry.c b/src/lib/elm_entry.c index 600348f..d5c662f 100644 --- a/src/lib/elm_entry.c +++ b/src/lib/elm_entry.c @@ -197,9 +197,7 @@ static const char SIG_SELECTION_CHANGED[] = "selection,changed"; static const char SIG_SELECTION_CLEARED[] = "selection,cleared"; static const char SIG_CURSOR_CHANGED[] = "cursor,changed"; static const char SIG_ANCHOR_CLICKED[] = "anchor,clicked"; -#ifdef HAVE_CONFORMANT_AUTOSCROLL -static const char SIG_IMPREGION_CHANGED[] = "impregion,changed"; -#endif + static const Evas_Smart_Cb_Description _signals[] = { {SIG_CHANGED, ""}, {SIG_ACTIVATED, ""}, @@ -420,24 +418,6 @@ _check_enable_returnkey(Evas_Object *obj) } } -#ifdef HAVE_CONFORMANT_AUTOSCROLL -static Evas_Object * -_imp_region_get_hook(const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h) -{ - Evas_Coord cx = 0, cy = 0, cw = 0, ch = 0; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; - edje_object_part_text_cursor_geometry_get(wd->ent, "elm.text", - &cx, &cy, &cw, &ch); - if (x) *x = cx; - if (y) *y = cy; - if (w) *w = cw; - if (h) *h = ch; - - return NULL; -} -#endif - static void _on_focus_hook(void *data __UNUSED__, Evas_Object *obj) { @@ -1365,9 +1345,6 @@ _signal_cursor_changed(void *data, Evas_Object *obj __UNUSED__, const char *emis wd->cw = cw; wd->ch = ch; } -#ifdef HAVE_CONFORMANT_AUTOSCROLL - evas_object_smart_callback_call(data, SIG_IMPREGION_CHANGED, NULL); -#endif } static void @@ -2107,9 +2084,6 @@ elm_entry_add(Evas_Object *parent) elm_widget_signal_callback_add_hook_set(obj, _signal_callback_add_hook); elm_widget_signal_callback_del_hook_set(obj, _signal_callback_del_hook); elm_widget_can_focus_set(obj, 1); -#ifdef HAVE_CONFORMANT_AUTOSCROLL - elm_widget_imp_region_get_hook_set(obj, _imp_region_get_hook, NULL); -#endif wd->linewrap = EINA_TRUE; wd->ellipsis = EINA_FALSE; @@ -3352,7 +3326,6 @@ elm_entry_text_color_set(Evas_Object *obj, unsigned int r, unsigned int g, unsig eina_stringshare_del(t); } - /** * Set background color of the entry * diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c index 5fe4a27..a49ec43 100644 --- a/src/lib/elm_genlist.c +++ b/src/lib/elm_genlist.c @@ -482,7 +482,7 @@ struct _Elm_Genlist_GroupItem static const char *widtype = NULL; static void _del_hook(Evas_Object *obj); static void _theme_hook(Evas_Object *obj); -//static void _show_region_hook(void *data, Evas_Object *obj); +static void _show_region_hook(void *data, Evas_Object *obj); static void _sizing_eval(Evas_Object *obj); static void _item_unrealize(Elm_Genlist_Item *it); static void _item_block_unrealize(Item_Block *itb); @@ -553,7 +553,6 @@ _theme_hook(Evas_Object *obj) _sizing_eval(obj); } -/* static void _show_region_hook(void *data, Evas_Object *obj) { @@ -561,9 +560,11 @@ _show_region_hook(void *data, Evas_Object *obj) Evas_Coord x, y, w, h; if (!wd) return; elm_widget_show_region_get(obj, &x, &y, &w, &h); + //x & y are screen coordinates, Add with pan coordinates + x += wd->pan_x; + y += wd->pan_y; elm_smart_scroller_child_region_show(wd->scr, x, y, w, h); } -*/ static void _sizing_eval(Evas_Object *obj) @@ -2579,6 +2580,7 @@ elm_genlist_add(Evas_Object *parent) elm_widget_del_hook_set(obj, _del_hook); elm_widget_del_pre_hook_set(obj, _del_pre_hook); elm_widget_theme_hook_set(obj, _theme_hook); + elm_widget_on_show_region_hook_set(obj, _show_region_hook, obj); wd->scr = elm_smart_scroller_add(e); elm_smart_scroller_widget_set(wd->scr, obj); @@ -3198,7 +3200,6 @@ elm_genlist_multi_select_get(const Evas_Object *obj) return wd->multi; } - /** * Get the selectd item in the genlist * @@ -6236,7 +6237,6 @@ elm_genlist_edit_selected_items_del(Evas_Object *obj) if (!wd) return; if (!wd->blocks) return; - EINA_INLIST_FOREACH(wd->blocks, itb) { if (!wd->blocks) break; @@ -6310,7 +6310,6 @@ elm_genlist_edit_selected_items_del(Evas_Object *obj) wd->calc_job = ecore_job_add(_calc_job, wd); } - EAPI void elm_genlist_selected_items_del(Evas_Object *obj) { @@ -6405,7 +6404,6 @@ elm_genlist_item_rename_mode_set(Elm_Genlist_Item *it, int emode) { it->renamed = EINA_FALSE; - EINA_LIST_FOREACH(it->wd->edit_field, l2, editfield) { entry = elm_editfield_entry_get(editfield); @@ -6479,6 +6477,7 @@ elm_genlist_item_rename_mode_set(Elm_Genlist_Item *it, int emode) elm_editfield_entry_single_line_set(editfield, EINA_TRUE); elm_editfield_eraser_set(editfield, EINA_TRUE); edje_object_part_swallow(it->edit_obj, rename_swallow_part, editfield); + elm_widget_sub_object_add(it->edit_obj, editfield); evas_object_show(editfield); diff --git a/src/lib/elm_widget.c b/src/lib/elm_widget.c index 91579e7..ba3fb11 100644 --- a/src/lib/elm_widget.c +++ b/src/lib/elm_widget.c @@ -42,9 +42,6 @@ struct _Smart_Data void *on_focus_data; void (*on_change_func) (void *data, Evas_Object *obj); void *on_change_data; -#ifdef HAVE_CONFORMANT_AUTOSCROLL - Evas_Object * (*imp_region_get_func) (const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h); -#endif void (*on_show_region_func) (void *data, Evas_Object *obj); void *on_show_region_data; void *data; @@ -253,15 +250,6 @@ elm_widget_on_change_hook_set(Evas_Object *obj, void (*func) (void *data, Evas_O sd->on_change_data = data; } -#ifdef HAVE_CONFORMANT_AUTOSCROLL -EAPI void -elm_widget_imp_region_get_hook_set(Evas_Object *obj, Evas_Object * (*func) (const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h), void *data) -{ - API_ENTRY return; - sd->imp_region_get_func = func; -} -#endif - EAPI void elm_widget_on_show_region_hook_set(Evas_Object *obj, void (*func) (void *data, Evas_Object *obj), void *data) { @@ -903,18 +891,6 @@ elm_widget_disabled_get(const Evas_Object *obj) return sd->disabled; } -#ifdef HAVE_CONFORMANT_AUTOSCROLL -EAPI Evas_Object * -elm_widget_imp_region_get(const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h) -{ - API_ENTRY return; - if (sd->imp_region_get_func) - return sd->imp_region_get_func(obj, x, y, w, h); - else - return NULL; -} -#endif - EAPI void elm_widget_show_region_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h) {