From: Sohyun Kim Date: Tue, 19 Oct 2010 08:26:22 +0000 (+0900) Subject: [elm_bubble]add sweep_layout_set apis X-Git-Tag: origin~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8ccebadcd6547c62c378b4d9494a65831ef1f490;p=framework%2Fuifw%2Felementary.git [elm_bubble]add sweep_layout_set apis --- diff --git a/src/lib/Elementary.h.in b/src/lib/Elementary.h.in index 2596a1a..0fcd4bf 100755 --- a/src/lib/Elementary.h.in +++ b/src/lib/Elementary.h.in @@ -949,6 +949,8 @@ extern "C" { EAPI Evas_Object *elm_bubble_content_unset(Evas_Object *obj); EAPI void elm_bubble_icon_set(Evas_Object *obj, Evas_Object *icon); EAPI Evas_Object *elm_bubble_icon_get(const Evas_Object *obj); + EAPI void elm_bubble_sweep_layout_set(Evas_Object *obj, Evas_Object *sweep); + EAPI Evas_Object *elm_bubble_sweep_layout_unset(Evas_Object *obj); EAPI void elm_bubble_corner_set(Evas_Object *obj, const char *corner); /* smart callbacks called: * "sweep,left,right" - when bubble is sweeped from left to right, this signal is sent. diff --git a/src/lib/elm_bubble.c b/src/lib/elm_bubble.c old mode 100644 new mode 100755 index 29e1031..4f050dc --- a/src/lib/elm_bubble.c +++ b/src/lib/elm_bubble.c @@ -14,7 +14,7 @@ typedef struct _Widget_Data Widget_Data; struct _Widget_Data { Evas_Object *bbl; - Evas_Object *content, *icon; + Evas_Object *content, *icon, *sweep; const char *label, *info; Eina_Bool down:1; @@ -86,6 +86,7 @@ _sub_del(void *data __UNUSED__, Evas_Object *obj, void *event_info) wd->icon = NULL; edje_object_message_signal_process(wd->bbl); } + else if (sub == wd->sweep) wd->sweep = NULL; _sizing_eval(obj); } @@ -305,8 +306,8 @@ elm_bubble_content_unset(Evas_Object *obj) if (!wd) return NULL; if (!wd->content) return NULL; content = wd->content; - edje_object_part_unswallow(wd->bbl, wd->content); - elm_widget_sub_object_del(obj, wd->content); + elm_widget_sub_object_del(obj, content); + edje_object_part_unswallow(wd->bbl, content); wd->content = NULL; return content; } @@ -363,6 +364,58 @@ elm_bubble_icon_get(const Evas_Object *obj) } /** + * Set the sweep layout + * + * @param obj The bubble object + * @param content The given content of the bubble + * + * This function sets the sweep layout when "sweep,left,right"signal is emitted. + * + * @ingroup Bubble + */ +EAPI void +elm_bubble_sweep_layout_set(Evas_Object *obj, Evas_Object *sweep) +{ + ELM_CHECK_WIDTYPE(obj, widtype); + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return; + if (wd->sweep == sweep) return; + if (wd->sweep) evas_object_del(wd->sweep); + wd->sweep = sweep; + if (sweep) + { + elm_widget_sub_object_add(obj, sweep); + edje_object_part_swallow(wd->bbl, "elm.swallow.sweep", sweep); + } +} + +/** + * Unset the sweep layout + * + * @param obj The bubble object + * @param content The given content of the bubble + * + * This function sets the sweep layout when "sweep,right,left"signal is emitted. + * + * @ingroup Bubble + */ +EAPI Evas_Object * +elm_bubble_sweep_layout_unset(Evas_Object *obj) +{ + ELM_CHECK_WIDTYPE(obj, widtype) NULL; + Widget_Data *wd = elm_widget_data_get(obj); + Evas_Object *sweep; + if (!wd) return NULL; + if (!wd->sweep) return NULL; + sweep = wd->sweep; + elm_widget_sub_object_del(obj, sweep); + edje_object_part_unswallow(wd->bbl, sweep); + evas_object_hide(sweep); + wd->sweep = NULL; + return sweep; +} + +/** * Set the corner of the bubble * * @param obj The bubble object.