Merge branch 'master' of 165.213.180.234:/git/slp/pkgs/elementary
[framework/uifw/elementary.git] / src / lib / elm_scroller.c
1 #include <Elementary.h>
2 #include "elm_priv.h"
3
4 /**
5  * @defgroup Scroller Scroller
6  * @ingroup Elementary
7  *
8  * A scroller holds a single object and "scrolls it around". This means that
9  * it allows the user to use a scrollbar (or a finger) to drag the viewable
10  * region around, allowing to move through a much larger object that is
11  * contained in the scroller. The scroiller will always have a small minimum
12  * size by default as it won't be limited by the contents of the scroller.
13  *
14  * Signals that you can add callbacks for are:
15  *
16  * edge,left - the left edge of the content has been reached
17  *
18  * edge,right - the right edge of the content has been reached
19  *
20  * edge,top - the top edge of the content has been reached
21  *
22  * edge,bottom - the bottom edge of the content has been reached
23  *
24  * scroll - the content has been scrolled (moved)
25  *
26  * scroll,anim,start - scrolling animation has started
27  *
28  * scroll,anim,stop - scrolling animation has stopped
29  *
30  * scroll,drag,start - dragging the contents around has started
31  *
32  * scroll,drag,stop - dragging the contents around has stopped
33  */
34 typedef struct _Widget_Data Widget_Data;
35
36 struct _Widget_Data
37 {
38    Evas_Object *scr;
39    Evas_Object *content;
40    const char *widget_name, *widget_base;
41    Eina_Bool min_w : 1;
42    Eina_Bool min_h : 1;
43    double pagerel_h, pagerel_v;
44    Evas_Coord pagesize_h, pagesize_v;
45 };
46
47 static const char *widtype = NULL;
48 static void _del_hook(Evas_Object *obj);
49 static void _theme_hook(Evas_Object *obj);
50 static void _show_region_hook(void *data, Evas_Object *obj);
51 static void _sizing_eval(Evas_Object *obj);
52 static void _sub_del(void *data, Evas_Object *obj, void *event_info);
53
54 static const char SIG_SCROLL[] = "scroll";
55 static const char SIG_SCROLL_ANIM_START[] = "scroll,anim,start";
56 static const char SIG_SCROLL_ANIM_STOP[] = "scroll,anim,stop";
57 static const char SIG_SCROLL_DRAG_START[] = "scroll,drag,start";
58 static const char SIG_SCROLL_DRAG_STOP[] = "scroll,drag,stop";
59 static const char SIG_EDGE_LEFT[] = "edge,left";
60 static const char SIG_EDGE_RIGHT[] = "edge,right";
61 static const char SIG_EDGE_TOP[] = "edge,top";
62 static const char SIG_EDGE_BOTTOM[] = "edge,bottom";
63 static const Evas_Smart_Cb_Description _signals[] = {
64   {SIG_SCROLL, ""},
65   {SIG_SCROLL_ANIM_START, ""},
66   {SIG_SCROLL_ANIM_STOP, ""},
67   {SIG_SCROLL_DRAG_START, ""},
68   {SIG_SCROLL_DRAG_STOP, ""},
69   {SIG_EDGE_LEFT, ""},
70   {SIG_EDGE_RIGHT, ""},
71   {SIG_EDGE_TOP, ""},
72   {SIG_EDGE_BOTTOM, ""},
73   {NULL, NULL}
74 };
75
76 static void
77 _del_hook(Evas_Object *obj)
78 {
79
80    Widget_Data *wd = elm_widget_data_get(obj);
81    if (!wd) return;
82    free(wd);
83 }
84
85 static void
86 _theme_hook(Evas_Object *obj)
87 {
88    Widget_Data *wd = elm_widget_data_get(obj);
89    if (!wd) return;
90    if (wd->scr)
91      {
92         elm_smart_scroller_object_theme_set(obj, wd->scr,
93                                             wd->widget_name, wd->widget_base,
94                                             elm_widget_style_get(obj));
95 //        edje_object_scale_set(wd->scr, elm_widget_scale_get(obj) * _elm_config->scale);
96      }
97    _sizing_eval(obj);
98 }
99
100 static void
101 _show_region_hook(void *data, Evas_Object *obj)
102 {
103
104    Widget_Data *wd = elm_widget_data_get(data);
105    Evas_Coord x, y, w, h;
106    if (!wd) return;
107    elm_widget_show_region_get(obj, &x, &y, &w, &h);
108    if (wd->scr)
109      elm_smart_scroller_child_region_show(wd->scr, x, y, w, h);
110 }
111
112 static void
113 _sizing_eval(Evas_Object *obj)
114 {
115
116    Widget_Data *wd = elm_widget_data_get(obj);
117    Evas_Coord  vw, vh, minw, minh, maxw, maxh, w, h, vmw, vmh;
118    double xw, yw;
119
120    if (!wd) return;
121    evas_object_size_hint_min_get(wd->content, &minw, &minh);
122    evas_object_size_hint_max_get(wd->content, &maxw, &maxh);
123    evas_object_size_hint_weight_get(wd->content, &xw, &yw);
124    if (wd->scr)
125      {
126         elm_smart_scroller_child_viewport_size_get(wd->scr, &vw, &vh);
127         if (xw > 0.0)
128           {
129              if ((minw > 0) && (vw < minw)) vw = minw;
130              else if ((maxw > 0) && (vw > maxw)) vw = maxw;
131           }
132         else if (minw > 0) vw = minw;
133         if (yw > 0.0)
134           {
135              if ((minh > 0) && (vh < minh)) vh = minh;
136              else if ((maxh > 0) && (vh > maxh)) vh = maxh;
137           }
138         else if (minh > 0) vh = minh;
139         evas_object_resize(wd->content, vw, vh);
140         w = -1;
141         h = -1;
142         edje_object_size_min_calc(elm_smart_scroller_edje_object_get(wd->scr), &vmw, &vmh);
143         if (wd->min_w) w = vmw + minw;
144         if (wd->min_h) h = vmh + minh;
145         evas_object_size_hint_min_set(obj, w, h);
146      }
147 }
148
149 static void
150 _changed_size_hints(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
151 {
152    _sizing_eval(data);
153 }
154
155 static void
156 _sub_del(void *data __UNUSED__, Evas_Object *obj, void *event_info)
157 {
158
159    Widget_Data *wd = elm_widget_data_get(obj);
160    Evas_Object *sub = event_info;
161
162    if (!wd) return;
163    if (sub == wd->content)
164      {
165         elm_widget_on_show_region_hook_set(wd->content, NULL, NULL);
166         evas_object_event_callback_del_full (sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
167            _changed_size_hints, obj);
168         wd->content = NULL;
169         _sizing_eval(obj);
170      }
171    else if (sub == wd->scr)
172      wd->scr = NULL;
173 }
174
175 static void
176 _hold_on(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
177 {
178
179    Widget_Data *wd = elm_widget_data_get(obj);
180
181    if (!wd) return;
182    if (wd->scr)
183      elm_smart_scroller_hold_set(wd->scr, 1);
184 }
185
186 static void
187 _hold_off(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
188 {
189
190    Widget_Data *wd = elm_widget_data_get(obj);
191
192    if (!wd) return;
193    if (wd->scr)
194      elm_smart_scroller_hold_set(wd->scr, 0);
195 }
196
197 static void
198 _freeze_on(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
199 {
200
201    Widget_Data *wd = elm_widget_data_get(obj);
202
203    if (!wd) return;
204    if (wd->scr)
205      elm_smart_scroller_freeze_set(wd->scr, 1);
206 }
207
208 static void
209 _freeze_off(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
210 {
211
212    Widget_Data *wd = elm_widget_data_get(obj);
213
214    if (!wd) return;
215    if (wd->scr)
216      elm_smart_scroller_freeze_set(wd->scr, 0);
217 }
218
219 static void
220 _resize(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
221 {
222    _sizing_eval(data);
223 }
224
225 static void
226 _edge_left(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
227 {
228    evas_object_smart_callback_call(data, SIG_EDGE_LEFT, NULL);
229 }
230
231 static void
232 _edge_right(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
233 {
234    evas_object_smart_callback_call(data, SIG_EDGE_RIGHT, NULL);
235 }
236
237 static void
238 _edge_top(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
239 {
240    evas_object_smart_callback_call(data, SIG_EDGE_TOP, NULL);
241 }
242
243 static void
244 _edge_bottom(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
245 {
246    evas_object_smart_callback_call(data, SIG_EDGE_BOTTOM, NULL);
247 }
248
249 static void
250 _scroll(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
251 {
252    evas_object_smart_callback_call(data, SIG_SCROLL, NULL);
253 }
254
255 static void
256 _scroll_anim_start(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
257 {
258    evas_object_smart_callback_call(data, SIG_SCROLL_ANIM_START, NULL);
259 }
260
261 static void
262 _scroll_anim_stop(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
263 {
264    evas_object_smart_callback_call(data, SIG_SCROLL_ANIM_STOP, NULL);
265 }
266
267 static void
268 _scroll_drag_start(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
269 {
270    evas_object_smart_callback_call(data, SIG_SCROLL_DRAG_START, NULL);
271 }
272
273 static void
274 _scroll_drag_stop(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
275 {
276    evas_object_smart_callback_call(data, SIG_SCROLL_DRAG_STOP, NULL);
277 }
278
279 /**
280  * Add a new scroller to the parent
281  *
282  * @param parent The parent object
283  * @return The new object or NULL if it cannot be created
284  *
285  * @ingroup Scroller
286  */
287 EAPI Evas_Object *
288 elm_scroller_add(Evas_Object *parent)
289 {
290    Evas_Object *obj;
291    Evas *e;
292    Widget_Data *wd;
293    Evas_Coord minw, minh;
294
295    wd = ELM_NEW(Widget_Data);
296    e = evas_object_evas_get(parent);
297    obj = elm_widget_add(e);
298    ELM_SET_WIDTYPE(widtype, "scroller");
299    elm_widget_type_set(obj, "scroller");
300    elm_widget_sub_object_add(parent, obj);
301    elm_widget_data_set(obj, wd);
302    elm_widget_del_hook_set(obj, _del_hook);
303    elm_widget_theme_hook_set(obj, _theme_hook);
304
305    wd->widget_name = eina_stringshare_add("scroller");
306    wd->widget_base = eina_stringshare_add("base");
307
308    wd->scr = elm_smart_scroller_add(e);
309    elm_smart_scroller_widget_set(wd->scr, obj);
310    elm_smart_scroller_object_theme_set(obj, wd->scr,
311                                        wd->widget_name, wd->widget_base,
312                                        elm_widget_style_get(obj));
313    elm_widget_resize_object_set(obj, wd->scr);
314    evas_object_event_callback_add(wd->scr, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
315                                   _changed_size_hints, obj);
316
317    edje_object_size_min_calc(elm_smart_scroller_edje_object_get(wd->scr), &minw, &minh);
318    evas_object_size_hint_min_set(obj, minw, minh);
319    evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, _resize, obj);
320
321    evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
322    evas_object_smart_callback_add(obj, "scroll-hold-on", _hold_on, obj);
323    evas_object_smart_callback_add(obj, "scroll-hold-off", _hold_off, obj);
324    evas_object_smart_callback_add(obj, "scroll-freeze-on", _freeze_on, obj);
325    evas_object_smart_callback_add(obj, "scroll-freeze-off", _freeze_off, obj);
326
327    evas_object_smart_callback_add(wd->scr, "edge,left", _edge_left, obj);
328    evas_object_smart_callback_add(wd->scr, "edge,right", _edge_right, obj);
329    evas_object_smart_callback_add(wd->scr, "edge,top", _edge_top, obj);
330    evas_object_smart_callback_add(wd->scr, "edge,bottom", _edge_bottom, obj);
331    evas_object_smart_callback_add(wd->scr, "scroll", _scroll, obj);
332    evas_object_smart_callback_add(wd->scr, "animate,start", _scroll_anim_start, obj);
333    evas_object_smart_callback_add(wd->scr, "animate,stop", _scroll_anim_stop, obj);
334    evas_object_smart_callback_add(wd->scr, "drag,start", _scroll_drag_start, obj);
335    evas_object_smart_callback_add(wd->scr, "drag,stop", _scroll_drag_stop, obj);
336
337    _sizing_eval(obj);
338
339    // TODO: convert Elementary to subclassing of Evas_Smart_Class
340    // TODO: and save some bytes, making descriptions per-class and not instance!
341    evas_object_smart_callbacks_descriptions_set(obj, _signals);
342    return obj;
343 }
344
345
346 /**
347  * Set the content object
348  *
349  * Sets the content of the scroller (the object to be scrolled around)
350  *
351  * @param obj The scroller object
352  * @param content The new content object
353  *
354  * @ingroup Scroller
355  */
356 EAPI void
357 elm_scroller_content_set(Evas_Object *obj, Evas_Object *content)
358 {
359    ELM_CHECK_WIDTYPE(obj, widtype);
360    Widget_Data *wd = elm_widget_data_get(obj);
361    if (!wd) return;
362    if ((wd->content != content) && (wd->content))
363      elm_widget_sub_object_del(obj, wd->content);
364    wd->content = content;
365    if (content)
366      {
367         elm_widget_on_show_region_hook_set(content, _show_region_hook, obj);
368         elm_widget_sub_object_add(obj, content);
369     if (wd->scr)
370         elm_smart_scroller_child_set(wd->scr, content);
371         evas_object_event_callback_add(content, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
372                                        _changed_size_hints, obj);
373         _sizing_eval(obj);
374      }
375 }
376
377 /**
378  * Set custom theme elements for the scroller
379  *
380  * @param obj The scroller object
381  * @param widget The widget name to use (default is "scroller")
382  * @param base The base name to use (default is "base")
383  */
384 EAPI void
385 elm_scroller_custom_widget_base_theme_set(Evas_Object *obj, const char *widget, const char *base)
386 {
387    ELM_CHECK_WIDTYPE(obj, widtype);
388    Widget_Data *wd = elm_widget_data_get(obj);
389    if (!wd) return;
390    if ((!widget) || (!base)) return;
391    if (eina_stringshare_replace(&wd->widget_name, widget) |
392        eina_stringshare_replace(&wd->widget_base, base))
393      _theme_hook(obj);
394 }
395
396 /**
397  * Make the scroller minimum size limited to the minimum size of the content
398  *
399  * By default the scroller will be as small as its design allows, irrespective
400  * of its content. This will make the scroller minimum size the right size
401  * horizontally and/or vertically to perfectly fit its content.
402  *
403  * @param obj The scroller object
404  * @param w Enable limiting minimum size horizontally
405  * @param h Enable limiting minimum size vertically
406  *
407  * @ingroup Scroller
408  */
409 EAPI void
410 elm_scroller_content_min_limit(Evas_Object *obj, Eina_Bool w, Eina_Bool h)
411 {
412    ELM_CHECK_WIDTYPE(obj, widtype);
413    Widget_Data *wd = elm_widget_data_get(obj);
414    if (!wd) return;
415    wd->min_w = w;
416    wd->min_h = h;
417    _sizing_eval(obj);
418 }
419
420 /**
421  * Show a specific virtual region within the scroller content object
422  *
423  * This will ensure all (or part if it does not fit) of the designated
424  * region in the virtual content object (0, 0 starting at the top-left of the
425  * virtual content object) is shown within the scroller.
426  *
427  * @param obj The scroller object
428  * @param x X coordinate of the region
429  * @param y Y coordinate of the region
430  * @param w Width of the region
431  * @param h Height of the region
432  *
433  * @ingroup Scroller
434  */
435 EAPI void
436 elm_scroller_region_show(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h)
437 {
438    ELM_CHECK_WIDTYPE(obj, widtype);
439    Widget_Data *wd = elm_widget_data_get(obj);
440    if (!wd) return;
441    if (wd->scr)
442      elm_smart_scroller_child_region_show(wd->scr, x, y, w, h);
443 }
444
445 /**
446  * Set the scroller scrollbar policy
447  *
448  * This sets the scrollbar visibility policy for the given scroller.
449  * ELM_SMART_SCROLLER_POLICY_AUTO means the scrollber is made visible if it
450  * is needed, and otherwise kept hidden. ELM_SMART_SCROLLER_POLICY_ON turns
451  * it on all the time, and ELM_SMART_SCROLLER_POLICY_OFF always keeps it off.
452  * This applies respectively for the horizontal and vertical scrollbars.
453  *
454  * @param obj The scroller object
455  * @param policy_h Horizontal scrollbar policy
456  * @param policy_v Vertical scrollbar policy
457  *
458  * @ingroup Scroller
459  */
460 EAPI void
461 elm_scroller_policy_set(Evas_Object *obj, Elm_Scroller_Policy policy_h, Elm_Scroller_Policy policy_v)
462 {
463    ELM_CHECK_WIDTYPE(obj, widtype);
464    Widget_Data *wd = elm_widget_data_get(obj);
465    const Elm_Scroller_Policy map[3] =
466      {
467         ELM_SMART_SCROLLER_POLICY_AUTO,
468           ELM_SMART_SCROLLER_POLICY_ON,
469           ELM_SMART_SCROLLER_POLICY_OFF
470      };
471    if (!wd) return;
472    if ((policy_h >= 3) || (policy_v >= 3)) return;
473    if (wd->scr)
474      elm_smart_scroller_policy_set(wd->scr, map[policy_h], map[policy_v]);
475 }
476
477 EAPI void
478 elm_scroller_policy_get(const Evas_Object *obj, Elm_Scroller_Policy *policy_h, Elm_Scroller_Policy *policy_v)
479 {
480    ELM_CHECK_WIDTYPE(obj, widtype);
481    Widget_Data *wd = elm_widget_data_get(obj);
482    Elm_Smart_Scroller_Policy s_policy_h, s_policy_v;
483    if (!wd) return;
484    if (wd->scr)
485      elm_smart_scroller_policy_get(wd->scr, &s_policy_h, &s_policy_v);
486    *policy_h = (Elm_Scroller_Policy) s_policy_h;
487    *policy_v = (Elm_Scroller_Policy) s_policy_v;
488 }
489
490 /**
491  * Get the currently visible content region
492  *
493  * This gets the current region in the content object that is visible through
494  * the scroller. Also see elm_scroller_region_show(). The region co-ordinates
495  * are returned in the @p x, @p y, @p w, @p h values pointed to.
496  *
497  * @param obj The scroller object
498  * @param x X coordinate of the region
499  * @param y Y coordinate of the region
500  * @param w Width of the region
501  * @param h Height of the region
502  *
503  * @ingroup Scroller
504  */
505 EAPI void
506 elm_scroller_region_get(const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
507 {
508    ELM_CHECK_WIDTYPE(obj, widtype);
509    Widget_Data *wd = elm_widget_data_get(obj);
510    if (!wd) return;
511    if (wd->scr)
512      {
513         if ((x) && (y)) elm_smart_scroller_child_pos_get(wd->scr, x, y);
514         if ((w) && (h)) elm_smart_scroller_child_viewport_size_get(wd->scr, w, h);
515      }
516 }
517
518 /**
519  * Get the size of the content child object
520  *
521  * This gets the size of the child object of the scroller. Actually the
522  * content of a scroller doesn't specifically need to be an actual object
523  * as it can be virtual and defined purely by callbacks.
524  *
525  * @param obj The scroller object
526  * @param w Width return
527  * @param h Height return
528  *
529  * @ingroup Scroller
530  */
531 EAPI void
532 elm_scroller_child_size_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h)
533 {
534    ELM_CHECK_WIDTYPE(obj, widtype);
535    Widget_Data *wd = elm_widget_data_get(obj);
536    if (!wd) return;
537    evas_object_geometry_get(wd->content, NULL, NULL, w, h);
538 }
539
540 /**
541  * Set bouncing behavior
542  *
543  * When scrolling, the scroller may "bounce" when reaching an edge of the child
544  * object. This is a visual way to indicate the end has been reached. This is
545  * enabled by default for both axes. This will set if it is enabled for that
546  * axis with the boolean parameers for each axis.
547  *
548  * @param obj The scroller object
549  * @param h_bounce Will the scroller bounce horizontally or not
550  y Y coordinate of the region
551  w Width of the region
552  h Height of the region
553
554  EAPI void elm_scroller_region_show ( Evas_Object *  obj, * @param v_bounce Will the scroller bounce vertically or not
555  *
556  * @ingroup Scroller
557  */
558 EAPI void
559 elm_scroller_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce)
560 {
561    ELM_CHECK_WIDTYPE(obj, widtype);
562    Widget_Data *wd = elm_widget_data_get(obj);
563    if (!wd) return;
564    if (wd->scr)
565      elm_smart_scroller_bounce_allow_set(wd->scr, h_bounce, v_bounce);
566 }
567
568 /**
569  * Set scroll page size relative to viewport size
570  *
571  * The scroller is sapale of limiting scrolling by the user to "pages". That
572  * is to jump by and only show a "whole page" at a time as if the continuous
573  * area of the scroller conent is split into page sized pieces. This sets
574  * the size of a page relative to the viewport of the scroller. 1.0 is "1
575  * viewport" is size (horizontally or vertically). 0.0 turns it off in that
576  * axis. This is mutually exclusive with page size
577  * (see elm_scroller_page_size_set()  for more information). likewise 0.5
578  * is "half a viewport". Sane usable valus are normally between 0.0 and 1.0
579  * including 1.0. If you only want 1 axis to be page "limited", use 0.0 for
580  * the other axis.
581  *
582  * @param obj The scroller object
583  * @param h_pagerel The horizontal page relative size
584  * @param v_pagerel The vertical page relative size
585  *
586  * @ingroup Scroller
587  */
588 EAPI void
589 elm_scroller_page_relative_set(Evas_Object *obj, double h_pagerel, double v_pagerel)
590 {
591    ELM_CHECK_WIDTYPE(obj, widtype);
592    Widget_Data *wd = elm_widget_data_get(obj);
593    if (!wd) return;
594    wd->pagerel_h = h_pagerel;
595    wd->pagerel_v = v_pagerel;
596    if (wd->scr)
597      elm_smart_scroller_paging_set(wd->scr, wd->pagerel_h, wd->pagerel_v,
598                                    wd->pagesize_h, wd->pagesize_v);
599 }
600
601 /**
602  * Set scroll page size
603  *
604  * See also elm_scroller_page_relative_set(). This, instead of a page size
605  * being relaive to the viewport, sets it to an absolute fixed value, with
606  * 0 turning it off for that axis.
607  *
608  * @param obj The scroller object
609  * @param h_pagesize The horizontal page size
610  * @param v_pagesize The vertical page size
611  *
612  * @ingroup Scroller
613  */
614 EAPI void
615 elm_scroller_page_size_set(Evas_Object *obj, Evas_Coord h_pagesize, Evas_Coord v_pagesize)
616 {
617    ELM_CHECK_WIDTYPE(obj, widtype);
618    Widget_Data *wd = elm_widget_data_get(obj);
619    if (!wd) return;
620    wd->pagesize_h = h_pagesize;
621    wd->pagesize_v = v_pagesize;
622    if (wd->scr)
623      elm_smart_scroller_paging_set(wd->scr, wd->pagerel_h, wd->pagerel_v,
624                                    wd->pagesize_h, wd->pagesize_v);
625 }
626
627 /**
628  * Show a specific virtual region within the scroller content object
629  *
630  * This will ensure all (or part if it does not fit) of the designated
631  * region in the virtual content object (0, 0 starting at the top-left of the
632  * virtual content object) is shown within the scroller. Unlike
633  * elm_scroller_region_show(), this allow the scroller to "smoothly slide"
634  * to this location (if configuration in general calls for transitions). It
635  * may not jump immediately to the new location and make take a while and
636  * show other content along the way.
637  *
638  * @param obj The scroller object
639  * @param x X coordinate of the region
640  * @param y Y coordinate of the region
641  * @param w Width of the region
642  * @param h Height of the region
643  *
644  * @ingroup Scroller
645  */
646 EAPI void
647 elm_scroller_region_bring_in(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h)
648 {
649    ELM_CHECK_WIDTYPE(obj, widtype);
650    Widget_Data *wd = elm_widget_data_get(obj);
651    if (!wd) return;
652    if (wd->scr)
653      elm_smart_scroller_region_bring_in(wd->scr, x, y, w, h);
654 }
655
656 /**
657  * Set scroll only one page
658  *
659  * @param obj The scroller object
660  * @param set Flag
661  *
662  * @ingroup Scroller
663  */
664 EAPI void
665 elm_scroller_page_move_set(Evas_Object *obj, Eina_Bool set)
666 {
667    Widget_Data *wd = elm_widget_data_get(obj);
668    if (!wd) return;
669
670    elm_smart_scroller_page_move_set(wd->scr, set);
671 }
672
673 /**
674  * Set events propagation
675  *
676  * @param obj The scroller object
677  * @param set Flag
678  *
679  * @ingroup Scroller
680  */
681 EAPI void
682 elm_scroller_propagate_events_set(Evas_Object *obj, Eina_Bool set)
683 {
684    Widget_Data *wd = elm_widget_data_get(obj);
685    if (!wd) return;
686
687    evas_object_propagate_events_set(wd->scr, set);
688 }