1 #include <Elementary.h>
3 #include "els_scroller.h"
5 typedef struct _Widget_Data Widget_Data;
11 const char *widget_name, *widget_base;
14 double pagerel_h, pagerel_v;
15 Evas_Coord pagesize_h, pagesize_v;
18 static const char *widtype = NULL;
19 static void _del_hook(Evas_Object *obj);
20 static void _theme_hook(Evas_Object *obj);
21 static void _show_region_hook(void *data, Evas_Object *obj);
22 static void _sizing_eval(Evas_Object *obj);
23 static void _sub_del(void *data, Evas_Object *obj, void *event_info);
24 static void _on_focus_hook(void *data, Evas_Object *obj);
25 static Eina_Bool _event_hook(Evas_Object *obj, Evas_Object *src,
26 Evas_Callback_Type type, void *event_info);
29 static const char SIG_SCROLL[] = "scroll";
30 static const char SIG_SCROLL_ANIM_START[] = "scroll,anim,start";
31 static const char SIG_SCROLL_ANIM_STOP[] = "scroll,anim,stop";
32 static const char SIG_SCROLL_DRAG_START[] = "scroll,drag,start";
33 static const char SIG_SCROLL_DRAG_STOP[] = "scroll,drag,stop";
34 static const char SIG_EDGE_LEFT[] = "edge,left";
35 static const char SIG_EDGE_RIGHT[] = "edge,right";
36 static const char SIG_EDGE_TOP[] = "edge,top";
37 static const char SIG_EDGE_BOTTOM[] = "edge,bottom";
38 static const Evas_Smart_Cb_Description _signals[] = {
40 {SIG_SCROLL_ANIM_START, ""},
41 {SIG_SCROLL_ANIM_STOP, ""},
42 {SIG_SCROLL_DRAG_START, ""},
43 {SIG_SCROLL_DRAG_STOP, ""},
47 {SIG_EDGE_BOTTOM, ""},
52 _event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type type, void *event_info)
54 if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
55 Evas_Event_Key_Down *ev = event_info;
56 Widget_Data *wd = elm_widget_data_get(obj);
57 if (!wd) return EINA_FALSE;
58 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
59 if (elm_widget_disabled_get(obj)) return EINA_FALSE;
63 Evas_Coord step_x = 0;
64 Evas_Coord step_y = 0;
69 Evas_Coord page_x = 0;
70 Evas_Coord page_y = 0;
72 elm_smart_scroller_child_pos_get(wd->scr, &x, &y);
73 elm_smart_scroller_step_size_get(wd->scr, &step_x, &step_y);
74 elm_smart_scroller_page_size_get(wd->scr, &page_x, &page_y);
75 elm_smart_scroller_child_viewport_size_get(wd->scr, &v_w, &v_h);
76 elm_scroller_child_size_get(obj, &max_x, &max_y);
78 if ((!strcmp(ev->keyname, "Left")) || (!strcmp(ev->keyname, "KP_Left")))
82 else if ((!strcmp(ev->keyname, "Right")) || (!strcmp(ev->keyname, "KP_Right")))
86 else if ((!strcmp(ev->keyname, "Up")) || (!strcmp(ev->keyname, "KP_Up")))
90 else if ((!strcmp(ev->keyname, "Down")) || (!strcmp(ev->keyname, "KP_Down")))
94 else if ((!strcmp(ev->keyname, "Home")) || (!strcmp(ev->keyname, "KP_Home")))
98 else if ((!strcmp(ev->keyname, "End")) || (!strcmp(ev->keyname, "KP_End")))
102 else if ((!strcmp(ev->keyname, "Prior")) || (!strcmp(ev->keyname, "KP_Prior")))
105 y -= -(page_y * v_h) / 100;
109 else if ((!strcmp(ev->keyname, "Next")) || (!strcmp(ev->keyname, "KP_Next")))
112 y += -(page_y * v_h) / 100;
116 else return EINA_FALSE;
118 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
119 elm_smart_scroller_child_pos_set(wd->scr, x, y);
124 _on_focus_hook(void *data __UNUSED__, Evas_Object *obj)
126 Widget_Data *wd = elm_widget_data_get(obj);
128 if (elm_widget_focus_get(obj))
130 edje_object_signal_emit(elm_smart_scroller_edje_object_get(wd->scr), "elm,action,focus", "elm");
131 evas_object_focus_set(wd->scr, EINA_TRUE);
135 edje_object_signal_emit(elm_smart_scroller_edje_object_get(wd->scr), "elm,action,unfocus", "elm");
136 evas_object_focus_set(wd->scr, EINA_FALSE);
141 _del_hook(Evas_Object *obj)
143 Widget_Data *wd = elm_widget_data_get(obj);
149 _mirrored_set(Evas_Object *obj, Eina_Bool mirrored)
151 Widget_Data *wd = elm_widget_data_get(obj);
154 elm_smart_scroller_mirrored_set(wd->scr, mirrored);
158 _theme_hook(Evas_Object *obj)
160 Widget_Data *wd = elm_widget_data_get(obj);
162 _elm_widget_mirrored_reload(obj);
168 _mirrored_set(obj, elm_widget_mirrored_get(obj));
169 elm_smart_scroller_object_theme_set(obj, wd->scr,
170 wd->widget_name, wd->widget_base,
171 elm_widget_style_get(obj));
172 // edje_object_scale_set(wd->scr, elm_widget_scale_get(obj) * _elm_config->scale);
173 edj = elm_smart_scroller_edje_object_get(wd->scr);
174 str = edje_object_data_get(edj, "focus_highlight");
175 if ((str) && (!strcmp(str, "on")))
176 elm_widget_highlight_in_theme_set(obj, EINA_TRUE);
178 elm_widget_highlight_in_theme_set(obj, EINA_FALSE);
184 _elm_scroller_focus_next_hook(const Evas_Object *obj, Elm_Focus_Direction dir, Evas_Object **next)
186 Widget_Data *wd = elm_widget_data_get(obj);
189 if ((!wd) || (!wd->content))
194 /* Try Focus cycle in subitem */
195 if ((elm_widget_can_focus_get(cur)) || (elm_widget_child_can_focus_get(cur)))
196 return elm_widget_focus_next_get(cur, dir, next);
199 *next = (Evas_Object *)obj;
200 return !elm_widget_focus_get(obj);
204 _signal_emit_hook(Evas_Object *obj, const char *emission, const char *source)
206 Widget_Data *wd = elm_widget_data_get(obj);
208 edje_object_signal_emit(elm_smart_scroller_edje_object_get(wd->scr),
213 _signal_callback_add_hook(Evas_Object *obj, const char *emission, const char *source, Edje_Signal_Cb func_cb, void *data)
215 Widget_Data *wd = elm_widget_data_get(obj);
217 edje_object_signal_callback_add(elm_smart_scroller_edje_object_get(wd->scr),
218 emission, source, func_cb, data);
222 _signal_callback_del_hook(Evas_Object *obj, const char *emission, const char *source, Edje_Signal_Cb func_cb, void *data)
224 Widget_Data *wd = elm_widget_data_get(obj);
225 edje_object_signal_callback_del_full(
226 elm_smart_scroller_edje_object_get(wd->scr), emission, source,
231 _show_region_hook(void *data, Evas_Object *obj)
233 Widget_Data *wd = elm_widget_data_get(data);
234 Evas_Coord x, y, w, h;
236 elm_widget_show_region_get(obj, &x, &y, &w, &h);
238 elm_smart_scroller_child_region_show(wd->scr, x, y, w, h);
242 _focus_region_hook(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h)
244 Widget_Data *wd = elm_widget_data_get(obj);
246 elm_smart_scroller_child_region_show(wd->scr, x, y, w, h);
250 _sizing_eval(Evas_Object *obj)
252 Widget_Data *wd = elm_widget_data_get(obj);
253 Evas_Coord vw = 0, vh = 0, minw = 0, minh = 0, maxw = 0, maxh = 0, w, h, vmw, vmh;
254 double xw = 0.0, yw = 0.0;
259 evas_object_size_hint_min_get(wd->content, &minw, &minh);
260 evas_object_size_hint_max_get(wd->content, &maxw, &maxh);
261 evas_object_size_hint_weight_get(wd->content, &xw, &yw);
265 elm_smart_scroller_child_viewport_size_get(wd->scr, &vw, &vh);
268 if ((minw > 0) && (vw < minw)) vw = minw;
269 else if ((maxw > 0) && (vw > maxw)) vw = maxw;
271 else if (minw > 0) vw = minw;
274 if ((minh > 0) && (vh < minh)) vh = minh;
275 else if ((maxh > 0) && (vh > maxh)) vh = maxh;
277 else if (minh > 0) vh = minh;
278 if (wd->content) evas_object_resize(wd->content, vw, vh);
281 edje_object_size_min_calc(elm_smart_scroller_edje_object_get(wd->scr), &vmw, &vmh);
282 if (wd->min_w) w = vmw + minw;
283 if (wd->min_h) h = vmh + minh;
284 evas_object_size_hint_max_get(obj, &maxw, &maxh);
285 if ((maxw > 0) && (w > maxw)) w = maxw;
286 if ((maxh > 0) && (h > maxh)) h = maxh;
287 evas_object_size_hint_min_set(obj, w, h);
292 _changed_size_hints(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
298 _sub_del(void *data __UNUSED__, Evas_Object *obj, void *event_info)
300 Widget_Data *wd = elm_widget_data_get(obj);
301 Evas_Object *sub = event_info;
304 if (sub == wd->content)
306 elm_widget_on_show_region_hook_set(wd->content, NULL, NULL);
307 evas_object_event_callback_del_full (sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
308 _changed_size_hints, obj);
312 else if (sub == wd->scr)
317 _hold_on(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
319 Widget_Data *wd = elm_widget_data_get(obj);
323 elm_smart_scroller_hold_set(wd->scr, 1);
327 _hold_off(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
329 Widget_Data *wd = elm_widget_data_get(obj);
333 elm_smart_scroller_hold_set(wd->scr, 0);
337 _freeze_on(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
339 Widget_Data *wd = elm_widget_data_get(obj);
343 elm_smart_scroller_freeze_set(wd->scr, 1);
347 _freeze_off(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
349 Widget_Data *wd = elm_widget_data_get(obj);
353 elm_smart_scroller_freeze_set(wd->scr, 0);
357 _resize(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
363 _edge_left(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
365 evas_object_smart_callback_call(data, SIG_EDGE_LEFT, NULL);
369 _edge_right(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
371 evas_object_smart_callback_call(data, SIG_EDGE_RIGHT, NULL);
375 _edge_top(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
377 evas_object_smart_callback_call(data, SIG_EDGE_TOP, NULL);
381 _edge_bottom(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
383 evas_object_smart_callback_call(data, SIG_EDGE_BOTTOM, NULL);
387 _scroll(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
389 evas_object_smart_callback_call(data, SIG_SCROLL, NULL);
393 _scroll_anim_start(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
395 evas_object_smart_callback_call(data, SIG_SCROLL_ANIM_START, NULL);
399 _scroll_anim_stop(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
401 evas_object_smart_callback_call(data, SIG_SCROLL_ANIM_STOP, NULL);
405 _scroll_drag_start(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
407 evas_object_smart_callback_call(data, SIG_SCROLL_DRAG_START, NULL);
411 _scroll_drag_stop(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
413 evas_object_smart_callback_call(data, SIG_SCROLL_DRAG_STOP, NULL);
417 _elm_scroller_edje_object_get(Evas_Object *obj)
419 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
420 Widget_Data *wd = elm_widget_data_get(obj);
421 if (!wd) return NULL;
422 return elm_smart_scroller_edje_object_get(wd->scr);
426 _content_set_hook(Evas_Object *obj, const char *part __UNUSED__, Evas_Object *content)
428 ELM_CHECK_WIDTYPE(obj, widtype);
429 Widget_Data *wd = elm_widget_data_get(obj);
431 if (wd->content == content) return;
432 if (wd->content) evas_object_del(wd->content);
433 wd->content = content;
436 elm_widget_on_show_region_hook_set(content, _show_region_hook, obj);
437 elm_widget_sub_object_add(obj, content);
439 elm_smart_scroller_child_set(wd->scr, content);
440 evas_object_event_callback_add(content,
441 EVAS_CALLBACK_CHANGED_SIZE_HINTS,
442 _changed_size_hints, obj);
448 _content_get_hook(const Evas_Object *obj, const char *part __UNUSED__)
450 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
451 Widget_Data *wd = elm_widget_data_get(obj);
452 if (!wd) return NULL;
457 _content_unset_hook(Evas_Object *obj, const char *part __UNUSED__)
459 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
460 Widget_Data *wd = elm_widget_data_get(obj);
461 Evas_Object *content;
462 if (!wd) return NULL;
463 if (!wd->content) return NULL;
464 content = wd->content;
465 elm_widget_sub_object_del(obj, wd->content);
466 evas_object_event_callback_del_full(wd->content,
467 EVAS_CALLBACK_CHANGED_SIZE_HINTS,
468 _changed_size_hints, obj);
469 edje_object_part_unswallow(elm_smart_scroller_edje_object_get(wd->scr),
476 elm_scroller_add(Evas_Object *parent)
481 Evas_Coord minw, minh;
483 ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
485 ELM_SET_WIDTYPE(widtype, "scroller");
486 elm_widget_type_set(obj, "scroller");
487 elm_widget_sub_object_add(parent, obj);
488 elm_widget_on_focus_hook_set(obj, _on_focus_hook, NULL);
489 elm_widget_data_set(obj, wd);
490 elm_widget_del_hook_set(obj, _del_hook);
491 elm_widget_theme_hook_set(obj, _theme_hook);
492 elm_widget_signal_emit_hook_set(obj, _signal_emit_hook);
493 elm_widget_signal_callback_add_hook_set(obj, _signal_callback_add_hook);
494 elm_widget_signal_callback_del_hook_set(obj, _signal_callback_del_hook);
495 elm_widget_focus_next_hook_set(obj, _elm_scroller_focus_next_hook);
496 elm_widget_can_focus_set(obj, EINA_TRUE);
497 elm_widget_event_hook_set(obj, _event_hook);
498 elm_widget_focus_region_hook_set(obj, _focus_region_hook);
499 elm_widget_content_set_hook_set(obj, _content_set_hook);
500 elm_widget_content_get_hook_set(obj, _content_get_hook);
501 elm_widget_content_unset_hook_set(obj, _content_unset_hook);
503 wd->widget_name = eina_stringshare_add("scroller");
504 wd->widget_base = eina_stringshare_add("base");
506 wd->scr = elm_smart_scroller_add(e);
507 elm_smart_scroller_widget_set(wd->scr, obj);
509 elm_widget_resize_object_set(obj, wd->scr);
510 evas_object_event_callback_add(wd->scr, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
511 _changed_size_hints, obj);
513 edje_object_size_min_calc(elm_smart_scroller_edje_object_get(wd->scr), &minw, &minh);
514 evas_object_size_hint_min_set(obj, minw, minh);
515 evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, _resize, obj);
517 evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
518 evas_object_smart_callback_add(obj, "scroll-hold-on", _hold_on, obj);
519 evas_object_smart_callback_add(obj, "scroll-hold-off", _hold_off, obj);
520 evas_object_smart_callback_add(obj, "scroll-freeze-on", _freeze_on, obj);
521 evas_object_smart_callback_add(obj, "scroll-freeze-off", _freeze_off, obj);
523 evas_object_smart_callback_add(wd->scr, "edge,left", _edge_left, obj);
524 evas_object_smart_callback_add(wd->scr, "edge,right", _edge_right, obj);
525 evas_object_smart_callback_add(wd->scr, "edge,top", _edge_top, obj);
526 evas_object_smart_callback_add(wd->scr, "edge,bottom", _edge_bottom, obj);
527 evas_object_smart_callback_add(wd->scr, "scroll", _scroll, obj);
528 evas_object_smart_callback_add(wd->scr, "animate,start", _scroll_anim_start, obj);
529 evas_object_smart_callback_add(wd->scr, "animate,stop", _scroll_anim_stop, obj);
530 evas_object_smart_callback_add(wd->scr, "drag,start", _scroll_drag_start, obj);
531 evas_object_smart_callback_add(wd->scr, "drag,stop", _scroll_drag_stop, obj);
535 // TODO: convert Elementary to subclassing of Evas_Smart_Class
536 // TODO: and save some bytes, making descriptions per-class and not instance!
537 evas_object_smart_callbacks_descriptions_set(obj, _signals);
538 _mirrored_set(obj, elm_widget_mirrored_get(obj));
543 elm_scroller_content_set(Evas_Object *obj, Evas_Object *content)
545 _content_set_hook(obj, NULL, content);
549 elm_scroller_content_get(const Evas_Object *obj)
551 return _content_get_hook(obj, NULL);
555 elm_scroller_content_unset(Evas_Object *obj)
557 return _content_unset_hook(obj, NULL);
561 elm_scroller_custom_widget_base_theme_set(Evas_Object *obj, const char *widget, const char *base)
563 ELM_CHECK_WIDTYPE(obj, widtype);
564 Widget_Data *wd = elm_widget_data_get(obj);
566 EINA_SAFETY_ON_NULL_RETURN(widget);
567 EINA_SAFETY_ON_NULL_RETURN(base);
568 if (eina_stringshare_replace(&wd->widget_name, widget) |
569 eina_stringshare_replace(&wd->widget_base, base))
574 elm_scroller_content_min_limit(Evas_Object *obj, Eina_Bool w, Eina_Bool h)
576 ELM_CHECK_WIDTYPE(obj, widtype);
577 Widget_Data *wd = elm_widget_data_get(obj);
585 elm_scroller_region_show(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h)
587 ELM_CHECK_WIDTYPE(obj, widtype);
588 Widget_Data *wd = elm_widget_data_get(obj);
589 if ((!wd) || (!wd->scr)) return;
590 elm_smart_scroller_child_region_show(wd->scr, x, y, w, h);
594 elm_scroller_policy_set(Evas_Object *obj, Elm_Scroller_Policy policy_h, Elm_Scroller_Policy policy_v)
596 ELM_CHECK_WIDTYPE(obj, widtype);
597 Widget_Data *wd = elm_widget_data_get(obj);
598 if ((!wd) || (!wd->scr)) return;
599 if ((policy_h >= ELM_SCROLLER_POLICY_LAST) ||
600 (policy_v >= ELM_SCROLLER_POLICY_LAST))
602 elm_smart_scroller_policy_set(wd->scr, policy_h, policy_v);
606 elm_scroller_policy_get(const Evas_Object *obj, Elm_Scroller_Policy *policy_h, Elm_Scroller_Policy *policy_v)
608 ELM_CHECK_WIDTYPE(obj, widtype);
609 Widget_Data *wd = elm_widget_data_get(obj);
610 if ((!wd) || (!wd->scr)) return;
611 elm_smart_scroller_policy_get(wd->scr,
612 (Elm_Smart_Scroller_Policy *) policy_h,
613 (Elm_Smart_Scroller_Policy *) policy_v);
617 elm_scroller_region_get(const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
619 ELM_CHECK_WIDTYPE(obj, widtype);
620 Widget_Data *wd = elm_widget_data_get(obj);
621 if ((!wd) || (!wd->scr)) return;
622 if ((x) || (y)) elm_smart_scroller_child_pos_get(wd->scr, x, y);
623 if ((w) || (h)) elm_smart_scroller_child_viewport_size_get(wd->scr, w, h);
627 elm_scroller_child_size_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h)
629 ELM_CHECK_WIDTYPE(obj, widtype);
630 Widget_Data *wd = elm_widget_data_get(obj);
632 evas_object_geometry_get(wd->content, NULL, NULL, w, h);
636 elm_scroller_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce)
638 ELM_CHECK_WIDTYPE(obj, widtype);
639 Widget_Data *wd = elm_widget_data_get(obj);
640 if ((!wd) || (!wd->scr)) return;
641 elm_smart_scroller_bounce_allow_set(wd->scr, h_bounce, v_bounce);
645 elm_scroller_bounce_get(const Evas_Object *obj, Eina_Bool *h_bounce, Eina_Bool *v_bounce)
647 ELM_CHECK_WIDTYPE(obj, widtype);
648 Widget_Data *wd = elm_widget_data_get(obj);
650 elm_smart_scroller_bounce_allow_get(wd->scr, h_bounce, v_bounce);
654 elm_scroller_page_relative_set(Evas_Object *obj, double h_pagerel, double v_pagerel)
656 ELM_CHECK_WIDTYPE(obj, widtype);
657 Widget_Data *wd = elm_widget_data_get(obj);
659 wd->pagerel_h = h_pagerel;
660 wd->pagerel_v = v_pagerel;
662 elm_smart_scroller_paging_set(wd->scr, wd->pagerel_h, wd->pagerel_v,
663 wd->pagesize_h, wd->pagesize_v);
667 elm_scroller_page_size_set(Evas_Object *obj, Evas_Coord h_pagesize, Evas_Coord v_pagesize)
669 ELM_CHECK_WIDTYPE(obj, widtype);
670 Widget_Data *wd = elm_widget_data_get(obj);
672 wd->pagesize_h = h_pagesize;
673 wd->pagesize_v = v_pagesize;
675 elm_smart_scroller_paging_set(wd->scr, wd->pagerel_h, wd->pagerel_v,
676 wd->pagesize_h, wd->pagesize_v);
680 elm_scroller_current_page_get(const Evas_Object *obj, int *h_pagenumber, int *v_pagenumber)
682 ELM_CHECK_WIDTYPE(obj, widtype);
683 Widget_Data *wd = elm_widget_data_get(obj);
686 elm_smart_scroller_current_page_get(wd->scr, h_pagenumber, v_pagenumber);
690 elm_scroller_last_page_get(const Evas_Object *obj, int *h_pagenumber, int *v_pagenumber)
692 ELM_CHECK_WIDTYPE(obj, widtype);
693 Widget_Data *wd = elm_widget_data_get(obj);
696 elm_smart_scroller_last_page_get(wd->scr, h_pagenumber, v_pagenumber);
700 elm_scroller_page_show(Evas_Object *obj, int h_pagenumber, int v_pagenumber)
702 ELM_CHECK_WIDTYPE(obj, widtype);
703 Widget_Data *wd = elm_widget_data_get(obj);
706 elm_smart_scroller_page_show(wd->scr, h_pagenumber, v_pagenumber);
710 elm_scroller_page_bring_in(Evas_Object *obj, int h_pagenumber, int v_pagenumber)
712 ELM_CHECK_WIDTYPE(obj, widtype);
713 Widget_Data *wd = elm_widget_data_get(obj);
716 elm_smart_scroller_page_bring_in(wd->scr, h_pagenumber, v_pagenumber);
720 elm_scroller_region_bring_in(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h)
722 ELM_CHECK_WIDTYPE(obj, widtype);
723 Widget_Data *wd = elm_widget_data_get(obj);
724 if ((!wd) || (!wd->scr)) return;
725 elm_smart_scroller_region_bring_in(wd->scr, x, y, w, h);
729 elm_scroller_propagate_events_set(Evas_Object *obj, Eina_Bool propagation)
731 ELM_CHECK_WIDTYPE(obj, widtype);
732 Widget_Data *wd = elm_widget_data_get(obj);
735 evas_object_propagate_events_set(wd->scr, propagation);
739 elm_scroller_propagate_events_get(const Evas_Object *obj)
741 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
742 Widget_Data *wd = elm_widget_data_get(obj);
743 if (!wd) return EINA_FALSE;
745 return evas_object_propagate_events_get(wd->scr);
749 elm_scroller_gravity_set(Evas_Object *obj, double x, double y)
751 ELM_CHECK_WIDTYPE(obj, widtype);
752 Widget_Data *wd = elm_widget_data_get(obj);
755 elm_smart_scroller_gravity_set(wd->scr, x, y);
759 elm_scroller_gravity_get(const Evas_Object *obj, double *x, double *y)
761 ELM_CHECK_WIDTYPE(obj, widtype);
762 Widget_Data *wd = elm_widget_data_get(obj);
765 elm_smart_scroller_gravity_get(wd->scr, x, y);