forked from enlightenment/efl
elementary: deprecate elm_bubble_content_set elm_bubble_content_get elm_bubble_content_unset
SVN revision: 64576
This commit is contained in:
parent
88c82b457f
commit
fdf3cad212
|
@ -12415,7 +12415,7 @@ extern "C" {
|
|||
*
|
||||
* This function sets the content shown on the middle of the bubble.
|
||||
*/
|
||||
EAPI void elm_bubble_content_set(Evas_Object *obj, Evas_Object *content) EINA_ARG_NONNULL(1);
|
||||
EINA_DEPRECATED EAPI void elm_bubble_content_set(Evas_Object *obj, Evas_Object *content) EINA_ARG_NONNULL(1);
|
||||
/**
|
||||
* Get the content shown in the bubble
|
||||
*
|
||||
|
@ -12424,7 +12424,7 @@ extern "C" {
|
|||
* @param obj The bubble object
|
||||
* @return The content that is being used
|
||||
*/
|
||||
EAPI Evas_Object *elm_bubble_content_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||
EINA_DEPRECATED EAPI Evas_Object *elm_bubble_content_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||
/**
|
||||
* Unset the content shown in the bubble
|
||||
*
|
||||
|
@ -12433,7 +12433,7 @@ extern "C" {
|
|||
* @param obj The bubble object
|
||||
* @return The content that was being used
|
||||
*/
|
||||
EAPI Evas_Object *elm_bubble_content_unset(Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||
EINA_DEPRECATED EAPI Evas_Object *elm_bubble_content_unset(Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||
/**
|
||||
* Set the icon of the bubble
|
||||
*
|
||||
|
|
|
@ -13,6 +13,9 @@ struct _Widget_Data
|
|||
static const char *widtype = NULL;
|
||||
static void _del_hook(Evas_Object *obj);
|
||||
static void _mirrored_set(Evas_Object *obj, Eina_Bool rtl);
|
||||
static void _content_set_hook(Evas_Object *obj, const char *part, Evas_Object *content);
|
||||
static Evas_Object *_content_get_hook(const Evas_Object *obj, const char *part);
|
||||
static Evas_Object *_content_unset_hook(Evas_Object *obj, const char *part);
|
||||
static void _theme_hook(Evas_Object *obj);
|
||||
static void _sizing_eval(Evas_Object *obj);
|
||||
static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
||||
|
@ -74,6 +77,52 @@ _theme_hook(Evas_Object *obj)
|
|||
_sizing_eval(obj);
|
||||
}
|
||||
|
||||
static void
|
||||
_content_set_hook(Evas_Object *obj, const char *part __UNUSED__, Evas_Object *content)
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return;
|
||||
if (wd->content == content) return;
|
||||
if (wd->content) evas_object_del(wd->content);
|
||||
wd->content = content;
|
||||
if (content)
|
||||
{
|
||||
elm_widget_sub_object_add(obj, content);
|
||||
evas_object_event_callback_add(content,
|
||||
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints, obj);
|
||||
edje_object_part_swallow(wd->bbl, "elm.swallow.content", content);
|
||||
}
|
||||
_sizing_eval(obj);
|
||||
}
|
||||
|
||||
static Evas_Object *
|
||||
_content_get_hook(const Evas_Object *obj, const char *part __UNUSED__)
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return NULL;
|
||||
return wd->content;
|
||||
}
|
||||
|
||||
static Evas_Object *
|
||||
_content_unset_hook(Evas_Object *obj, const char *part __UNUSED__)
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
Evas_Object *content;
|
||||
if (!wd) return NULL;
|
||||
if (!wd->content) return NULL;
|
||||
content = wd->content;
|
||||
elm_widget_sub_object_del(obj, content);
|
||||
evas_object_event_callback_del_full(content, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints, obj);
|
||||
edje_object_part_unswallow(wd->bbl, content);
|
||||
wd->content = NULL;
|
||||
return content;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_elm_bubble_focus_next_hook(const Evas_Object *obj, Elm_Focus_Direction dir, Evas_Object **next)
|
||||
{
|
||||
|
@ -201,6 +250,9 @@ elm_bubble_add(Evas_Object *parent)
|
|||
elm_widget_can_focus_set(obj, EINA_FALSE);
|
||||
elm_widget_text_set_hook_set(obj, _elm_bubble_label_set);
|
||||
elm_widget_text_get_hook_set(obj, _elm_bubble_label_get);
|
||||
elm_widget_content_set_hook_set(obj, _content_set_hook);
|
||||
elm_widget_content_get_hook_set(obj, _content_get_hook);
|
||||
elm_widget_content_unset_hook_set(obj, _content_unset_hook);
|
||||
|
||||
wd->corner = eina_stringshare_add("base");
|
||||
|
||||
|
@ -246,46 +298,19 @@ elm_bubble_info_get(const Evas_Object *obj)
|
|||
EAPI void
|
||||
elm_bubble_content_set(Evas_Object *obj, Evas_Object *content)
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return;
|
||||
if (wd->content == content) return;
|
||||
if (wd->content) evas_object_del(wd->content);
|
||||
wd->content = content;
|
||||
if (content)
|
||||
{
|
||||
elm_widget_sub_object_add(obj, content);
|
||||
evas_object_event_callback_add(content, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints, obj);
|
||||
edje_object_part_swallow(wd->bbl, "elm.swallow.content", content);
|
||||
}
|
||||
_sizing_eval(obj);
|
||||
_content_set_hook(obj, NULL, content);
|
||||
}
|
||||
|
||||
EAPI Evas_Object *
|
||||
elm_bubble_content_get(const Evas_Object *obj)
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return NULL;
|
||||
return wd->content;
|
||||
return _content_get_hook(obj, NULL);
|
||||
}
|
||||
|
||||
EAPI Evas_Object *
|
||||
elm_bubble_content_unset(Evas_Object *obj)
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
Evas_Object *content;
|
||||
if (!wd) return NULL;
|
||||
if (!wd->content) return NULL;
|
||||
content = wd->content;
|
||||
elm_widget_sub_object_del(obj, content);
|
||||
evas_object_event_callback_del_full(content, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints, obj);
|
||||
edje_object_part_unswallow(wd->bbl, content);
|
||||
wd->content = NULL;
|
||||
return content;
|
||||
return _content_unset_hook(obj, NULL);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
|
|
Loading…
Reference in New Issue