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")) ||
79 ((!strcmp(ev->keyname, "KP_Left")) && (!ev->string)))
83 else if ((!strcmp(ev->keyname, "Right")) ||
84 ((!strcmp(ev->keyname, "KP_Right")) && (!ev->string)))
88 else if ((!strcmp(ev->keyname, "Up")) ||
89 ((!strcmp(ev->keyname, "KP_Up")) && (!ev->string)))
93 else if ((!strcmp(ev->keyname, "Down")) ||
94 ((!strcmp(ev->keyname, "KP_Down")) && (!ev->string)))
98 else if ((!strcmp(ev->keyname, "Home")) ||
99 ((!strcmp(ev->keyname, "KP_Home")) && (!ev->string)))
103 else if ((!strcmp(ev->keyname, "End")) ||
104 ((!strcmp(ev->keyname, "KP_End")) && (!ev->string)))
108 else if ((!strcmp(ev->keyname, "Prior")) ||
109 ((!strcmp(ev->keyname, "KP_Prior")) && (!ev->string)))
112 y -= -(page_y * v_h) / 100;
116 else if ((!strcmp(ev->keyname, "Next")) ||
117 ((!strcmp(ev->keyname, "KP_Next")) && (!ev->string)))
120 y += -(page_y * v_h) / 100;
124 else return EINA_FALSE;
126 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
127 elm_smart_scroller_child_pos_set(wd->scr, x, y);
132 _on_focus_hook(void *data __UNUSED__, Evas_Object *obj)
134 Widget_Data *wd = elm_widget_data_get(obj);
136 if (elm_widget_focus_get(obj))
138 edje_object_signal_emit(elm_smart_scroller_edje_object_get(wd->scr), "elm,action,focus", "elm");
139 evas_object_focus_set(wd->scr, EINA_TRUE);
143 edje_object_signal_emit(elm_smart_scroller_edje_object_get(wd->scr), "elm,action,unfocus", "elm");
144 evas_object_focus_set(wd->scr, EINA_FALSE);
149 _del_hook(Evas_Object *obj)
151 Widget_Data *wd = elm_widget_data_get(obj);
157 _mirrored_set(Evas_Object *obj, Eina_Bool mirrored)
159 Widget_Data *wd = elm_widget_data_get(obj);
162 elm_smart_scroller_mirrored_set(wd->scr, mirrored);
166 _theme_hook(Evas_Object *obj)
168 Widget_Data *wd = elm_widget_data_get(obj);
170 _elm_widget_mirrored_reload(obj);
176 _mirrored_set(obj, elm_widget_mirrored_get(obj));
177 elm_smart_scroller_object_theme_set(obj, wd->scr,
178 wd->widget_name, wd->widget_base,
179 elm_widget_style_get(obj));
180 // edje_object_scale_set(wd->scr, elm_widget_scale_get(obj) * _elm_config->scale);
181 edj = elm_smart_scroller_edje_object_get(wd->scr);
182 str = edje_object_data_get(edj, "focus_highlight");
183 if ((str) && (!strcmp(str, "on")))
184 elm_widget_highlight_in_theme_set(obj, EINA_TRUE);
186 elm_widget_highlight_in_theme_set(obj, EINA_FALSE);
192 _elm_scroller_focus_next_hook(const Evas_Object *obj, Elm_Focus_Direction dir, Evas_Object **next)
194 Widget_Data *wd = elm_widget_data_get(obj);
197 if ((!wd) || (!wd->content))
202 /* Try Focus cycle in subitem */
203 if (elm_widget_focus_get(obj))
205 if ((elm_widget_can_focus_get(cur)) || (elm_widget_child_can_focus_get(cur)))
206 return elm_widget_focus_next_get(cur, dir, next);
210 *next = (Evas_Object *)obj;
211 return !elm_widget_focus_get(obj);
215 _signal_emit_hook(Evas_Object *obj, const char *emission, const char *source)
217 Widget_Data *wd = elm_widget_data_get(obj);
219 edje_object_signal_emit(elm_smart_scroller_edje_object_get(wd->scr),
224 _signal_callback_add_hook(Evas_Object *obj, const char *emission, const char *source, Edje_Signal_Cb func_cb, void *data)
226 Widget_Data *wd = elm_widget_data_get(obj);
228 edje_object_signal_callback_add(elm_smart_scroller_edje_object_get(wd->scr),
229 emission, source, func_cb, data);
233 _signal_callback_del_hook(Evas_Object *obj, const char *emission, const char *source, Edje_Signal_Cb func_cb, void *data)
235 Widget_Data *wd = elm_widget_data_get(obj);
236 edje_object_signal_callback_del_full(
237 elm_smart_scroller_edje_object_get(wd->scr), emission, source,
242 _show_region_hook(void *data, Evas_Object *obj)
244 Widget_Data *wd = elm_widget_data_get(data);
245 Evas_Coord x, y, w, h;
247 elm_widget_show_region_get(obj, &x, &y, &w, &h);
249 elm_smart_scroller_child_region_show(wd->scr, x, y, w, h);
253 _focus_region_hook(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h)
255 Widget_Data *wd = elm_widget_data_get(obj);
257 elm_smart_scroller_child_region_show(wd->scr, x, y, w, h);
261 _sizing_eval(Evas_Object *obj)
263 Widget_Data *wd = elm_widget_data_get(obj);
264 Evas_Coord vw = 0, vh = 0, minw = 0, minh = 0, maxw = 0, maxh = 0, w, h, vmw, vmh;
265 double xw = 0.0, yw = 0.0;
270 evas_object_size_hint_min_get(wd->content, &minw, &minh);
271 evas_object_size_hint_max_get(wd->content, &maxw, &maxh);
272 evas_object_size_hint_weight_get(wd->content, &xw, &yw);
276 elm_smart_scroller_child_viewport_size_get(wd->scr, &vw, &vh);
279 if ((minw > 0) && (vw < minw)) vw = minw;
280 else if ((maxw > 0) && (vw > maxw)) vw = maxw;
282 else if (minw > 0) vw = minw;
285 if ((minh > 0) && (vh < minh)) vh = minh;
286 else if ((maxh > 0) && (vh > maxh)) vh = maxh;
288 else if (minh > 0) vh = minh;
289 if (wd->content) evas_object_resize(wd->content, vw, vh);
292 edje_object_size_min_calc(elm_smart_scroller_edje_object_get(wd->scr), &vmw, &vmh);
293 if (wd->min_w) w = vmw + minw;
294 if (wd->min_h) h = vmh + minh;
295 evas_object_size_hint_max_get(obj, &maxw, &maxh);
296 if ((maxw > 0) && (w > maxw)) w = maxw;
297 if ((maxh > 0) && (h > maxh)) h = maxh;
298 evas_object_size_hint_min_set(obj, w, h);
303 _changed_size_hints(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
309 _sub_del(void *data __UNUSED__, Evas_Object *obj, void *event_info)
311 Widget_Data *wd = elm_widget_data_get(obj);
312 Evas_Object *sub = event_info;
315 if (sub == wd->content)
317 elm_widget_on_show_region_hook_set(wd->content, NULL, NULL);
318 evas_object_event_callback_del_full (sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
319 _changed_size_hints, obj);
323 else if (sub == wd->scr)
328 _hold_on(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
330 Widget_Data *wd = elm_widget_data_get(obj);
334 elm_smart_scroller_hold_set(wd->scr, 1);
338 _hold_off(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
340 Widget_Data *wd = elm_widget_data_get(obj);
344 elm_smart_scroller_hold_set(wd->scr, 0);
348 _freeze_on(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
350 Widget_Data *wd = elm_widget_data_get(obj);
354 elm_smart_scroller_freeze_set(wd->scr, 1);
358 _freeze_off(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
360 Widget_Data *wd = elm_widget_data_get(obj);
364 elm_smart_scroller_freeze_set(wd->scr, 0);
368 _resize(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
374 _edge_left(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
376 evas_object_smart_callback_call(data, SIG_EDGE_LEFT, NULL);
380 _edge_right(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
382 evas_object_smart_callback_call(data, SIG_EDGE_RIGHT, NULL);
386 _edge_top(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
388 evas_object_smart_callback_call(data, SIG_EDGE_TOP, NULL);
392 _edge_bottom(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
394 evas_object_smart_callback_call(data, SIG_EDGE_BOTTOM, NULL);
398 _scroll(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
400 evas_object_smart_callback_call(data, SIG_SCROLL, NULL);
404 _scroll_anim_start(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
406 evas_object_smart_callback_call(data, SIG_SCROLL_ANIM_START, NULL);
410 _scroll_anim_stop(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
412 evas_object_smart_callback_call(data, SIG_SCROLL_ANIM_STOP, NULL);
416 _scroll_drag_start(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
418 evas_object_smart_callback_call(data, SIG_SCROLL_DRAG_START, NULL);
422 _scroll_drag_stop(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
424 evas_object_smart_callback_call(data, SIG_SCROLL_DRAG_STOP, NULL);
428 _elm_scroller_edje_object_get(Evas_Object *obj)
430 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
431 Widget_Data *wd = elm_widget_data_get(obj);
432 if (!wd) return NULL;
433 return elm_smart_scroller_edje_object_get(wd->scr);
437 _content_set_hook(Evas_Object *obj, const char *part, Evas_Object *content)
439 ELM_CHECK_WIDTYPE(obj, widtype);
441 if (part && strcmp(part, "default")) return;
442 wd = elm_widget_data_get(obj);
444 if (wd->content == content) return;
445 if (wd->content) evas_object_del(wd->content);
446 wd->content = content;
449 elm_widget_on_show_region_hook_set(content, _show_region_hook, obj);
450 elm_widget_sub_object_add(obj, content);
452 elm_smart_scroller_child_set(wd->scr, content);
453 evas_object_event_callback_add(content,
454 EVAS_CALLBACK_CHANGED_SIZE_HINTS,
455 _changed_size_hints, obj);
461 _content_get_hook(const Evas_Object *obj, const char *part)
463 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
465 if (part && strcmp(part, "default")) return NULL;
466 wd = elm_widget_data_get(obj);
467 if (!wd) return NULL;
472 _content_unset_hook(Evas_Object *obj, const char *part)
474 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
476 Evas_Object *content;
477 if (part && strcmp(part, "default")) return NULL;
478 wd = elm_widget_data_get(obj);
479 if (!wd) return NULL;
480 if (!wd->content) return NULL;
481 content = wd->content;
482 elm_widget_sub_object_del(obj, wd->content);
483 evas_object_event_callback_del_full(wd->content,
484 EVAS_CALLBACK_CHANGED_SIZE_HINTS,
485 _changed_size_hints, obj);
486 edje_object_part_unswallow(elm_smart_scroller_edje_object_get(wd->scr),
493 elm_scroller_add(Evas_Object *parent)
498 Evas_Coord minw, minh;
500 ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
502 ELM_SET_WIDTYPE(widtype, "scroller");
503 elm_widget_type_set(obj, "scroller");
504 elm_widget_sub_object_add(parent, obj);
505 elm_widget_on_focus_hook_set(obj, _on_focus_hook, NULL);
506 elm_widget_data_set(obj, wd);
507 elm_widget_del_hook_set(obj, _del_hook);
508 elm_widget_theme_hook_set(obj, _theme_hook);
509 elm_widget_signal_emit_hook_set(obj, _signal_emit_hook);
510 elm_widget_signal_callback_add_hook_set(obj, _signal_callback_add_hook);
511 elm_widget_signal_callback_del_hook_set(obj, _signal_callback_del_hook);
512 elm_widget_focus_next_hook_set(obj, _elm_scroller_focus_next_hook);
513 elm_widget_can_focus_set(obj, EINA_TRUE);
514 elm_widget_event_hook_set(obj, _event_hook);
515 elm_widget_focus_region_hook_set(obj, _focus_region_hook);
516 elm_widget_content_set_hook_set(obj, _content_set_hook);
517 elm_widget_content_get_hook_set(obj, _content_get_hook);
518 elm_widget_content_unset_hook_set(obj, _content_unset_hook);
520 wd->widget_name = eina_stringshare_add("scroller");
521 wd->widget_base = eina_stringshare_add("base");
523 wd->scr = elm_smart_scroller_add(e);
524 elm_smart_scroller_widget_set(wd->scr, obj);
526 elm_widget_resize_object_set(obj, wd->scr);
527 evas_object_event_callback_add(wd->scr, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
528 _changed_size_hints, obj);
530 edje_object_size_min_calc(elm_smart_scroller_edje_object_get(wd->scr), &minw, &minh);
531 evas_object_size_hint_min_set(obj, minw, minh);
532 evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, _resize, obj);
534 evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
535 evas_object_smart_callback_add(obj, "scroll-hold-on", _hold_on, obj);
536 evas_object_smart_callback_add(obj, "scroll-hold-off", _hold_off, obj);
537 evas_object_smart_callback_add(obj, "scroll-freeze-on", _freeze_on, obj);
538 evas_object_smart_callback_add(obj, "scroll-freeze-off", _freeze_off, obj);
540 evas_object_smart_callback_add(wd->scr, "edge,left", _edge_left, obj);
541 evas_object_smart_callback_add(wd->scr, "edge,right", _edge_right, obj);
542 evas_object_smart_callback_add(wd->scr, "edge,top", _edge_top, obj);
543 evas_object_smart_callback_add(wd->scr, "edge,bottom", _edge_bottom, obj);
544 evas_object_smart_callback_add(wd->scr, "scroll", _scroll, obj);
545 evas_object_smart_callback_add(wd->scr, "animate,start", _scroll_anim_start, obj);
546 evas_object_smart_callback_add(wd->scr, "animate,stop", _scroll_anim_stop, obj);
547 evas_object_smart_callback_add(wd->scr, "drag,start", _scroll_drag_start, obj);
548 evas_object_smart_callback_add(wd->scr, "drag,stop", _scroll_drag_stop, obj);
552 // TODO: convert Elementary to subclassing of Evas_Smart_Class
553 // TODO: and save some bytes, making descriptions per-class and not instance!
554 evas_object_smart_callbacks_descriptions_set(obj, _signals);
555 _mirrored_set(obj, elm_widget_mirrored_get(obj));
560 elm_scroller_custom_widget_base_theme_set(Evas_Object *obj, const char *widget, const char *base)
562 ELM_CHECK_WIDTYPE(obj, widtype);
563 Widget_Data *wd = elm_widget_data_get(obj);
565 EINA_SAFETY_ON_NULL_RETURN(widget);
566 EINA_SAFETY_ON_NULL_RETURN(base);
567 if (eina_stringshare_replace(&wd->widget_name, widget) |
568 eina_stringshare_replace(&wd->widget_base, base))
573 elm_scroller_content_min_limit(Evas_Object *obj, Eina_Bool w, Eina_Bool h)
575 ELM_CHECK_WIDTYPE(obj, widtype);
576 Widget_Data *wd = elm_widget_data_get(obj);
584 elm_scroller_region_show(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h)
586 ELM_CHECK_WIDTYPE(obj, widtype);
587 Widget_Data *wd = elm_widget_data_get(obj);
588 if ((!wd) || (!wd->scr)) return;
589 elm_smart_scroller_child_region_show(wd->scr, x, y, w, h);
593 elm_scroller_policy_set(Evas_Object *obj, Elm_Scroller_Policy policy_h, Elm_Scroller_Policy policy_v)
595 ELM_CHECK_WIDTYPE(obj, widtype);
596 Widget_Data *wd = elm_widget_data_get(obj);
597 if ((!wd) || (!wd->scr)) return;
598 if ((policy_h >= ELM_SCROLLER_POLICY_LAST) ||
599 (policy_v >= ELM_SCROLLER_POLICY_LAST))
601 elm_smart_scroller_policy_set(wd->scr, policy_h, policy_v);
605 elm_scroller_policy_get(const Evas_Object *obj, Elm_Scroller_Policy *policy_h, Elm_Scroller_Policy *policy_v)
607 ELM_CHECK_WIDTYPE(obj, widtype);
608 Widget_Data *wd = elm_widget_data_get(obj);
609 if ((!wd) || (!wd->scr)) return;
610 elm_smart_scroller_policy_get(wd->scr,
611 (Elm_Smart_Scroller_Policy *) policy_h,
612 (Elm_Smart_Scroller_Policy *) policy_v);
616 elm_scroller_region_get(const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
618 ELM_CHECK_WIDTYPE(obj, widtype);
619 Widget_Data *wd = elm_widget_data_get(obj);
620 if ((!wd) || (!wd->scr)) return;
621 if ((x) || (y)) elm_smart_scroller_child_pos_get(wd->scr, x, y);
622 if ((w) || (h)) elm_smart_scroller_child_viewport_size_get(wd->scr, w, h);
626 elm_scroller_child_size_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h)
628 ELM_CHECK_WIDTYPE(obj, widtype);
629 Widget_Data *wd = elm_widget_data_get(obj);
631 evas_object_geometry_get(wd->content, NULL, NULL, w, h);
635 elm_scroller_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce)
637 ELM_CHECK_WIDTYPE(obj, widtype);
638 Widget_Data *wd = elm_widget_data_get(obj);
639 if ((!wd) || (!wd->scr)) return;
640 elm_smart_scroller_bounce_allow_set(wd->scr, h_bounce, v_bounce);
644 elm_scroller_bounce_get(const Evas_Object *obj, Eina_Bool *h_bounce, Eina_Bool *v_bounce)
646 ELM_CHECK_WIDTYPE(obj, widtype);
647 Widget_Data *wd = elm_widget_data_get(obj);
649 elm_smart_scroller_bounce_allow_get(wd->scr, h_bounce, v_bounce);
653 elm_scroller_page_relative_set(Evas_Object *obj, double h_pagerel, double v_pagerel)
655 ELM_CHECK_WIDTYPE(obj, widtype);
656 Widget_Data *wd = elm_widget_data_get(obj);
658 wd->pagerel_h = h_pagerel;
659 wd->pagerel_v = v_pagerel;
661 elm_smart_scroller_paging_set(wd->scr, wd->pagerel_h, wd->pagerel_v,
662 wd->pagesize_h, wd->pagesize_v);
666 elm_scroller_page_size_set(Evas_Object *obj, Evas_Coord h_pagesize, Evas_Coord v_pagesize)
668 ELM_CHECK_WIDTYPE(obj, widtype);
669 Widget_Data *wd = elm_widget_data_get(obj);
671 wd->pagesize_h = h_pagesize;
672 wd->pagesize_v = v_pagesize;
674 elm_smart_scroller_paging_set(wd->scr, wd->pagerel_h, wd->pagerel_v,
675 wd->pagesize_h, wd->pagesize_v);
679 elm_scroller_current_page_get(const Evas_Object *obj, int *h_pagenumber, int *v_pagenumber)
681 ELM_CHECK_WIDTYPE(obj, widtype);
682 Widget_Data *wd = elm_widget_data_get(obj);
685 elm_smart_scroller_current_page_get(wd->scr, h_pagenumber, v_pagenumber);
689 elm_scroller_last_page_get(const Evas_Object *obj, int *h_pagenumber, int *v_pagenumber)
691 ELM_CHECK_WIDTYPE(obj, widtype);
692 Widget_Data *wd = elm_widget_data_get(obj);
695 elm_smart_scroller_last_page_get(wd->scr, h_pagenumber, v_pagenumber);
699 elm_scroller_page_show(Evas_Object *obj, int h_pagenumber, int v_pagenumber)
701 ELM_CHECK_WIDTYPE(obj, widtype);
702 Widget_Data *wd = elm_widget_data_get(obj);
705 elm_smart_scroller_page_show(wd->scr, h_pagenumber, v_pagenumber);
709 elm_scroller_page_bring_in(Evas_Object *obj, int h_pagenumber, int v_pagenumber)
711 ELM_CHECK_WIDTYPE(obj, widtype);
712 Widget_Data *wd = elm_widget_data_get(obj);
715 elm_smart_scroller_page_bring_in(wd->scr, h_pagenumber, v_pagenumber);
719 elm_scroller_region_bring_in(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h)
721 ELM_CHECK_WIDTYPE(obj, widtype);
722 Widget_Data *wd = elm_widget_data_get(obj);
723 if ((!wd) || (!wd->scr)) return;
724 elm_smart_scroller_region_bring_in(wd->scr, x, y, w, h);
728 elm_scroller_propagate_events_set(Evas_Object *obj, Eina_Bool propagation)
730 ELM_CHECK_WIDTYPE(obj, widtype);
731 Widget_Data *wd = elm_widget_data_get(obj);
734 evas_object_propagate_events_set(wd->scr, propagation);
738 elm_scroller_propagate_events_get(const Evas_Object *obj)
740 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
741 Widget_Data *wd = elm_widget_data_get(obj);
742 if (!wd) return EINA_FALSE;
744 return evas_object_propagate_events_get(wd->scr);
748 elm_scroller_gravity_set(Evas_Object *obj, double x, double y)
750 ELM_CHECK_WIDTYPE(obj, widtype);
751 Widget_Data *wd = elm_widget_data_get(obj);
754 elm_smart_scroller_gravity_set(wd->scr, x, y);
758 elm_scroller_gravity_get(const Evas_Object *obj, double *x, double *y)
760 ELM_CHECK_WIDTYPE(obj, widtype);
761 Widget_Data *wd = elm_widget_data_get(obj);
764 elm_smart_scroller_gravity_get(wd->scr, x, y);