[elm_bubble]add sweep_layout_set apis
authorSohyun Kim <anna1014.kim@samsung.com>
Tue, 19 Oct 2010 08:26:22 +0000 (17:26 +0900)
committerSohyun Kim <anna1014.kim@samsung.com>
Tue, 19 Oct 2010 08:26:22 +0000 (17:26 +0900)
src/lib/Elementary.h.in
src/lib/elm_bubble.c [changed mode: 0644->0755]

index 2596a1a..0fcd4bf 100755 (executable)
@@ -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.
old mode 100644 (file)
new mode 100755 (executable)
index 29e1031..4f050dc
@@ -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.