Hi, All.

 

Most of APIs related to timeout_set / get uses double type as parameter,
but elm_slidershow uses integer type.

For uniformity, the second parameter type of elm_slideshow_timeout_set is
changed into double type.

Please review this patch and apply in svn if it is ok.

Thanks.

Index: src/lib/elm_slideshow.c
===================================================================
--- src/lib/elm_slideshow.c     (revision 55961)
+++ src/lib/elm_slideshow.c     (working copy)
@@ -41,7 +41,7 @@ struct _Widget_Data
    const char *transition;
 
    Ecore_Timer *timer;
-   int timeout;
+   double timeout;
    Eina_Bool loop:1;
 
    struct {
@@ -86,9 +86,9 @@ _event_hook(Evas_Object *obj, Evas_Object *src __U
        (!strcmp(ev->keyname, "space")))
      {
         if (wd->timeout)
-          elm_slideshow_timeout_set(obj, 0);
+          elm_slideshow_timeout_set(obj, 0.0);
         else
-          elm_slideshow_timeout_set(obj, 3);
+          elm_slideshow_timeout_set(obj, 3.0);
 
         ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
         return EINA_TRUE;
@@ -560,7 +560,7 @@ elm_slideshow_transition_get(const Evas_Object *ob
  * @ingroup Slideshow
  */
 EAPI void
-elm_slideshow_timeout_set(Evas_Object *obj ,int timeout)
+elm_slideshow_timeout_set(Evas_Object *obj, double timeout)
 {
    ELM_CHECK_WIDTYPE(obj, widtype);
    Widget_Data *wd = elm_widget_data_get(obj);
@@ -568,7 +568,7 @@ EAPI void
    wd->timeout = timeout;
    if (wd->timer) ecore_timer_del(wd->timer);
    wd->timer = NULL;
-   if (timeout > 0)
+   if (timeout > 0.0)
      wd->timer = ecore_timer_add(timeout, _timer_cb, obj);
 }
 
@@ -580,12 +580,12 @@ EAPI void
  *
  * @ingroup Slideshow
  */
-EAPI int
+EAPI double
 elm_slideshow_timeout_get(const Evas_Object *obj)
 {
-   ELM_CHECK_WIDTYPE(obj, widtype) -1;
+   ELM_CHECK_WIDTYPE(obj, widtype) -1.0;
    Widget_Data *wd = elm_widget_data_get(obj);
-   if (!wd) return -1;
+   if (!wd) return -1.0;
    return wd->timeout;
 }
 
Index: src/lib/Elementary.h.in
===================================================================
--- src/lib/Elementary.h.in     (revision 55961)
+++ src/lib/Elementary.h.in     (working copy)
@@ -1849,8 +1849,8 @@ extern "C" {
    EAPI const Eina_List    *elm_slideshow_transitions_get(const Evas_Object 
*obj) EINA_ARG_NONNULL(1);
    EAPI void                elm_slideshow_transition_set(Evas_Object *obj, 
const char *transition) EINA_ARG_NONNULL(1);
    EAPI const char         *elm_slideshow_transition_get(const Evas_Object 
*obj) EINA_ARG_NONNULL(1);
-   EAPI void                elm_slideshow_timeout_set(Evas_Object *obj ,int 
timeout) EINA_ARG_NONNULL(1);
-   EAPI int                 elm_slideshow_timeout_get(const Evas_Object *obj) 
EINA_ARG_NONNULL(1);
+   EAPI void                elm_slideshow_timeout_set(Evas_Object *obj, double 
timeout) EINA_ARG_NONNULL(1);
+   EAPI double              elm_slideshow_timeout_get(const Evas_Object *obj) 
EINA_ARG_NONNULL(1);
    EAPI void                elm_slideshow_loop_set(Evas_Object *obj, Eina_Bool 
loop) EINA_ARG_NONNULL(1);
    EAPI Eina_Bool           elm_slideshow_loop_get(const Evas_Object *obj) 
EINA_ARG_NONNULL(1);
    EAPI void                elm_slideshow_clear(Evas_Object *obj) 
EINA_ARG_NONNULL(1);
Index: src/bin/test_slideshow.c
===================================================================
--- src/bin/test_slideshow.c    (revision 55961)
+++ src/bin/test_slideshow.c    (working copy)
@@ -35,7 +35,7 @@ _previous(void *data, Evas_Object *obj __UNUSED__,
 static void
 _mouse_in(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void 
*event_info __UNUSED__)
 {
-   elm_notify_timeout_set(data, 0);
+   elm_notify_timeout_set(data, 0.0);
    evas_object_show(data);
 }
 
@@ -43,7 +43,7 @@ _mouse_in(void *data, Evas *e __UNUSED__, Evas_Obj
 static void
 _mouse_out(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void 
*event_info __UNUSED__)
 {
-   elm_notify_timeout_set(data, 3);
+   elm_notify_timeout_set(data, 3.0);
 }
 
 static void
@@ -63,25 +63,25 @@ _layout_select(void *data, Evas_Object *obj, void
 static void
 _start(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
 {
-   elm_slideshow_timeout_set(slideshow, (int)elm_spinner_value_get(data));
+   elm_slideshow_timeout_set(slideshow, elm_spinner_value_get(data));
 
-   elm_object_disabled_set(bt_start, 1);
-   elm_object_disabled_set(bt_stop, 0);
+   elm_object_disabled_set(bt_start, EINA_TRUE);
+   elm_object_disabled_set(bt_stop, EINA_FALSE);
 }
 
 static void
 _stop(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info 
__UNUSED__)
 {
-   elm_slideshow_timeout_set(slideshow, 0);
-   elm_object_disabled_set(bt_start, 0);
-   elm_object_disabled_set(bt_stop, 1);
+   elm_slideshow_timeout_set(slideshow, 0.0);
+   elm_object_disabled_set(bt_start, EINA_FALSE);
+   elm_object_disabled_set(bt_stop, EINA_TRUE);
 }
 
 static void
 _spin(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
 {
    if (elm_slideshow_timeout_get(slideshow) > 0)
-     elm_slideshow_timeout_set(slideshow, (int)elm_spinner_value_get(data));
+     elm_slideshow_timeout_set(slideshow, elm_spinner_value_get(data));
 }
 
 static Evas_Object *
@@ -118,7 +118,7 @@ test_slideshow(void *data __UNUSED__, Evas_Object
    evas_object_show(bg);
 
    slideshow = elm_slideshow_add(win);
-   elm_slideshow_loop_set(slideshow, 1);
+   elm_slideshow_loop_set(slideshow, EINA_TRUE);
    elm_win_resize_object_add(win, slideshow);
    evas_object_size_hint_weight_set(slideshow, EVAS_HINT_EXPAND, 
EVAS_HINT_EXPAND);
    evas_object_show(slideshow);
@@ -139,10 +139,10 @@ test_slideshow(void *data __UNUSED__, Evas_Object
    notify = elm_notify_add(win);
    elm_notify_orient_set(notify, ELM_NOTIFY_ORIENT_BOTTOM);
    elm_win_resize_object_add(win, notify);
-   elm_notify_timeout_set(notify, 3);
+   elm_notify_timeout_set(notify, 3.0);
 
    bx = elm_box_add(win);
-   elm_box_horizontal_set(bx, 1);
+   elm_box_horizontal_set(bx, EINA_TRUE);
    elm_notify_content_set(notify, bx);
    evas_object_show(bx);
 
@@ -200,7 +200,7 @@ test_slideshow(void *data __UNUSED__, Evas_Object
    elm_button_label_set(bt, "Stop");
    evas_object_smart_callback_add(bt, "clicked", _stop, spin);
    elm_box_pack_end(bx, bt);
-   elm_object_disabled_set(bt, 1);
+   elm_object_disabled_set(bt, EINA_TRUE);
    evas_object_show(bt);
 
    evas_object_event_callback_add(slideshow, EVAS_CALLBACK_MOUSE_UP,
------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to