elementary/naviframe - two more APIs
authorhermet <hermet@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 12 Dec 2011 04:54:15 +0000 (04:54 +0000)
committerhermet <hermet@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 12 Dec 2011 04:54:15 +0000 (04:54 +0000)
elm_naviframe_event_enabled_set()
elm_naviframe_event_enabled_get()

Now, user could set events enabled/disabled when item pushing/popping.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@66102 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/Elementary.h.in
src/lib/elc_naviframe.c

index a7922cc..f98d3c9 100644 (file)
@@ -29974,6 +29974,8 @@ extern "C" {
     *        parameter in elm_naviframe_item_push
     *
     * @see also elm_naviframe_item_push()
+    *     
+    * @ingroup Naviframe
     */
    EAPI void                elm_naviframe_prev_btn_auto_pushed_set(Evas_Object *obj, Eina_Bool auto_pushed) EINA_ARG_NONNULL(1);
 
@@ -29986,6 +29988,8 @@ extern "C" {
     *
     * @see also elm_naviframe_item_push()
     *           elm_naviframe_prev_btn_auto_pushed_set()
+    *
+    * @ingroup Naviframe
     */
    EAPI Eina_Bool           elm_naviframe_prev_btn_auto_pushed_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
 
@@ -29995,9 +29999,44 @@ extern "C" {
     * @param obj The naviframe object
     * @return An Eina_Inlist* of naviframe items, #Elm_Object_Item,
     * or @c NULL on failure.
+    *
+    * @ingroup Naviframe
     */
    EAPI Eina_Inlist        *elm_naviframe_items_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
 
+   /**
+    * @brief Set the event enabled when pushing/popping items 
+    *
+    * If @c enabled is EINA_TRUE, the contents of the naviframe item will 
+    * receives events from mouse and keyboard during view changing such as
+    * item push/pop.
+    *
+    * @param obj The naviframe object
+    * @param enabled Events are received when enabled is @c EINA_TRUE, and 
+    * ignored otherwise.
+    *
+    * @warning Events will be blocked by calling evas_object_freeze_events_set()
+    * internally. So don't call the API whiling pushing/popping items.
+    *
+    * @see elm_naviframe_event_enabled_get()
+    * @see evas_object_freeze_events_set()
+    *
+    * @ingroup Naviframe
+    */
+   EAPI void                elm_naviframe_event_enabled_set(Evas_Object *obj, Eina_Bool enabled) EINA_ARG_NONNULL(1);
+
+   /**
+    * @brief Get the value of event enabled status.
+    *
+    * @param obj The naviframe object
+    * @return EINA_TRUE, when event is enabled
+    *
+    * @see elm_naviframe_event_enabled_set()
+    *
+    * @ingroup Naviframe
+    */
+   EAPI Eina_Bool           elm_naviframe_event_enabled_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
+
     /**
     * @}
     */
index 98d31d8..241bb93 100644 (file)
@@ -771,8 +771,8 @@ _title_icon_unset(Elm_Naviframe_Item *it)
                                   EVAS_CALLBACK_CHANGED_SIZE_HINTS,
                                   _changed_size_hints);
    _sizing_eval(WIDGET(it));
-
    it->title_icon = NULL;
+
    return content;
 }
 
@@ -1481,3 +1481,22 @@ elm_naviframe_items_get(const Evas_Object *obj)
    return wd->stack;
 }
 
+EAPI void
+elm_naviframe_event_enabled_set(Evas_Object *obj, Eina_Bool enabled)
+{
+   ELM_CHECK_WIDTYPE(obj, widtype);
+   Widget_Data *wd = elm_widget_data_get(obj);
+   if (!wd) return;
+   enabled = !!enabled;
+   if (wd->freeze_events == enabled) return;
+   wd->freeze_events = enabled;
+}
+
+EAPI Eina_Bool
+elm_naviframe_event_enabled_get(const Evas_Object *obj)
+{
+   ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
+   Widget_Data *wd = elm_widget_data_get(obj);
+   if (!wd) return EINA_FALSE;
+   return wd->freeze_events;
+}