els_scroller: add apis for enable/disable default wheel control
authorgouache <gouache@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 28 Apr 2011 02:34:00 +0000 (02:34 +0000)
committergouache <gouache@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 28 Apr 2011 02:34:00 +0000 (02:34 +0000)
git-svn-id: https://svn.enlightenment.org/svn/e/trunk/elementary@58984 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/els_scroller.c
src/lib/els_scroller.h

index 3e9b5c9..7174178 100644 (file)
@@ -105,6 +105,7 @@ struct _Smart_Data
    Eina_Bool momentum_animator_disabled :1;
    Eina_Bool bounce_animator_disabled :1;
    Eina_Bool is_mirrored : 1;
+   Eina_Bool wheel_disabled : 1;
 };
 
 /* local subsystem functions */
@@ -355,6 +356,24 @@ elm_smart_scroller_bounce_animator_disabled_set(Evas_Object *obj, Eina_Bool disa
      }
 }
 
+Eina_Bool
+elm_smart_scroller_wheel_disabled_get(Evas_Object *obj)
+{
+   API_ENTRY return EINA_FALSE;
+   return sd->wheel_disabled;
+}
+
+void
+elm_smart_scroller_wheel_disabled_set(Evas_Object *obj, Eina_Bool disabled)
+{
+   API_ENTRY return;
+   if ((!sd->wheel_disabled) && (disabled))
+     evas_object_event_callback_del_full(sd->event_obj, EVAS_CALLBACK_MOUSE_WHEEL, _smart_event_wheel, sd);
+   else if ((sd->wheel_disabled) && (!disabled))
+     evas_object_event_callback_add(sd->event_obj, EVAS_CALLBACK_MOUSE_WHEEL, _smart_event_wheel, sd);
+   sd->wheel_disabled = disabled;
+}
+
 /* Update the wanted coordinates according to the x, y passed
  * widget directionality, child size and etc. */
 static void
index 1c77179..eefe421 100644 (file)
@@ -38,3 +38,5 @@ Eina_Bool elm_smart_scroller_momentum_animator_disabled_get   (Evas_Object *obj)
 void elm_smart_scroller_momentum_animator_disabled_set             (Evas_Object *obj, Eina_Bool disabled);
 void elm_smart_scroller_bounce_animator_disabled_set               (Evas_Object *obj, Eina_Bool disabled);
 Eina_Bool elm_smart_scroller_bounce_animator_disabled_get     (Evas_Object *obj);
+Eina_Bool elm_smart_scroller_wheel_disabled_get (Evas_Object *obj);
+void elm_smart_scroller_wheel_disabled_set      (Evas_Object *obj, Eina_Bool disabled);