From d59ea1baad5c866f5be3a3139bb929a90644cbe1 Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Mon, 5 Mar 2012 09:50:32 +0000 Subject: [PATCH] make notify repeat events be allow_events... as thats what it really does. SVN revision: 68685 --- legacy/elementary/src/bin/test_notify.c | 2 +- legacy/elementary/src/bin/test_web.c | 4 +-- legacy/elementary/src/lib/elm_deprecated.h | 24 +++++++++++++++ legacy/elementary/src/lib/elm_notify.c | 36 ++++++++++++++-------- legacy/elementary/src/lib/elm_notify.h | 10 +++--- 5 files changed, 55 insertions(+), 21 deletions(-) diff --git a/legacy/elementary/src/bin/test_notify.c b/legacy/elementary/src/bin/test_notify.c index 745effd138..8c3019bb28 100644 --- a/legacy/elementary/src/bin/test_notify.c +++ b/legacy/elementary/src/bin/test_notify.c @@ -82,7 +82,7 @@ test_notify(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info evas_object_show(bt); notify = elm_notify_add(win); - elm_notify_repeat_events_set(notify, EINA_FALSE); + elm_notify_allow_events_set(notify, EINA_FALSE); evas_object_size_hint_weight_set(notify, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_notify_orient_set(notify, ELM_NOTIFY_ORIENT_BOTTOM); elm_notify_timeout_set(notify, 5.0); diff --git a/legacy/elementary/src/bin/test_web.c b/legacy/elementary/src/bin/test_web.c index 223b8442fc..88d1ddf4b3 100644 --- a/legacy/elementary/src/bin/test_web.c +++ b/legacy/elementary/src/bin/test_web.c @@ -133,7 +133,7 @@ _alert_hook(void *data __UNUSED__, Evas_Object *obj, const char *message) elm_notify_orient_set(popup, ELM_NOTIFY_ORIENT_CENTER); // Using the timeout doesn't seem to go well with the second main loop //elm_notify_timeout_set(popup, 2.0); - elm_notify_repeat_events_set(popup, EINA_FALSE); + elm_notify_allow_events_set(popup, EINA_FALSE); evas_object_show(popup); evas_object_smart_callback_add(popup, "block,clicked", _alert_del, NULL); @@ -173,7 +173,7 @@ _confirm_hook(void *data __UNUSED__, Evas_Object *obj, const char *message, Eina popup = elm_notify_add(obj); elm_notify_orient_set(popup, ELM_NOTIFY_ORIENT_CENTER); - elm_notify_repeat_events_set(popup, EINA_FALSE); + elm_notify_allow_events_set(popup, EINA_FALSE); evas_object_show(popup); box = elm_box_add(obj); diff --git a/legacy/elementary/src/lib/elm_deprecated.h b/legacy/elementary/src/lib/elm_deprecated.h index 7cfdb82f5e..adf2631d32 100644 --- a/legacy/elementary/src/lib/elm_deprecated.h +++ b/legacy/elementary/src/lib/elm_deprecated.h @@ -4605,6 +4605,30 @@ EINA_DEPRECATED EAPI void elm_web_history_enable_set(Evas_Object *o */ EINA_DEPRECATED EAPI Elm_Object_Item *elm_menu_item_add_object(Evas_Object *obj, Elm_Object_Item *parent, Evas_Object *subobj, Evas_Smart_Cb func, const void *data); +/** + * @brief Sets whether events should be passed to by a click outside + * its area. + * + * @param obj The notify object + * @param repeat EINA_TRUE Events are repeats, else no + * + * When true if the user clicks outside the window the events will be caught + * by the others widgets, else the events are blocked. + * + * @note The default value is EINA_TRUE. + * @deprecated Please use elm_notify_allow_events_set() instead + */ +EINA_DEPRECATED EAPI void elm_notify_repeat_events_set(Evas_Object *obj, Eina_Bool repeat); + +/** + * @brief Return true if events are repeat below the notify object + * @param obj the notify object + * + * @see elm_notify_repeat_events_set() + * @deprecated Please use elm_notify_allow_events_get() instead + */ +EINA_DEPRECATED EAPI Eina_Bool elm_notify_repeat_events_get(const Evas_Object *obj); + /** * Set if the cursor set should be searched on the theme or should use * the provided by the engine, only. diff --git a/legacy/elementary/src/lib/elm_notify.c b/legacy/elementary/src/lib/elm_notify.c index fab03902d7..d1d322c989 100644 --- a/legacy/elementary/src/lib/elm_notify.c +++ b/legacy/elementary/src/lib/elm_notify.c @@ -8,7 +8,7 @@ struct _Widget_Data Evas_Object *notify, *content, *parent; Elm_Notify_Orient orient; - Eina_Bool repeat_events; + Eina_Bool allow_events; Evas_Object *block_events; double timeout; @@ -57,7 +57,7 @@ _del_hook(Evas_Object *obj) Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; elm_notify_parent_set(obj, NULL); - elm_notify_repeat_events_set(obj, EINA_TRUE); + elm_notify_allow_events_set(obj, EINA_TRUE); if (wd->timer) { ecore_timer_del(wd->timer); @@ -360,8 +360,7 @@ _show(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *event_i Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; evas_object_show(wd->notify); - if (!wd->repeat_events) - evas_object_show(wd->block_events); + if (!wd->allow_events) evas_object_show(wd->block_events); _timer_init(obj, wd); elm_object_focus_set(obj, EINA_TRUE); } @@ -372,8 +371,7 @@ _hide(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *event_i Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; evas_object_hide(wd->notify); - if (!wd->repeat_events) - evas_object_hide(wd->block_events); + if (!wd->allow_events) evas_object_hide(wd->block_events); if (wd->timer) { ecore_timer_del(wd->timer); @@ -493,7 +491,7 @@ elm_notify_add(Evas_Object *parent) elm_widget_content_get_hook_set(obj, _content_get_hook); elm_widget_content_unset_hook_set(obj, _content_unset_hook); - wd->repeat_events = EINA_TRUE; + wd->allow_events = EINA_TRUE; wd->notify = edje_object_add(e); wd->orient = -1; @@ -622,15 +620,27 @@ elm_notify_timeout_get(const Evas_Object *obj) return wd->timeout; } +EINA_DEPRECATED EAPI void +elm_repeat_repeat_events_set(Evas_Object *obj, Eina_Bool repeat) +{ + elm_notify_allow_events_set(obj, repeat); +} + +EINA_DEPRECATED EAPI Eina_Bool +elm_repeat_allow_events_get(const Evas_Object *obj) +{ + return elm_notify_allow_events_get(obj); +} + EAPI void -elm_notify_repeat_events_set(Evas_Object *obj, Eina_Bool repeat) +elm_notify_allow_events_set(Evas_Object *obj, Eina_Bool allow) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; - if (repeat == wd->repeat_events) return; - wd->repeat_events = repeat; - if (!repeat) + if (allow == wd->allow_events) return; + wd->allow_events = allow; + if (!allow) { wd->block_events = edje_object_add(evas_object_evas_get(obj)); _block_events_theme_apply(obj); @@ -643,10 +653,10 @@ elm_notify_repeat_events_set(Evas_Object *obj, Eina_Bool repeat) } EAPI Eina_Bool -elm_notify_repeat_events_get(const Evas_Object *obj) +elm_notify_allow_events_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->repeat_events; + return wd->allow_events; } diff --git a/legacy/elementary/src/lib/elm_notify.h b/legacy/elementary/src/lib/elm_notify.h index 6914fbb8d3..4354621034 100644 --- a/legacy/elementary/src/lib/elm_notify.h +++ b/legacy/elementary/src/lib/elm_notify.h @@ -132,22 +132,22 @@ EAPI double elm_notify_timeout_get(const Evas_Object *obj) * its area. * * @param obj The notify object - * @param repeat EINA_TRUE Events are repeats, else no + * @param allow EINA_TRUE If events are allowed, otherwise not * * When true if the user clicks outside the window the events will be caught * by the others widgets, else the events are blocked. * * @note The default value is EINA_TRUE. */ -EAPI void elm_notify_repeat_events_set(Evas_Object *obj, Eina_Bool repeat); +EAPI void elm_notify_allow_events_set(Evas_Object *obj, Eina_Bool allow); /** - * @brief Return true if events are repeat below the notify object + * @brief Return true if events are allowed below the notify object * @param obj the notify object * - * @see elm_notify_repeat_events_set() + * @see elm_notify_allow_events_set() */ -EAPI Eina_Bool elm_notify_repeat_events_get(const Evas_Object *obj); +EAPI Eina_Bool elm_notify_allow_events_get(const Evas_Object *obj); /** * @}