Merge branch 'master' of hyoyoung.chang@165.213.180.234:/git/slp/pkgs/elementary
authorHyoyoung Chang <hyoyoung.chang@samsung.com>
Mon, 26 Jul 2010 07:28:16 +0000 (16:28 +0900)
committerHyoyoung Chang <hyoyoung.chang@samsung.com>
Mon, 26 Jul 2010 07:28:16 +0000 (16:28 +0900)
debian/changelog
src/lib/Elementary.h.in
src/lib/elm_controlbar.c
src/lib/elm_ctxpopup.c
src/lib/elm_segment_control.c
src/lib/elm_softkey.c
src/modules/ctxpopup_copypasteUI/copypaste.c

index a8eabbf..092ef1a 100644 (file)
@@ -1,3 +1,12 @@
+elementary (0.4.0+svn.49550slp2+3build25) unstable; urgency=low
+
+  * [Segment Control] Resizing issue fixed.
+  * [elm_ctxpopup.c]
+  * Git: 165.213.180.234:/git/slp/pkgs/elementary
+  * Tag: elementary_0.4.0+svn.49550slp2+3build25
+
+ -- ChunEon Park <chuneon.park@samsung.com>  Mon, 26 Jul 2010 09:41:13 +0900
+
 elementary (0.4.0+svn.49550slp2+3build24) unstable; urgency=low
 
   * [els_touch] commit initial els_touch file which will be used by elm_webview
index 5042096..7ff396d 100755 (executable)
@@ -1273,7 +1273,7 @@ extern "C" {
    EAPI Evas_Object *elm_pager_content_bottom_get(const Evas_Object *obj);
    EAPI Evas_Object *elm_pager_content_top_get(const Evas_Object *obj);
    EAPI void         elm_pager_animation_set(Evas_Object *obj, Eina_Bool animation);
-  /* available item styles:
+   /* available item styles:
     * default
     * fade
     * fade_translucide
@@ -1792,7 +1792,7 @@ extern "C" {
     * default
     */
 
-    /* titlebar */
+   /* titlebar */
    EAPI Evas_Object *elm_titlebar_add(Evas_Object *parent);
    EAPI void         elm_titlebar_label_set(Evas_Object *obj, const char *label);
    EAPI const char  *elm_titlebar_label_get(Evas_Object *obj);
@@ -1849,8 +1849,18 @@ extern "C" {
    EAPI void         elm_popup_response(Evas_Object *obj, int  response_id);
    EAPI void         elm_popup_orient_set(Evas_Object *obj, Elm_Popup_Orient orient);
    EAPI void         elm_popup_rotation_set(Evas_Object *obj, int rot_angle);
+
    /* Contextual Popup */
    typedef struct _Ctxpopup_Item Elm_Ctxpopup_Item;
+   
+   typedef enum _Ctxpopup_Arrow_Direction
+{
+       ELM_CTXPOPUP_ARROW_DOWN,
+       ELM_CTXPOPUP_ARROW_RIGHT,
+       ELM_CTXPOPUP_ARROW_LEFT,
+       ELM_CTXPOPUP_ARROW_UP,
+} Elm_Ctxpopup_Arrow;
+   
 
    EAPI Evas_Object *elm_ctxpopup_add(Evas_Object *parent);
    EAPI void         elm_ctxpopup_horizontal_set(Evas_Object *obj, Eina_Bool horizontal);
@@ -1870,7 +1880,7 @@ extern "C" {
    EAPI void         elm_ctxpopup_align_set(Evas_Object *obj, double align_x, double align_y);
    EAPI void         elm_ctxpopup_align_get(Evas_Object *obj, double *align_x, double *align_y);
    EAPI void         elm_ctxpopup_button_append(Evas_Object *obj, const char *label, Evas_Smart_Cb func, const void *data);
-
+       EAPI void               elm_ctxpopup_arrow_priority_set(Evas_Object *obj, Elm_Ctxpopup_Arrow first, Elm_Ctxpopup_Arrow second, Elm_Ctxpopup_Arrow third, Elm_Ctxpopup_Arrow fourth);
    
    /* QuickContactBadge */
    typedef struct _Quickcontactbadge_Item Elm_Quickcontactbadge_Item;
@@ -1948,7 +1958,7 @@ extern "C" {
    EAPI Eina_Bool     elm_animator_operating_get(Elm_Animator *animator);
    EAPI unsigned int  elm_animator_repeat_get(Elm_Animator *animator);
 
-  /* tansit */
+   /* tansit */
    typedef struct _transit Elm_Transit;
    typedef struct _effect Elm_Effect;
 
@@ -1967,32 +1977,32 @@ extern "C" {
    EAPI void         elm_transit_fx_clear(Elm_Transit* transit);
    EAPI Eina_Bool    elm_transit_event_block_disabled_get(Elm_Transit* transit);
 
-   /*Translation FX*/  
+   /* Translation FX */
    EAPI Elm_Effect  *elm_fx_translation_add(Evas_Object* obj, Evas_Coord from_x, Evas_Coord from_y, Evas_Coord to_x, Evas_Coord to_y);
 
-   /*Resizing FX*/  
+   /* Resizing FX */
    EAPI Elm_Effect  *elm_fx_resizing_add(Evas_Object* obj, Evas_Coord from_w, Evas_Coord from_h, Evas_Coord to_w, Evas_Coord to_h);
 
-   /*Zoom Fx*/  
+   /* Zoom Fx */
    EAPI Elm_Effect  *elm_fx_zoom_add(Evas_Object* obj, float from_rate, float to_rate);
 
-   /*Flip Fx*/
+   /* Flip Fx */
    typedef enum {ELM_FX_FLIP_AXIS_X, ELM_FX_FLIP_AXIS_Y} Elm_Fx_Flip_Axis;
    EAPI Elm_Effect  *elm_fx_flip_add( Evas_Object* front, Evas_Object* back, Elm_Fx_Flip_Axis axis, Eina_Bool cw);
 
-   /*Blend Fx*/
+   /* Blend Fx */
    EAPI Elm_Effect  *elm_fx_blend_add(Evas_Object* before, Evas_Object* after);
 
-   /*Fade Fx*/
+   /* Fade Fx */
    EAPI Elm_Effect  *elm_fx_fade_add(Evas_Object* before, Evas_Object* after);
     
-   /*Rotation Fx*/
+   /* Rotation Fx */
    EAPI Elm_Effect  *elm_fx_rotation_add(Evas_Object* obj, float from_degree, float to_degree, Eina_Bool cw);
 
-   /*Color Fx*/
+   /* Color Fx */
    EAPI Elm_Effect  *elm_fx_color_add(Evas_Object* obj, unsigned int from_r, unsigned int from_g, unsigned int from_b, unsigned int from_a, unsigned int to_r, unsigned int to_g, unsigned int to_b, unsigned int to_a);
 
-   /*Wipe Fx*/
+   /* Wipe Fx */
    typedef enum 
      {
        ELM_FX_WIPE_DIR_LEFT, 
@@ -2007,7 +2017,7 @@ extern "C" {
      } Elm_Fx_Wipe_Type;
    EAPI Elm_Effect  *elm_fx_wipe_add(Evas_Object* obj, Elm_Fx_Wipe_Type type, Elm_Fx_Wipe_Dir dir);
 
-   /*ResizableFlip Fx*/
+   /* ResizableFlip Fx */
    EAPI Elm_Effect  *elm_fx_resizable_flip_add(Evas_Object* front, Evas_Object* back, Elm_Fx_Flip_Axis axis, Eina_Bool cw);
   
    /*Transform Fx*/
@@ -2086,6 +2096,12 @@ extern "C" {
    #define CONTROLBAR_SYSTEM_ICON_FAVORITES "controlbar_favorites" 
    #define CONTROLBAR_SYSTEM_ICON_LOGS "controlbar_logs" 
 
+   typedef enum _Elm_Controlbar_Mode_Type{
+       ELM_CONTROLBAR_MODE_DEFAULT = 0,
+       ELM_CONTROLBAR_MODE_LARGE,
+       ELM_CONTROLBAR_MODE_SMALL
+   } Elm_Controlbar_Mode_Type;
+
    typedef struct _Elm_Controlbar_Item Elm_Controlbar_Item;
 
    EAPI Evas_Object *elm_controlbar_add(Evas_Object *parent);
@@ -2116,6 +2132,8 @@ extern "C" {
    EAPI Elm_Controlbar_Item *elm_controlbar_item_next(Elm_Controlbar_Item *it);
    EAPI void         elm_controlbar_edit_start(Evas_Object *obj);
    EAPI void         elm_controlbar_view_set(Evas_Object *obj, Evas_Object *view);
+   EAPI void         elm_controlbar_item_view_set(Elm_Controlbar_Item *it, Evas_Object * view);
+   EAPI void         elm_controlbar_mode_set(Evas_Object *obj, int mode);
 
 
   /* diskcontroller */
@@ -2175,19 +2193,19 @@ extern "C" {
 
 
    /* colorpalette */
-    typedef struct _Colorpalette_Color Elm_Colorpalette_Color; 
+   typedef struct _Colorpalette_Color Elm_Colorpalette_Color; 
 
-    struct _Colorpalette_Color 
-      {
-        unsigned int r, g, b;
-      };
+   struct _Colorpalette_Color 
+     {
+       unsigned int r, g, b;
+     };
 
-    EAPI Evas_Object *elm_colorpalette_add(Evas_Object *parent);
-    EAPI void         elm_colorpalette_color_set(Evas_Object *obj, int color_num, Elm_Colorpalette_Color *color);
-    EAPI void         elm_colorpalette_row_column_set(Evas_Object *obj, int row, int col);
-    /* smart callbacks called:
-     * "clicked" - when image clicked
-     */
+   EAPI Evas_Object *elm_colorpalette_add(Evas_Object *parent);
+   EAPI void         elm_colorpalette_color_set(Evas_Object *obj, int color_num, Elm_Colorpalette_Color *color);
+   EAPI void         elm_colorpalette_row_column_set(Evas_Object *obj, int row, int col);
+   /* smart callbacks called:
+    * "clicked" - when image clicked
+    */
 
    /* editfield */
    EAPI Evas_Object *elm_editfield_add(Evas_Object *parent);
@@ -2287,7 +2305,7 @@ extern "C" {
     * "down_clicked" - when down button of zoomcontrols is clicked
     */         
 
-   /*viewflipper*/
+   /* viewflipper */
    typedef enum _Elm_Viewflipper_Policy
      {
        ERROR_0  = -1,    //can not find wanted value
@@ -2362,7 +2380,7 @@ extern "C" {
    /* AnalogClock */
    EAPI Evas_Object *elm_analogclock_add(Evas_Object *parent);
 
-    /* ratingbar */
+   /* ratingbar */
    EAPI Evas_Object *elm_ratingbar_add(Evas_Object *parent);
    EAPI void         elm_ratingbar_rating_set(Evas_Object *obj, int rating);
    EAPI int          elm_ratingbar_rating_get(Evas_Object *obj);
@@ -2462,7 +2480,7 @@ extern "C" {
    EAPI Eina_Bool           elm_cabinet_item_sub_info_disabled_get(Elm_Cabinet_Item *item);
    EAPI void                elm_cabinet_item_sub_info_disabled_set(Elm_Cabinet_Item *item, Eina_Bool disabled);
 
-   /*Dayselector*/
+   /* Dayselector */
    typedef enum 
      { 
        ELM_DAYSELECTOR_SUN, 
index 5949f60..7a0ce5c 100644 (file)
@@ -47,12 +47,13 @@ struct _Widget_Data
    Evas_Object * box;
    Evas_Object * event_box;
    
-      //Evas_Object *center_box;
-   Evas_Object * rect;
    Evas_Object * moving_obj;
    Elm_Controlbar_Item * moving_item;
+   Elm_Controlbar_Item * pre_item;
+   Elm_Controlbar_Item * cur_item;
    Evas_Coord x, y, w, h;
    Eina_Bool edit_mode;
+   int mode;
    int empty_num;
    int num;
    Eina_List * items;
@@ -97,7 +98,7 @@ struct _Animation_Data
    Evas_Coord th;
    unsigned int start_time;
    double time;
-   void (*func) (void *data, Evas_Object * obj);
+   int (*func) (void *data, Evas_Object * obj);
    void *data;
    Ecore_Animator * timer;
 };
@@ -244,17 +245,17 @@ _del_hook(Evas_Object * obj)
        wd->event_box = NULL;
      }
    EINA_LIST_FREE(wd->items, item)
-     {
-       eina_stringshare_del(item->label);
-       if (item->icon)
-         evas_object_del(item->icon);
-       if (item->base)
-         evas_object_del(item->base);
-       if (item->edit_item)
-         evas_object_del(item->edit_item);
-       free(item);
-       item = NULL;
-     }
+   {
+      eina_stringshare_del(item->label);
+      if (item->icon)
+        evas_object_del(item->icon);
+      if (item->base)
+        evas_object_del(item->base);
+      if (item->edit_item)
+        evas_object_del(item->edit_item);
+      free(item);
+      item = NULL;
+   }
    free(wd);
    wd = NULL;
 }
@@ -278,44 +279,44 @@ _theme_hook(Evas_Object * obj)
    _elm_theme_object_set(obj, wd->edit_box, "controlbar", "edit_box",
                          elm_widget_style_get(obj));
    EINA_LIST_FOREACH(wd->items, l, item)
-     {
-       if (item->style != OBJECT)
-         {
-            elm_layout_theme_set(item->base, "controlbar", "item",
-                  elm_widget_style_get(obj));
-            object_color_set(item->base, "elm.tabbar.default.color", "elm.swallow.icon");
-            elm_layout_theme_set(item->edit_item, "controlbar", "item",
-                  elm_widget_style_get(obj));
-            if (!item->editable)
-              {
-                 color =
-                    (Evas_Object *)
-                    edje_object_part_object_get(_EDJ(item->edit_item),
-                          "elm.edit.item.color");
-                 if (color)
-                   evas_object_color_get(color, &r, &g, &b, &a);
-                 evas_object_color_set(item->edit_item, r, g, b, a);
-              }
-            if (item->label)
-              {
-                 edje_object_part_text_set(_EDJ(item->base), "elm.text",
-                       item->label);
-                 edje_object_part_text_set(_EDJ(item->edit_item), "elm.text",
-                       item->label);
-              }
-            if (item->label && item->icon)
-              {
-                 edje_object_signal_emit(_EDJ(item->base),
-                       "elm,state,icon_text", "elm");
-                 edje_object_signal_emit(_EDJ(item->edit_item),
-                       "elm,state,icon_text", "elm");
-              }
-            if (item->selected)
-              {
-                 selected_box(item);
-              }
-         }
-     }
+   {
+      if (item->style != OBJECT)
+       {
+          elm_layout_theme_set(item->base, "controlbar", "item",
+                                elm_widget_style_get(obj));
+          object_color_set(item->base, "elm.tabbar.default.color", "elm.swallow.icon");
+          elm_layout_theme_set(item->edit_item, "controlbar", "item",
+                                 elm_widget_style_get(obj));
+          if (!item->editable)
+            {
+               color =
+                  (Evas_Object *)
+                  edje_object_part_object_get(_EDJ(item->edit_item),
+                                              "elm.edit.item.color");
+               if (color)
+                  evas_object_color_get(color, &r, &g, &b, &a);
+               evas_object_color_set(item->edit_item, r, g, b, a);
+            }
+          if (item->label)
+            {
+               edje_object_part_text_set(_EDJ(item->base), "elm.text",
+                                          item->label);
+               edje_object_part_text_set(_EDJ(item->edit_item), "elm.text",
+                                          item->label);
+            }
+          if (item->label && item->icon)
+            {
+               edje_object_signal_emit(_EDJ(item->base),
+                                        "elm,state,icon_text", "elm");
+               edje_object_signal_emit(_EDJ(item->edit_item),
+                                        "elm,state,icon_text", "elm");
+            }
+          if (item->selected)
+            {
+               selected_box(item);
+            }
+       }
+   }
 }
 
 static void 
@@ -369,11 +370,13 @@ static void
 set_evas_map(Evas_Object * obj, Evas_Coord x, Evas_Coord y, Evas_Coord w,
             Evas_Coord h) 
 {
-   if (!obj) return;
-   
+   if (obj == NULL)
+     {
+       return;
+     }
    Evas_Map * map = evas_map_new(4);
-   if (!map) return;
-   
+   if (map == NULL)
+      return;
    evas_map_smooth_set(map, EINA_TRUE);
    evas_map_util_points_populate_from_object_full(map, obj, 0);
    evas_object_map_enable_set(obj, EINA_TRUE);
@@ -433,13 +436,198 @@ move_evas_map(void *data)
    return EXIT_FAILURE;
 }
 
+
+static int
+move_evas_object(void *data) 
+{
+   double t;
+
+   int dx, dy, dw, dh;
+
+   int px, py, pw, ph;
+
+   int x, y, w, h;
+
+   Animation_Data * ad = (Animation_Data *) data;
+   t = ELM_MAX(0.0, current_time_get() - ad->start_time) / 1000;
+   dx = ad->tx - ad->fx;
+   dy = ad->ty - ad->fy;
+   dw = ad->tw - ad->fw;
+   dh = ad->th - ad->fh;
+   if (t <= ad->time)
+     {
+       x = (1 * sin((t / ad->time) * (M_PI / 2)) * dx);
+       y = (1 * sin((t / ad->time) * (M_PI / 2)) * dy);
+       w = (1 * sin((t / ad->time) * (M_PI / 2)) * dw);
+       h = (1 * sin((t / ad->time) * (M_PI / 2)) * dh);
+     }
+   else
+     {
+       x = dx;
+       y = dy;
+       w = dw;
+       h = dh;
+     }
+   px = ad->fx + x;
+   py = ad->fy + y;
+   pw = ad->fw + w;
+   ph = ad->fh + h;
+   if (x == dx && y == dy && w == dw && h == dh)
+     {
+       ecore_animator_del(ad->timer);
+       ad->timer = NULL;
+       evas_object_move(ad->obj, px, py);
+       evas_object_resize(ad->obj, pw, ph);
+       if (ad->func != NULL)
+          ad->func(ad->data, ad->obj);
+     }
+   else
+     {
+       evas_object_move(ad->obj, px, py);
+       evas_object_resize(ad->obj, pw, ph);
+     }
+   return EXIT_FAILURE;
+}
+
+static int
+move_fade_out_object(void *data) 
+{
+   double t;
+
+   int dx, dy, dw, dh, da;
+
+   int px, py, pw, ph, pa;
+
+   int x, y, w, h, a;
+
+   int r, g, b;
+
+   Animation_Data * ad = (Animation_Data *) data;
+   t = ELM_MAX(0.0, current_time_get() - ad->start_time) / 1000;
+   dx = ad->tx - ad->fx;
+   dy = ad->ty - ad->fy;
+   dw = ad->tw - ad->fw;
+   dh = ad->th - ad->fh;
+   da = 255;
+   if (t <= ad->time)
+     {
+       x = (1 * sin((t / ad->time) * (M_PI / 2)) * dx);
+       y = (1 * sin((t / ad->time) * (M_PI / 2)) * dy);
+       w = (1 * sin((t / ad->time) * (M_PI / 2)) * dw);
+       h = (1 * sin((t / ad->time) * (M_PI / 2)) * dh);
+       a = (1 * sin((t / ad->time) * (M_PI / 2)) * da);
+     }
+   else
+     {
+       x = dx;
+       y = dy;
+       w = dw;
+       h = dh;
+       a = da;
+     }
+   px = ad->fx + x;
+   py = ad->fy + y;
+   pw = ad->fw + w;
+   ph = ad->fh + h;
+   pa = 255 - a;
+   if (x == dx && y == dy && w == dw && h == dh)
+     {
+       ecore_animator_del(ad->timer);
+       ad->timer = NULL;
+       evas_object_move(ad->obj, px, py);
+       //evas_object_resize(ad->obj, 480, 600);
+       evas_object_resize(ad->obj, pw, ph);
+       evas_object_color_get(ad->obj, &r, &g, &b, &a);
+       evas_object_color_set(ad->obj, r, g, b, pa);
+       evas_object_show(ad->obj);
+       if (ad->func != NULL)
+          ad->func(ad->data, ad->obj);
+     }
+   else
+     {
+       evas_object_move(ad->obj, px, py);
+       //evas_object_resize(ad->obj, 480, 600);
+       evas_object_resize(ad->obj, pw, ph);
+       evas_object_color_get(ad->obj, &r, &g, &b, &a);
+       evas_object_color_set(ad->obj, r, g, b, pa);
+       evas_object_show(ad->obj);
+     }
+   return EXIT_FAILURE;
+}
+
+static int
+move_fade_in_object(void *data) 
+{
+   double t;
+
+   int dx, dy, dw, dh, da;
+
+   int px, py, pw, ph, pa;
+
+   int x, y, w, h, a;
+
+   int r, g, b;
+
+   Animation_Data * ad = (Animation_Data *) data;
+   t = ELM_MAX(0.0, current_time_get() - ad->start_time) / 1000;
+   dx = ad->tx - ad->fx;
+   dy = ad->ty - ad->fy;
+   dw = ad->tw - ad->fw;
+   dh = ad->th - ad->fh;
+   da = 255;
+   if (t <= ad->time)
+     {
+       x = (1 * sin((t / ad->time) * (M_PI / 2)) * dx);
+       y = (1 * sin((t / ad->time) * (M_PI / 2)) * dy);
+       w = (1 * sin((t / ad->time) * (M_PI / 2)) * dw);
+       h = (1 * sin((t / ad->time) * (M_PI / 2)) * dh);
+       a = (1 * sin((t / ad->time) * (M_PI / 2)) * da);
+     }
+   else
+     {
+       x = dx;
+       y = dy;
+       w = dw;
+       h = dh;
+       a = da;
+     }
+   px = ad->fx + x;
+   py = ad->fy + y;
+   pw = ad->fw + w;
+   ph = ad->fh + h;
+   pa = a;
+   if (x == dx && y == dy && w == dw && h == dh)
+     {
+       ecore_animator_del(ad->timer);
+       ad->timer = NULL;
+       evas_object_move(ad->obj, px, py);
+       //evas_object_resize(ad->obj, 480, 600);
+       evas_object_resize(ad->obj, pw, ph);
+       evas_object_color_get(ad->obj, &r, &g, &b, &a);
+       evas_object_color_set(ad->obj, r, g, b, pa);
+       evas_object_show(ad->obj);
+       if (ad->func != NULL)
+          ad->func(ad->data, ad->obj);
+     }
+   else
+     {
+       evas_object_move(ad->obj, px, py);
+       //evas_object_resize(ad->obj, 480, 600);
+       evas_object_resize(ad->obj, pw, ph);
+       evas_object_color_get(ad->obj, &r, &g, &b, &a);
+       evas_object_color_set(ad->obj, r, g, b, pa);
+       evas_object_show(ad->obj);
+     }
+   return EXIT_FAILURE;
+}
+
 static void
 move_object_with_animation(Evas_Object * obj, Evas_Coord x, Evas_Coord y,
                           Evas_Coord w, Evas_Coord h, Evas_Coord x_,
                           Evas_Coord y_, Evas_Coord w_, Evas_Coord h_,
-                          double time, void (*func) (void *data,
-                                                     Evas_Object * obj),
-                          void *data) 
+                          double time, int (*mv_func) (void *data),
+                          void (*func) (void *data,
+                          Evas_Object * obj), void *data) 
 {
    Animation_Data * ad = (Animation_Data *) malloc(sizeof(Animation_Data));
    ad->obj = obj;
@@ -455,7 +643,7 @@ move_object_with_animation(Evas_Object * obj, Evas_Coord x, Evas_Coord y,
    ad->time = time;
    ad->func = func;
    ad->data = data;
-   ad->timer = ecore_animator_add(move_evas_map, ad);
+   ad->timer = ecore_animator_add(mv_func, ad);
 }
 
 /////////////////////////////////////////////////////////////
@@ -519,27 +707,27 @@ item_insert_in_bar(Elm_Controlbar_Item * it, int order)
    int check = 0;
 
    EINA_LIST_FOREACH(wd->items, l, item)
-     {
-       if (item->order == order && item != it)
-         check = 1;
-     }
+   {
+      if (item->order == order && item != it)
+        check = 1;
+   }
    if (check)
      {
        EINA_LIST_FOREACH(wd->items, l, item)
-         {
-            if (item->order > 0)
-              elm_table_unpack(wd->box, item->base);
-         }
+       {
+          if (item->order > 0)
+             elm_table_unpack(wd->box, item->base);
+       }
        EINA_LIST_FOREACH(wd->items, l, item)
-         {
-            if (item->order > 0)
-              {
-                 if (item->order >= order)
-                   item->order += 1;
-                 elm_table_pack(wd->box, item->base, item->order - 1, 0, 1, 1);
-                 evas_object_show(item->base);
-              }
-         }
+       {
+          if (item->order > 0)
+            {
+               if (item->order >= order)
+                  item->order += 1;
+               elm_table_pack(wd->box, item->base, item->order - 1, 0, 1, 1);
+               evas_object_show(item->base);
+            }
+       }
      }
    it->order = order;
    elm_table_pack(wd->box, it->base, order - 1, 0, 1, 1);
@@ -556,26 +744,26 @@ item_delete_in_bar(Elm_Controlbar_Item * it)
    int i = 0;
 
    EINA_LIST_FOREACH(wd->items, l, item)
-     {
-       if (item == it)
-         {
-            i = it->order;
-            it->order = 0;
-            elm_table_unpack(wd->box, it->base);
-            evas_object_hide(it->base);
-         }
-     }
+   {
+      if (item == it)
+       {
+          i = it->order;
+          it->order = 0;
+          elm_table_unpack(wd->box, it->base);
+          evas_object_hide(it->base);
+       }
+   }
    if (i)
      {
        EINA_LIST_FOREACH(wd->items, l, item)
-         {
-            if (item->order > i)
-              {
-                 item->order--;
-                 elm_table_unpack(wd->box, item->base);
-                 elm_table_pack(wd->box, item->base, item->order - 1, 0, 1, 1);
-              }
-         }
+       {
+          if (item->order > i)
+            {
+               item->order--;
+               elm_table_unpack(wd->box, item->base);
+               elm_table_pack(wd->box, item->base, item->order - 1, 0, 1, 1);
+            }
+       }
      }
 }
 
@@ -606,10 +794,10 @@ item_exchange_in_bar(Elm_Controlbar_Item * it1, Elm_Controlbar_Item * it2)
    evas_object_geometry_get(it2->base, &x_, &y_, &w_, &h_);
    wd->animating++;
    move_object_with_animation(it1->base, x, y, w, h, x_, y_, w_, h_, 0.25,
-                              item_exchange_animation_cb, wd);
+                              move_evas_map, item_exchange_animation_cb, wd);
    wd->animating++;
    move_object_with_animation(it2->base, x_, y_, w_, h_, x, y, w, h, 0.25,
-                              item_exchange_animation_cb, wd);
+                              move_evas_map, item_exchange_animation_cb, wd);
    elm_table_unpack(wd->box, it1->base);
    elm_table_unpack(wd->box, it2->base);
    order = it1->order;
@@ -662,7 +850,7 @@ item_change_in_bar(Elm_Controlbar_Item * it)
    evas_object_geometry_get(it->edit_item, &x_, &y_, &w_, &h_);
    wd->animating++;
    move_object_with_animation(it->base, x, y, w, h, x_, y_, w_, h_, 0.25,
-                              item_change_animation_cb, wd);
+                              move_evas_map, item_change_animation_cb, wd);
    evas_object_geometry_get(wd->moving_item->base, &x, &y, &w, &h);
    set_evas_map(wd->moving_item->base, x, y, w, h);
 }
@@ -670,107 +858,169 @@ item_change_in_bar(Elm_Controlbar_Item * it)
 static void
 object_color_set(Evas_Object *ly, const char *color_part, const char *obj_part)
 {
-   Evas_Object *color;
-   int r, g, b, a;
+       Evas_Object *color;
+       int r, g, b, a;
 
-   color =
-      (Evas_Object *) edje_object_part_object_get(_EDJ(ly), color_part);
-   if (color)
-     evas_object_color_get(color, &r, &g, &b, &a);
-   color =
-      edje_object_part_swallow_get(_EDJ(ly), obj_part);
-   evas_object_color_set(color, r, g, b, a);
+       color =
+                (Evas_Object *) edje_object_part_object_get(_EDJ(ly), color_part);
+       if (color)
+          evas_object_color_get(color, &r, &g, &b, &a);
+       color =
+          edje_object_part_swallow_get(_EDJ(ly), obj_part);
+       evas_object_color_set(color, r, g, b, a);
 }
 
-static void 
-selected_box(Elm_Controlbar_Item * it) 
+static void
+_end_selected_box(void *data, Evas_Object *obj)
 {
-   Widget_Data * wd = elm_widget_data_get(it->obj);
+       Widget_Data * wd = (Widget_Data *)data;
 
-   if(it->style == TABBAR)
-     {
-       it->selected = EINA_TRUE;
-       evas_object_smart_callback_call(it->obj, "view,change,before", it);
-       object_color_set(it->base, "elm.tabbar.selected.color", "elm.swallow.icon");
-       edje_object_signal_emit(_EDJ(it->base), "elm,state,selected",
-             "elm");
-       edje_object_part_swallow(wd->view, "elm.swallow.view",
-             it->view);
-       evas_object_show(it->view);
+       edje_object_signal_emit(_EDJ(wd->pre_item->base), "elm,state,unselected", "elm");
+       edje_object_signal_emit(_EDJ(wd->cur_item->base), "elm,state,selected", "elm");
 
-     }
-   else if(it->style == TOOLBAR)
+   wd->animating--;
+   if (wd->animating < 0)
      {
-       if (it->func)
-         it->func(it->data, it->obj, it);
+       printf("animation error\n");
+       wd->animating = 0;
      }
+}
 
-   evas_object_smart_callback_call(it->obj, "clicked", it);
+static void
+move_selected_box(Widget_Data *wd, Elm_Controlbar_Item * fit, Elm_Controlbar_Item * tit)
+{
+       Evas_Coord fx, fy, fw, fh, tx, ty, tw, th;
+       Evas_Object *from, *to;
+
+       from = (Evas_Object *)edje_object_part_object_get(_EDJ(fit->base), "bg_img");
+       evas_object_geometry_get(from, &fx, &fy, &fw, &fh);
+
+       to = (Evas_Object *)edje_object_part_object_get(_EDJ(tit->base), "bg_img");
+       evas_object_geometry_get(to, &tx, &ty, &tw, &th);
+
+       edje_object_signal_emit(_EDJ(wd->pre_item->base), "elm,state,unselected", "elm");
+       edje_object_signal_emit(_EDJ(wd->cur_item->base), "elm,state,selected", "elm");
+       printf("layer from : %d to : %d \n", evas_object_layer_get(fit->base),evas_object_layer_get(tit->base));
+
+       Evas_Object *icon = (Evas_Object *)edje_object_part_object_get(_EDJ(tit->base), "elm.swallow.icon");
+       //evas_object_stack_below(from, icon);
+       //evas_object_raise(from);
+       evas_object_layer_set(fit->base, 123);
+       wd->animating++;
+       move_object_with_animation(to, fx, fy, fw, fh, tx, ty, tw, th,
+                                   0.6, move_evas_object, _end_selected_box, wd);
 }
 
 static void
-clicked_box_cb(void *data, Evas_Object * obj, const char *emission,
-              const char *source) 
+end_selected_box(void *data, Evas_Object *obj)
 {
-   Widget_Data * wd = (Widget_Data *) data;
+       Widget_Data * wd = (Widget_Data *)data;
+
+       printf("end selected box\n");
+       wd->pre_item->selected = EINA_FALSE;
+       edje_object_part_unswallow(wd->view, wd->pre_item->view);
+       evas_object_hide(wd->pre_item->view);
+
+       edje_object_part_swallow(wd->view, "elm.swallow.view", obj);
+       evas_object_show(obj);
+}
+
+static void 
+selected_box(Elm_Controlbar_Item * it) 
+{
+   Widget_Data * wd = elm_widget_data_get(it->obj);
    const Eina_List *l;
+   Elm_Controlbar_Item * item, *fit = NULL;
+   Evas_Coord x, y, w, h;
 
-   Elm_Controlbar_Item * item;
-   if (wd == NULL)
-      return;
-   if (wd->edit_mode)
-      return;
-   EINA_LIST_FOREACH(wd->items, l, item)
-     {
-       if (item->style == TABBAR)
-         {
-            object_color_set(item->base, "elm.tabbar.default.color", "elm.swallow.icon");
-            edje_object_signal_emit(_EDJ(item->base), "elm,state,unselected", "elm");
-            edje_object_signal_emit(_EDJ(item->base), "elm,state,text_unselected", "elm");
-         }
-       if (_EDJ(item->base) == obj)
-         {
-            selected_box(item);
-         }
-       else
-         {
-            item->selected = EINA_FALSE;
-            edje_object_part_unswallow(wd->view, item->view);
-            evas_object_hide(item->view);
-         }
-     }
+   if(wd->animating) return;
+
+   wd->cur_item = it;
+
+   if(it->style == TABBAR){
+
+          EINA_LIST_FOREACH(wd->items, l, item){
+                 if(item->selected) {
+                         fit = item;
+                         wd->pre_item = fit;
+                 }
+                 item->selected = EINA_FALSE;
+                 edje_object_part_unswallow(wd->view, item->view);
+                 evas_object_hide(item->view);
+          }
+          it->selected = EINA_TRUE;
+          evas_object_smart_callback_call(it->obj, "view,change,before", it);
+          object_color_set(it->base, "elm.tabbar.selected.color", "elm.swallow.icon");
+          
+          if(fit != NULL && fit != it)
+                  move_selected_box(wd, fit, it);
+          else 
+                  edje_object_signal_emit(_EDJ(it->base), "elm,state,selected", "elm");
+
+
+          if(fit != NULL && fit != it){
+               evas_object_geometry_get(fit->view, &x, &y, &w, &h);
+//             move_object_with_animation(fit->view, x, y, w, h, x, y, w, h, 0.5, move_fade_out_object, NULL, NULL);
+//             if(fit->order > it->order)
+//                     move_object_with_animation(it->view, x+20, y, w, h, x, y, w, h, 0.5, move_fade_in_object, NULL, NULL);
+//             else
+//                     move_object_with_animation(it->view, x-20, y, w, h, x, y, w, h, 0.5, move_fade_in_object, NULL, NULL);
+          
+
+               //fit->selected = EINA_FALSE;
+               //edje_object_part_unswallow(wd->view, fit->view);
+               //evas_object_hide(fit->view);
+
+
+               }
+               edje_object_part_swallow(wd->view, "elm.swallow.view", it->view);
+               evas_object_show(it->view);        
+
+   }else if(it->style == TOOLBAR){
+               if (it->func)
+                         it->func(it->data, it->obj, it);
+   }
+
+   evas_object_smart_callback_call(it->obj, "clicked", it);
 }
 
-static int
-unfocused_box_cb(void *data, Evas *evas, Evas_Object *obj, void *event_info) 
+static void
+unpressed_box_cb(void *data, Evas *evas, Evas_Object *obj, void *event_info) 
 {
    Widget_Data * wd = (Widget_Data *) data;
    const Eina_List *l;
+   Evas_Event_Mouse_Up * ev = event_info;
+   Evas_Coord x, y, w, h;
 
    Elm_Controlbar_Item * item;
    EINA_LIST_FOREACH(wd->items, l, item)
-     {
-       if (item->style == TABBAR)
-         {
-            if(item->selected){
-                 object_color_set(item->base, "elm.tabbar.selected.color", "elm.swallow.icon");
-                 edje_object_signal_emit(_EDJ(item->base), "elm,state,selected", "elm");
-            }
-            else
-              {
-                 object_color_set(item->base, "elm.tabbar.default.color", "elm.swallow.icon");
-                 edje_object_signal_emit(_EDJ(item->base), "elm,state,unselected", "elm");
-              }
-         }
-       else if (item->style == TOOLBAR)
-         {
-            object_color_set(item->base, "elm.tabbar.default.color", "elm.swallow.icon");
-            edje_object_signal_emit(_EDJ(item->base), "elm,state,text_unselected", "elm");
+   {
+         evas_object_geometry_get(item->base, &x, &y, &w, &h);
+         if(ev->output.x > x && ev->output.x < x+w && ev->output.y > y && ev->output.y < y+h){
+               selected_box(item);     
+         }else{
+                 if (item->style == TABBAR)
+                 {
+                         if(item->selected){
+                               object_color_set(item->base, "elm.tabbar.selected.color", "elm.swallow.icon");
+                               edje_object_signal_emit(_EDJ(item->base), "elm,state,selected", "elm");
+                         }
+                         else
+                         {
+                               object_color_set(item->base, "elm.tabbar.default.color", "elm.swallow.icon");
+                               edje_object_signal_emit(_EDJ(item->base), "elm,state,unselected", "elm");
+                         }
+                 }
+                 else if (item->style == TOOLBAR)
+               {
+                  object_color_set(item->base, "elm.tabbar.default.color", "elm.swallow.icon");
+                  edje_object_signal_emit(_EDJ(item->base), "elm,state,text_unselected", "elm");
+               }
          }
-     }
-   evas_object_event_callback_del(wd->event_box, EVAS_CALLBACK_MOUSE_UP, unfocused_box_cb);
+   }
+   evas_object_event_callback_del(wd->event_box, EVAS_CALLBACK_MOUSE_UP, unpressed_box_cb);
 
-   return EXIT_SUCCESS;
+       return;
 }
 
 static int
@@ -780,28 +1030,32 @@ pressed_box(Elm_Controlbar_Item * it)
    int check = 0;
    const Eina_List *l;
    Elm_Controlbar_Item * item;
+   
+   if(wd->animating) return;
 
    EINA_LIST_FOREACH(wd->items, l, item)
-     {
-       if (it == item)
-         {
-            if (it->style == TABBAR)
-              {
-                 object_color_set(it->base, "elm.tabbar.selected.color", "elm.swallow.icon");
-                 edje_object_signal_emit(_EDJ(it->base), "elm,state,pressed",
-                       "elm");
-              }
-            else if (it->style == TOOLBAR)
-              {
-                 object_color_set(it->base, "elm.toolbar.pressed.color", "elm.swallow.icon");
-                 edje_object_signal_emit(_EDJ(it->base), "elm,state,text_selected",
-                       "elm");
-              }
-            evas_object_event_callback_add(wd->event_box, EVAS_CALLBACK_MOUSE_UP, unfocused_box_cb, (void *)wd);
-
-            check = EINA_TRUE;
-         }
-     }
+   {
+      if (it == item)
+       {
+          if (it->style == TABBAR)
+            {
+
+               object_color_set(it->base, "elm.tabbar.selected.color", "elm.swallow.icon");
+               edje_object_signal_emit(_EDJ(it->base), "elm,state,pressed",
+                                         "elm");
+            }
+          else if (it->style == TOOLBAR)
+            {
+       
+               object_color_set(it->base, "elm.toolbar.pressed.color", "elm.swallow.icon");
+               edje_object_signal_emit(_EDJ(it->base), "elm,state,text_selected",
+                                         "elm");
+               }
+          evas_object_event_callback_add(wd->event_box, EVAS_CALLBACK_MOUSE_UP, unpressed_box_cb, (void *)wd);
+        
+          check = EINA_TRUE;
+       }
+   }
    if (!check)
       return EXIT_FAILURE;
 
@@ -887,7 +1141,7 @@ edit_item_move_cb(void *data, Evas *evas, Evas_Object *obj, void *event_info)
    Evas_Coord x, y, w, h;
    Widget_Data * wd = (Widget_Data *) data;
    if (wd->animating)
-      return EXIT_FAILURE;
+      return;
    evas_object_geometry_get(wd->moving_obj, &x, &y, &w, &h);
    w *= 2.0;
    h *= 2.0;
@@ -896,23 +1150,23 @@ edit_item_move_cb(void *data, Evas *evas, Evas_Object *obj, void *event_info)
    set_evas_map(wd->moving_obj, x, y, w, h);
 
    EINA_LIST_FOREACH(wd->items, l, item)
-     {
-       if (wd->moving_item->edit_item == item->edit_item || item->style == OBJECT)
-         continue;
-       evas_object_geometry_get(item->base, &x, &y, &w, &h);
-       if (ev->cur.output.x > x && ev->cur.output.x < x + w && ev->cur.output.y > y && ev->cur.output.y < y + h
-             && item->editable)
-         {
-            edje_object_signal_emit(_EDJ(item->base), "elm,state,show,glow",
-                  "elm");
-         }
-       else
-         {
-            edje_object_signal_emit(_EDJ(item->base), "elm,state,hide,glow",
-                  "elm");
-         }
-     }
-   return EXIT_SUCCESS;
+   {
+      if (wd->moving_item->edit_item == item->edit_item || item->style == OBJECT)
+        continue;
+      evas_object_geometry_get(item->base, &x, &y, &w, &h);
+      if (ev->cur.output.x > x && ev->cur.output.x < x + w && ev->cur.output.y > y && ev->cur.output.y < y + h
+          && item->editable)
+       {
+          edje_object_signal_emit(_EDJ(item->base), "elm,state,show,glow",
+                                   "elm");
+       }
+      else
+       {
+          edje_object_signal_emit(_EDJ(item->base), "elm,state,hide,glow",
+                                   "elm");
+       }
+   }
+   return;
 }
 
 static void 
@@ -926,25 +1180,25 @@ edit_item_up_cb(void *data, Evas *evas, Evas_Object *obj, void *event_info)
    Widget_Data * wd = (Widget_Data *) data;
    if (wd->moving_obj)
       if ((int)evas_object_data_get(wd->moving_obj, "returning") == 1)
-        return EXIT_FAILURE;
+        return;
    evas_object_color_set(wd->moving_item->edit_item, 255, 255, 255, 255);
    
-   // check which change or not
-   EINA_LIST_FOREACH(wd->items, l, item)
-     {
-       if (wd->moving_item->edit_item == item->edit_item)
-         continue;
-       if (item->order <= 0)
-         continue;
-       evas_object_geometry_get(item->base, &x, &y, &w, &h);
-       if (ev->output.x > x && ev->output.x < x + w && ev->output.y > y && ev->output.y < y + h
-             && item->style != OBJECT && item->editable)
-         {
-            edje_object_signal_emit(_EDJ(item->base), "elm,state,hide,glow",
-                  "elm");
-            break;
-         }
-     }
+      // check which change or not
+      EINA_LIST_FOREACH(wd->items, l, item)
+   {
+      if (wd->moving_item->edit_item == item->edit_item)
+        continue;
+      if (item->order <= 0)
+        continue;
+      evas_object_geometry_get(item->base, &x, &y, &w, &h);
+      if (ev->output.x > x && ev->output.x < x + w && ev->output.y > y && ev->output.y < y + h
+          && item->style != OBJECT && item->editable)
+       {
+          edje_object_signal_emit(_EDJ(item->base), "elm,state,hide,glow",
+                                   "elm");
+          break;
+       }
+   }
    if (item != NULL)
      {
        if (wd->moving_item->order > 0)
@@ -955,15 +1209,15 @@ edit_item_up_cb(void *data, Evas *evas, Evas_Object *obj, void *event_info)
          {
             item_change_in_bar(item);
          }
-       evas_object_event_callback_del(wd->event_box, EVAS_CALLBACK_MOUSE_UP, edit_item_up_cb);
-       evas_object_event_callback_del(wd->event_box, EVAS_CALLBACK_MOUSE_MOVE, edit_item_move_cb);
+               evas_object_event_callback_del(wd->event_box, EVAS_CALLBACK_MOUSE_UP, edit_item_up_cb);
+               evas_object_event_callback_del(wd->event_box, EVAS_CALLBACK_MOUSE_MOVE, edit_item_move_cb);
      }
    else
      {
-
-       // return moving object to original location
-       evas_object_geometry_get(wd->moving_item->edit_item, &x_, &y_, &w_,
-             &h_);
+       
+          // return moving object to original location
+          evas_object_geometry_get(wd->moving_item->edit_item, &x_, &y_, &w_,
+                                   &h_);
        evas_object_geometry_get(wd->moving_obj, &x, &y, &w, &h);
        w *= 2.0;
        h *= 2.0;
@@ -972,9 +1226,9 @@ edit_item_up_cb(void *data, Evas *evas, Evas_Object *obj, void *event_info)
        evas_object_data_set(wd->moving_obj, "returning", (void *)1);
        wd->animating++;
        move_object_with_animation(wd->moving_obj, x, y, w, h, x_, y_, w_, h_,
-             0.25, edit_item_return_cb, wd);
+                                   0.25, move_evas_map, edit_item_return_cb, wd);
      } 
-   return EXIT_SUCCESS;
+   return;
 }
 
 static void
@@ -994,15 +1248,15 @@ edit_item_down_cb(void *data, Evas * evas, Evas_Object * obj,
    if (wd->animating)
       return;
    EINA_LIST_FOREACH(wd->items, l, item)
-     {
-       if (item->edit_item == obj)
-         break;
-     }
+   {
+      if (item->edit_item == obj)
+        break;
+   }
    if (item == NULL)
-     return;
+      return;
    if (!item->editable)
-     return;
-
+      return;
+   
    evas_object_event_callback_add(wd->event_box, EVAS_CALLBACK_MOUSE_UP, edit_item_up_cb, (void *)wd);
    evas_object_event_callback_add(wd->event_box, EVAS_CALLBACK_MOUSE_MOVE, edit_item_move_cb, (void *)wd);
 
@@ -1010,12 +1264,12 @@ edit_item_down_cb(void *data, Evas * evas, Evas_Object * obj,
    color =
       (Evas_Object *)
       edje_object_part_object_get(_EDJ(wd->moving_item->edit_item),
-           "elm.edit.item.color");
+                                 "elm.edit.item.color");
    if (color)
-     evas_object_color_get(color, &r, &g, &b, &a);
+      evas_object_color_get(color, &r, &g, &b, &a);
    evas_object_color_set(item->edit_item, r, g, b, a);
    if (wd->moving_obj)
-     evas_object_del(wd->moving_obj);
+      evas_object_del(wd->moving_obj);
    wd->moving_obj = NULL;
    wd->moving_obj = create_item_layout(obj, item);
    evas_object_geometry_get(obj, &x, &y, &w, &h);
@@ -1028,7 +1282,7 @@ edit_item_down_cb(void *data, Evas * evas, Evas_Object * obj,
    y_ = ev->output.y - h_;
    wd->animating++;
    move_object_with_animation(wd->moving_obj, x, y, w, h, x_, y_, w_, h_, 0.1,
-                              edit_item_down_end_cb, wd);
+                              move_evas_map, edit_item_down_end_cb, wd);
 }
 
 static void
@@ -1039,10 +1293,10 @@ bar_item_move_end_cb(void *data, Evas_Object * obj)
 
    Elm_Controlbar_Item * item;
    EINA_LIST_FOREACH(wd->items, l, item)
-     {
-       if (item->base == obj)
-         break;
-     }
+   {
+      if (item->base == obj)
+        break;
+   }
    wd->animating--;
    if (wd->animating < 0)
      {
@@ -1060,12 +1314,12 @@ bar_item_animation_end_check(void *data)
    Elm_Controlbar_Item * item;
    Widget_Data * wd = (Widget_Data *) data;
    if (wd->animating)
-     return EXIT_FAILURE;
+      return EXIT_FAILURE;
    EINA_LIST_FOREACH(wd->items, l, item)
-     {
-       if (item->base == wd->moving_obj)
-         break;
-     }
+   {
+      if (item->base == wd->moving_obj)
+        break;
+   }
    if (item == NULL)
      {
        printf("item is NULL\n");
@@ -1094,26 +1348,26 @@ bar_item_move_cb(void *data, Evas *evas, Evas_Object *obj, void *event_info)
    if (wd->moving_obj == NULL)
      {
        printf("%s : moving_obj is NULL\n", __func__);
-       return EXIT_FAILURE;
+       return;
      }
    evas_object_geometry_get(wd->moving_obj, &x, &y, &w, &h);
    x = ev->cur.output.x - w / 2;
    set_evas_map(wd->moving_obj, x, y, w, h);
    EINA_LIST_FOREACH(wd->items, l, item)
-     {
-       if (item->base == wd->moving_obj)
-         {
-            it = item;
-            continue;
-         }
-       if ((int)evas_object_data_get(item->base, "animating") == 1)
-         continue;
-       evas_object_geometry_get(item->base, &x, &y, &w, &h);
-       if (ev->cur.output.x > x && ev->cur.output.x < x + w && item->editable)
-         {
-            break;
-         }
-     }
+   {
+      if (item->base == wd->moving_obj)
+       {
+          it = item;
+          continue;
+       }
+      if ((int)evas_object_data_get(item->base, "animating") == 1)
+        continue;
+      evas_object_geometry_get(item->base, &x, &y, &w, &h);
+      if (ev->cur.output.x > x && ev->cur.output.x < x + w && item->editable)
+       {
+          break;
+       }
+   }
    if (item)
      {
        evas_object_geometry_get(wd->moving_obj, &x_, &y_, &w_, &h_);
@@ -1128,9 +1382,9 @@ bar_item_move_cb(void *data, Evas *evas, Evas_Object *obj, void *event_info)
        wd->animating++;
        evas_object_data_set(item->base, "animating", (void *)1);
        move_object_with_animation(item->base, x, y, w, h, x_, y_, w_, h_,
-             0.25, bar_item_move_end_cb, wd);
+                                   0.25, move_evas_map, bar_item_move_end_cb, wd);
      }
-   return EXIT_SUCCESS;
+   return;
 }
 
 static void 
@@ -1142,9 +1396,9 @@ bar_item_up_cb(void *data, Evas *evas, Evas_Object *obj, void *event_info)
    evas_object_geometry_get(wd->moving_obj, &x, &y, &w, &h);
    tx = ev->output.x - w / 2;
    move_object_with_animation(wd->moving_obj, tx, y, w, h, x, y, w, h, 0.25,
-                              NULL, NULL);
+                              move_evas_map, NULL, NULL);
    ecore_timer_add(0.1, bar_item_animation_end_check, wd);
-   return EXIT_SUCCESS;
+   return;
 }
 
 static void
@@ -1156,21 +1410,21 @@ bar_item_down_cb(void *data, Evas * evas, Evas_Object * obj, void *event_info)
    if (wd->animating)
       return;
    EINA_LIST_FOREACH(wd->items, l, item)
-     {
-       if (item->base == obj)
-         break;
-     }
+   {
+      if (item->base == obj)
+        break;
+   }
    if (item == NULL)
-     return;
+      return;
    if (wd->edit_mode)
      {
        if (!item->editable)
-         return;
+          return;
 
        wd->moving_obj = obj;
        wd->empty_num = item->order;
        evas_object_event_callback_add(wd->event_box, EVAS_CALLBACK_MOUSE_UP, bar_item_up_cb, (void *)wd);
-       evas_object_event_callback_add(wd->event_box, EVAS_CALLBACK_MOUSE_MOVE, bar_item_move_cb, (void *)wd);
+    evas_object_event_callback_add(wd->event_box, EVAS_CALLBACK_MOUSE_MOVE, bar_item_move_cb, (void *)wd);
      }
    else
      {
@@ -1210,14 +1464,15 @@ create_tab_item(Evas_Object * obj, const char *icon_path, const char *label,
    it->base = create_item_layout(wd->edje, it);
    evas_object_event_callback_add(it->base, EVAS_CALLBACK_MOUSE_DOWN,
                                   bar_item_down_cb, wd);
-   edje_object_signal_callback_add(_EDJ(it->base), "elm,action,click", "elm",
-                                   clicked_box_cb, wd);
+   //edje_object_signal_callback_add(_EDJ(it->base), "elm,action,click", "elm",
+       //                          clicked_box_cb, wd);
    object_color_set(it->base, "elm.tabbar.default.color", "elm.swallow.icon");
    evas_object_show(it->base);
    it->edit_item = create_item_layout(wd->edje, it);
    evas_object_event_callback_add(it->edit_item, EVAS_CALLBACK_MOUSE_DOWN,
                                   edit_item_down_cb, wd);
    evas_object_show(it->edit_item);
+
    return it;
 }
 
@@ -1255,8 +1510,8 @@ create_tool_item(Evas_Object * obj, const char *icon_path, const char *label,
    it->base = create_item_layout(wd->edje, it);
    evas_object_event_callback_add(it->base, EVAS_CALLBACK_MOUSE_DOWN,
                                   bar_item_down_cb, wd);
-   edje_object_signal_callback_add(_EDJ(it->base), "elm,action,click", "elm",
-                                   clicked_box_cb, wd);
+   //edje_object_signal_callback_add(_EDJ(it->base), "elm,action,click", "elm",
+       //                          clicked_box_cb, wd);
    object_color_set(it->base, "elm.tabbar.default.color", "elm.swallow.icon");
    evas_object_show(it->base);
    it->edit_item = create_item_layout(wd->edje, it);
@@ -1371,7 +1626,7 @@ set_items_position(Evas_Object * obj, Elm_Controlbar_Item * it,
  *
  * @ingroup Controlbar
  */ 
-EAPI Evas_Object * elm_controlbar_add(Evas_Object * parent)
+   EAPI Evas_Object * elm_controlbar_add(Evas_Object * parent)
 {
    Evas_Object * obj = NULL;
    Widget_Data * wd = NULL;
@@ -1398,6 +1653,7 @@ EAPI Evas_Object * elm_controlbar_add(Evas_Object * parent)
    wd->y = y;
    wd->w = w;
    wd->h = h;
+   wd->mode = ELM_CONTROLBAR_MODE_DEFAULT;
    wd->num = 0;
    wd->animating = 0;
    wd->edit_mode = EINA_FALSE;
@@ -1409,11 +1665,11 @@ EAPI Evas_Object * elm_controlbar_add(Evas_Object * parent)
        return NULL;
      }
    evas_object_show(wd->view);
-
-   // edit box
-   wd->edit_box = edje_object_add(wd->evas);
+   
+      // edit box
+      wd->edit_box = edje_object_add(wd->evas);
    _elm_theme_object_set(obj, wd->edit_box, "controlbar", "edit_box",
-        "default");
+                         "default");
    if (wd->edit_box == NULL)
      {
        printf("Cannot load bg edj\n");
@@ -1432,31 +1688,31 @@ EAPI Evas_Object * elm_controlbar_add(Evas_Object * parent)
    evas_object_smart_callback_add(r_button, "clicked", done_button_cb, wd);
    edje_object_part_swallow(wd->edit_box, "elm.swallow.navigation", r_button);
    */
-   // navigationbar will contribution. but not yet
-   wd->navigation = elm_navigationbar_add(wd->edit_box);
-   r_button = elm_button_add(wd->navigation);
-   elm_button_label_set(r_button, "Done");
-   evas_object_smart_callback_add(r_button, "clicked", done_button_cb, wd);
-   elm_navigationbar_push(wd->navigation, "Configure", NULL, r_button, NULL, NULL);
-   edje_object_part_swallow(wd->edit_box, "elm.swallow.navigation", wd->navigation);
-
-   wd->edit_table = elm_table_add(wd->edit_box);
+       // navigationbar will contribution. but not yet
+       wd->navigation = elm_navigationbar_add(wd->edit_box);
+       r_button = elm_button_add(wd->navigation);
+       elm_button_label_set(r_button, "Done");
+       evas_object_smart_callback_add(r_button, "clicked", done_button_cb, wd);
+       elm_navigationbar_push(wd->navigation, "Configure", NULL, r_button, NULL, NULL);
+       edje_object_part_swallow(wd->edit_box, "elm.swallow.navigation", wd->navigation);
+        
+      wd->edit_table = elm_table_add(wd->edit_box);
    elm_table_homogenous_set(wd->edit_table, EINA_TRUE);
    edje_object_part_swallow(wd->edit_box, "elm.swallow.table", wd->edit_table);
-
-   /* load background edj */ 
-   wd->edje = edje_object_add(wd->evas);
-
-   //      snprintf(buf, sizeof(buf), "bg_portrait_%d", wd->view_slot_num);
-   _elm_theme_object_set(obj, wd->edje, "controlbar", "base", "default");
+   
+      /* load background edj */ 
+      wd->edje = edje_object_add(wd->evas);
+   
+//      snprintf(buf, sizeof(buf), "bg_portrait_%d", wd->view_slot_num);
+      _elm_theme_object_set(obj, wd->edje, "controlbar", "base", "default");
    if (wd->edje == NULL)
      {
        printf("Cannot load bg edj\n");
        return NULL;
      }
    evas_object_show(wd->edje);
-
-   // initialization
+   
+      // initialization
    evas_object_event_callback_add(wd->edje, EVAS_CALLBACK_RESIZE,
                                     _controlbar_object_resize, obj);
    evas_object_event_callback_add(obj, EVAS_CALLBACK_MOVE,
@@ -1466,22 +1722,22 @@ EAPI Evas_Object * elm_controlbar_add(Evas_Object * parent)
    evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE,
                                   _controlbar_object_hide, obj);
    
-   // items container
+      // items container
    wd->box = elm_table_add(wd->edje);
    elm_table_homogenous_set(wd->box, EINA_TRUE);
    evas_object_size_hint_weight_set(wd->box, EVAS_HINT_EXPAND,
-        EVAS_HINT_EXPAND);
+                                    EVAS_HINT_EXPAND);
    evas_object_size_hint_align_set(wd->box, EVAS_HINT_FILL, EVAS_HINT_FILL);
    edje_object_part_swallow(wd->edje, "elm.swallow.items", wd->box);
    elm_widget_sub_object_add(obj, wd->box);
-
-   //FIXME
-   //      evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
+   
+      //FIXME
+      //      evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
    evas_object_smart_member_add(wd->view, obj);
    evas_object_smart_member_add(wd->edit_box, obj);
    elm_widget_resize_object_set(obj, wd->edje);
-
-   // initialization
+   
+      // initialization
    _sizing_eval(obj);
    return obj;
 }
@@ -1497,7 +1753,7 @@ EAPI Evas_Object * elm_controlbar_add(Evas_Object * parent)
  *
  * @ingroup Controlbar
  */ 
-EAPI Elm_Controlbar_Item * elm_controlbar_tab_item_append(Evas_Object * obj,
+   EAPI Elm_Controlbar_Item * elm_controlbar_tab_item_append(Evas_Object * obj,
                                                             const char
                                                             *icon_path,
                                                             const char *label,
@@ -1508,12 +1764,12 @@ EAPI Elm_Controlbar_Item * elm_controlbar_tab_item_append(Evas_Object * obj,
    Widget_Data * wd;
    it = create_tab_item(obj, icon_path, label, view);
    if (it == NULL)
-     return NULL;
+      return NULL;
    wd = elm_widget_data_get(obj);
    set_items_position(obj, it, NULL);
    wd->items = eina_list_append(wd->items, it);
    if (wd->num == 1)
-     selected_box(it);
+      selected_box(it);
    _sizing_eval(obj);
    return it;
 }
@@ -1529,7 +1785,7 @@ EAPI Elm_Controlbar_Item * elm_controlbar_tab_item_append(Evas_Object * obj,
  *
  * @ingroup Controlbar
  */ 
-EAPI Elm_Controlbar_Item * elm_controlbar_tab_item_prepend(Evas_Object *
+   EAPI Elm_Controlbar_Item * elm_controlbar_tab_item_prepend(Evas_Object *
                                                              obj,
                                                              const char
                                                              *icon_path,
@@ -1566,7 +1822,7 @@ EAPI Elm_Controlbar_Item * elm_controlbar_tab_item_prepend(Evas_Object *
  *
  * @ingroup Controlbar
  */ 
-EAPI Elm_Controlbar_Item *
+   EAPI Elm_Controlbar_Item *
 elm_controlbar_tab_item_insert_before(Evas_Object * obj,
                                      Elm_Controlbar_Item * before,
                                      const char *icon_path,
@@ -1600,7 +1856,7 @@ elm_controlbar_tab_item_insert_before(Evas_Object * obj,
  *
  * @ingroup Controlbar
  */ 
-EAPI Elm_Controlbar_Item *
+   EAPI Elm_Controlbar_Item *
 elm_controlbar_tab_item_insert_after(Evas_Object * obj,
                                     Elm_Controlbar_Item * after,
                                     const char *icon_path, const char *label,
@@ -1636,7 +1892,7 @@ elm_controlbar_tab_item_insert_after(Evas_Object * obj,
  *
  * @ingroup Controlbar
  */ 
-EAPI Elm_Controlbar_Item * elm_controlbar_tool_item_append(Evas_Object *
+   EAPI Elm_Controlbar_Item * elm_controlbar_tool_item_append(Evas_Object *
                                                              obj,
                                                              const char
                                                              *icon_path,
@@ -1675,7 +1931,7 @@ EAPI Elm_Controlbar_Item * elm_controlbar_tool_item_append(Evas_Object *
  *
  * @ingroup Controlbar
  */ 
-EAPI Elm_Controlbar_Item * elm_controlbar_tool_item_prepend(Evas_Object *
+   EAPI Elm_Controlbar_Item * elm_controlbar_tool_item_prepend(Evas_Object *
                                                               obj,
                                                               const char
                                                               *icon_path,
@@ -1718,7 +1974,7 @@ EAPI Elm_Controlbar_Item * elm_controlbar_tool_item_prepend(Evas_Object *
  *
  * @ingroup Controlbar
  */ 
-EAPI Elm_Controlbar_Item *
+   EAPI Elm_Controlbar_Item *
 elm_controlbar_tool_item_insert_before(Evas_Object * obj,
                                       Elm_Controlbar_Item * before,
                                       const char *icon_path,
@@ -1755,7 +2011,7 @@ elm_controlbar_tool_item_insert_before(Evas_Object * obj,
  *
  * @ingroup Controlbar
  */ 
-EAPI Elm_Controlbar_Item *
+   EAPI Elm_Controlbar_Item *
 elm_controlbar_tool_item_insert_after(Evas_Object * obj,
                                      Elm_Controlbar_Item * after,
                                      const char *icon_path,
@@ -1791,7 +2047,7 @@ elm_controlbar_tool_item_insert_after(Evas_Object * obj,
  *
  * @ingroup Controlbar
  */ 
-EAPI Elm_Controlbar_Item * elm_controlbar_object_item_append(Evas_Object *
+   EAPI Elm_Controlbar_Item * elm_controlbar_object_item_append(Evas_Object *
                                                                obj,
                                                                Evas_Object *
                                                                obj_item,
@@ -1850,7 +2106,7 @@ EAPI Elm_Controlbar_Item * elm_controlbar_object_item_append(Evas_Object *
  *
  * @ingroup Controlbar
  */ 
-EAPI Elm_Controlbar_Item *
+   EAPI Elm_Controlbar_Item *
 elm_controlbar_object_item_insert_before(Evas_Object * obj,
                                         Elm_Controlbar_Item * before,
                                         Evas_Object * obj_item, const int sel)
@@ -1880,7 +2136,7 @@ elm_controlbar_object_item_insert_before(Evas_Object * obj,
  *
  * @ingroup Controlbar
  */ 
-EAPI Elm_Controlbar_Item *
+   EAPI Elm_Controlbar_Item *
 elm_controlbar_object_item_insert_after(Evas_Object * obj,
                                        Elm_Controlbar_Item * after,
                                        Evas_Object * obj_item, const int sel)
@@ -1908,7 +2164,7 @@ elm_controlbar_object_item_insert_after(Evas_Object * obj,
 
  * @ingroup Controlbar
  */ 
-EAPI void
+   EAPI void
 elm_controlbar_item_del(Elm_Controlbar_Item * it) 
 {
    Evas_Object * obj;
@@ -1935,68 +2191,68 @@ elm_controlbar_item_del(Elm_Controlbar_Item * it)
        return;
      }
    
-   // delete base item
-   if (it->order > 0)
+      // delete base item
+      if (it->order > 0)
      {
        elm_table_unpack(wd->box, it->base);
        sel = it->sel;
        EINA_LIST_FOREACH(wd->items, l, item)
-         {
-            if (it != item)
-              {
-                 if (item->order > it->order)
-                   {
-                      elm_table_unpack(wd->box, item->base);
-                      item->order -= sel;
-                      elm_table_pack(wd->box, item->base, item->order - 1, 0,
-                            item->sel, 1);
-                   }
-              }
-            if (it == item)
-              {
-                 check = 1;
-              }
-         }
+       {
+          if (it != item)
+            {
+               if (item->order > it->order)
+                 {
+                    elm_table_unpack(wd->box, item->base);
+                    item->order -= sel;
+                    elm_table_pack(wd->box, item->base, item->order - 1, 0,
+                                    item->sel, 1);
+                 }
+            }
+          if (it == item)
+            {
+               check = 1;
+            }
+       }
      }
-
-   // delete edit item
-   check = 0;
+   
+      // delete edit item
+      check = 0;
    if (it->edit_item != NULL)
      {
        elm_table_unpack(wd->edit_table, it->edit_item);
        EINA_LIST_FOREACH(wd->items, l, item)
-         {
-            if (check)
-              {
-                 if (item->edit_item != NULL)
-                   {
-                      elm_table_unpack(wd->edit_table, item->edit_item);
-                      elm_table_pack(wd->edit_table, item->edit_item,
-                            (i - 1) % 4, (i - 1) / 4, 1, 1);
-                   }
-              }
-            if (it == item && item->style != OBJECT)
-              {
-                 check = 1;
-                 i--;
-              }
-            if (item->style != OBJECT)
-              i++;
-         }
+       {
+          if (check)
+            {
+               if (item->edit_item != NULL)
+                 {
+                    elm_table_unpack(wd->edit_table, item->edit_item);
+                    elm_table_pack(wd->edit_table, item->edit_item,
+                                    (i - 1) % 4, (i - 1) / 4, 1, 1);
+                 }
+            }
+          if (it == item && item->style != OBJECT)
+            {
+               check = 1;
+               i--;
+            }
+          if (item->style != OBJECT)
+             i++;
+       }
      }
-
-   // delete item in list
-   if (it->label)
-     eina_stringshare_del(it->label);
+   
+      // delete item in list
+      if (it->label)
+      eina_stringshare_del(it->label);
    if (it->icon)
-     evas_object_del(it->icon);
+      evas_object_del(it->icon);
    if (it->base)
      {
        if (it->style != OBJECT)
-         evas_object_del(it->base);
-
+          evas_object_del(it->base);
+       
        else
-         evas_object_hide(it->base);
+          evas_object_hide(it->base);
      }
    if (it->view)
      {
@@ -2004,7 +2260,7 @@ elm_controlbar_item_del(Elm_Controlbar_Item * it)
        evas_object_hide(it->view);
      }
    if (it->edit_item)
-     evas_object_del(it->edit_item);
+      evas_object_del(it->edit_item);
    wd->items = eina_list_remove(wd->items, it);
    wd->num = wd->num - 1;
    _sizing_eval(obj);
@@ -2017,7 +2273,7 @@ elm_controlbar_item_del(Elm_Controlbar_Item * it)
 
  * @ingroup Controlbar
  */ 
-EAPI void
+   EAPI void
 elm_controlbar_item_select(Elm_Controlbar_Item * it) 
 {
    if (it->obj == NULL)
@@ -2039,7 +2295,7 @@ elm_controlbar_item_select(Elm_Controlbar_Item * it)
  *
  * @ingroup Controlbar
  */ 
-EAPI Evas_Object * elm_controlbar_item_icon_get(Elm_Controlbar_Item * it) 
+   EAPI Evas_Object * elm_controlbar_item_icon_get(Elm_Controlbar_Item * it) 
 {
    return it->icon;
 }
@@ -2066,7 +2322,7 @@ elm_controlbar_item_label_get(Elm_Controlbar_Item * it)
  *
  * @ingroup Controlbar
  */ 
-EAPI void
+   EAPI void
 elm_controlbar_item_label_set(Elm_Controlbar_Item * it, const char *label) 
 {
    if (!it->base)
@@ -2082,7 +2338,7 @@ elm_controlbar_item_label_set(Elm_Controlbar_Item * it, const char *label)
  *
  * @ingroup Controlbar
  */ 
-EAPI Elm_Controlbar_Item * elm_controlbar_selected_item_get(Evas_Object *
+   EAPI Elm_Controlbar_Item * elm_controlbar_selected_item_get(Evas_Object *
                                                               obj) 
 {
    const Eina_List *l;
@@ -2109,7 +2365,7 @@ EAPI Elm_Controlbar_Item * elm_controlbar_selected_item_get(Evas_Object *
  *
  * @ingroup Controlbar
  */ 
-EAPI Elm_Controlbar_Item * elm_controlbar_first_item_get(Evas_Object * obj) 
+   EAPI Elm_Controlbar_Item * elm_controlbar_first_item_get(Evas_Object * obj) 
 {
    if (obj == NULL)
       return NULL;
@@ -2127,7 +2383,7 @@ EAPI Elm_Controlbar_Item * elm_controlbar_first_item_get(Evas_Object * obj)
  *
  * @ingroup Controlbar
  */ 
-EAPI Elm_Controlbar_Item * elm_controlbar_last_item_get(Evas_Object * obj) 
+   EAPI Elm_Controlbar_Item * elm_controlbar_last_item_get(Evas_Object * obj) 
 {
    if (obj == NULL)
       return NULL;
@@ -2145,7 +2401,7 @@ EAPI Elm_Controlbar_Item * elm_controlbar_last_item_get(Evas_Object * obj)
  *
  * @ingroup Controlbar
  */ 
-EAPI Eina_List * elm_controlbar_items_get(Evas_Object * obj) 
+   EAPI Eina_List * elm_controlbar_items_get(Evas_Object * obj) 
 {
    if (obj == NULL)
       return NULL;
@@ -2163,7 +2419,7 @@ EAPI Eina_List * elm_controlbar_items_get(Evas_Object * obj)
  *
  * @ingroup Controlbar
  */ 
-EAPI Elm_Controlbar_Item * elm_controlbar_item_prev(Elm_Controlbar_Item *
+   EAPI Elm_Controlbar_Item * elm_controlbar_item_prev(Elm_Controlbar_Item *
                                                       it) 
 {
    const Eina_List *l;
@@ -2173,17 +2429,17 @@ EAPI Elm_Controlbar_Item * elm_controlbar_item_prev(Elm_Controlbar_Item *
       return NULL;
    Widget_Data * wd = elm_widget_data_get(it->obj);
    if (!wd || !wd->items)
-     return NULL;
+      return NULL;
    EINA_LIST_FOREACH(wd->items, l, item)
-     {
-       if (it == item)
-         {
-            l = eina_list_prev(l);
-            if (!l)
-              return NULL;
-            return eina_list_data_get(l);
-         }
-     }
+   {
+      if (it == item)
+       {
+          l = eina_list_prev(l);
+          if (!l)
+             return NULL;
+          return eina_list_data_get(l);
+       }
+   }
    return NULL;
 }
 
@@ -2195,7 +2451,7 @@ EAPI Elm_Controlbar_Item * elm_controlbar_item_prev(Elm_Controlbar_Item *
  *
  * @ingroup Controlbar
  */ 
-EAPI Elm_Controlbar_Item * elm_controlbar_item_next(Elm_Controlbar_Item *
+   EAPI Elm_Controlbar_Item * elm_controlbar_item_next(Elm_Controlbar_Item *
                                                       it) 
 {
    const Eina_List *l;
@@ -2205,17 +2461,17 @@ EAPI Elm_Controlbar_Item * elm_controlbar_item_next(Elm_Controlbar_Item *
       return NULL;
    Widget_Data * wd = elm_widget_data_get(it->obj);
    if (!wd || !wd->items)
-     return NULL;
+      return NULL;
    EINA_LIST_FOREACH(wd->items, l, item)
-     {
-       if (it == item)
-         {
-            l = eina_list_next(l);
-            if (!l)
-              return NULL;
-            return eina_list_data_get(l);
-         }
-     }
+   {
+      if (it == item)
+       {
+          l = eina_list_next(l);
+          if (!l)
+             return NULL;
+          return eina_list_data_get(l);
+       }
+   }
    return NULL;
 }
 
@@ -2226,7 +2482,7 @@ EAPI Elm_Controlbar_Item * elm_controlbar_item_next(Elm_Controlbar_Item *
 
  * @ingroup Controlbar
  */ 
-EAPI void
+   EAPI void
 elm_controlbar_edit_start(Evas_Object * obj) 
 {
    Widget_Data * wd;
@@ -2253,14 +2509,14 @@ elm_controlbar_edit_start(Evas_Object * obj)
  *
  * @ingroup Controlbar
  */ 
-EAPI void
+   EAPI void
 elm_controlbar_item_visible_set(Elm_Controlbar_Item * it, Eina_Bool bar) 
 {
    Eina_Bool check = EINA_TRUE;
    if (it->order <= 0)
-     check = EINA_FALSE;
+      check = EINA_FALSE;
    if (check == bar)
-     return;
+      return;
    if (bar)
      {
        item_insert_in_bar(it, 0);
@@ -2280,7 +2536,7 @@ elm_controlbar_item_visible_set(Elm_Controlbar_Item * it, Eina_Bool bar)
  *
  * @ingroup Controlbar
  */ 
-EAPI void
+   EAPI void
 elm_controlbar_item_editable_set(Elm_Controlbar_Item * it, Eina_Bool editable) 
 {
    Evas_Object * color;
@@ -2303,7 +2559,7 @@ elm_controlbar_item_editable_set(Elm_Controlbar_Item * it, Eina_Bool editable)
  *
  * @ingroup Controlbar
  */ 
-EAPI void
+   EAPI void
 elm_controlbar_view_set(Evas_Object * obj, Evas_Object * view) 
 {
    Widget_Data * wd;
@@ -2322,7 +2578,6 @@ elm_controlbar_view_set(Evas_Object * obj, Evas_Object * view)
    edje_object_part_swallow(wd->view, "elm.swallow.view", wd->view_content);
 }
 
-
 /**
  * Set the view of the item
  *
@@ -2331,9 +2586,51 @@ elm_controlbar_view_set(Evas_Object * obj, Evas_Object * view)
  *
  * @ingroup Controlbar
  */ 
-EAPI void
+   EAPI void
 elm_controlbar_item_view_set(Elm_Controlbar_Item *it, Evas_Object * view) 
 {
-   it->view = view; 
+       it->view = view; 
+}
+
+/**
+ * Set the mode of the controlbar
+ *
+ * @param      obj The object of the controlbar
+ * @param      mode The mode of the controlbar
+ *
+ * @ingroup Controlbar
+ */ 
+   EAPI void
+elm_controlbar_mode_set(Evas_Object *obj, int mode) 
+{
+       Widget_Data * wd;
+   if (obj == NULL)
+     {
+       fprintf(stderr, "Invalid argument: controlbar object is NULL\n");
+       return;
+     }
+   wd = elm_widget_data_get(obj);
+   if (wd == NULL)
+     {
+       fprintf(stderr, "Cannot get smart data\n");
+       return;
+     }
+
+       if(wd->mode == mode) return;
+
+       switch(mode){
+               case ELM_CONTROLBAR_MODE_DEFAULT: 
+                       edje_object_signal_emit(wd->edje, "elm,state,default", "elm");
+                       break;
+               case ELM_CONTROLBAR_MODE_LARGE: 
+                       edje_object_signal_emit(wd->edje, "elm,state,large", "elm");
+                       break;
+               case ELM_CONTROLBAR_MODE_SMALL: 
+                       edje_object_signal_emit(wd->edje, "elm,state,small", "elm");
+                       break;
+               default:
+                       break;
+       }
 }
 
+
index 256b02b..0e2abc5 100644 (file)
@@ -15,9 +15,7 @@
 
 typedef struct _Widget_Data Widget_Data;
 
-typedef enum
-{ BOTTOM_ARROW, RIGHT_ARROW, LEFT_ARROW, TOP_ARROW,
-      NONE_ARROW } Arrow_Direction;
+
 
 struct _Ctxpopup_Item
 {
@@ -25,7 +23,7 @@ struct _Ctxpopup_Item
    Evas_Object *base;
    const char *label;
    Evas_Object *content;
-   void (*func) (void *data, Evas_Object *obj, void *event_info);
+   void (*func) ( void *data, Evas_Object *obj, void *event_info);
    const void *data;
    Eina_Bool disabled:1;
    Eina_Bool separator:1;
@@ -43,12 +41,12 @@ struct _Widget_Data
    Eina_List *items;
    double align_x, align_y;
    int btn_cnt;
+   Elm_Ctxpopup_Arrow arrow_priority[4];
    Eina_Bool scroller_disabled:1;
    Eina_Bool horizontal:1;
-       Eina_Bool arrow_disabled:1;
+   Eina_Bool arrow_disabled:1;
        Eina_Bool visible:1;
        Eina_Bool screen_dimmed_disabled:1;
-
 };
 
 static const char *widtype = NULL;
@@ -68,10 +66,10 @@ static void _item_sizing_eval(Elm_Ctxpopup_Item *item);
 static void _ctxpopup_item_select(void *data, Evas_Object *obj, const char *emission, const char *source);
 static void _separator_obj_add(Evas_Object *obj); 
 static void _separator_obj_del(Widget_Data *wd, Elm_Ctxpopup_Item *remove_item);
-static Arrow_Direction _calc_base_geometry(Evas_Object *obj, Evas_Coord_Rectangle *rect);
+static Elm_Ctxpopup_Arrow _calc_base_geometry(Evas_Object *obj, Evas_Coord_Rectangle *rect);
 static void _arrow_obj_add(Evas_Object *obj, const char *group_name);
-static void _update_arrow_obj(Evas_Object *obj, Arrow_Direction arrow_dir);
-static void _shift_base_by_arrow(Evas_Object *arrow, Arrow_Direction arrow_dir, Evas_Coord_Rectangle *rect);
+static void _update_arrow_obj(Evas_Object *obj, Elm_Ctxpopup_Arrow arrow_dir);
+static void _shift_base_by_arrow(Evas_Object *arrow, Elm_Ctxpopup_Arrow arrow_dir, Evas_Coord_Rectangle *rect);
 static void _btn_layout_create(Evas_Object *obj);
 static void _btn_clicked(void *data, Evas_Object *obj, void *event_info);
 
@@ -192,7 +190,7 @@ _item_sizing_eval(Elm_Ctxpopup_Item *item)
                }    \
        }while(0)
 
-static Arrow_Direction
+static Elm_Ctxpopup_Arrow
 _calc_base_geometry(Evas_Object *obj, Evas_Coord_Rectangle *rect)
 {
        Widget_Data *wd;
@@ -200,7 +198,7 @@ _calc_base_geometry(Evas_Object *obj, Evas_Coord_Rectangle *rect)
    Evas_Coord parent_x, parent_y, parent_w, parent_h;
    Evas_Coord box_w, box_h;
    Evas_Coord base_w = 0, base_h = 0;
-   Arrow_Direction arrow_dir;
+   Elm_Ctxpopup_Arrow arrow;
    Evas_Coord x1, x2, y1, y2;
    int idx;
    Evas_Coord finger_size;
@@ -210,8 +208,9 @@ _calc_base_geometry(Evas_Object *obj, Evas_Coord_Rectangle *rect)
 
        wd = elm_widget_data_get(obj);
 
-   if ((!wd) || (!rect))
-      return NONE_ARROW;
+   if ((!wd) || (!rect)) {
+      return ELM_CTXPOPUP_ARROW_DOWN;
+   }
 
        evas_object_geometry_get(obj, &x, &y, NULL, NULL);
        evas_object_geometry_get(wd->parent, &parent_x, &parent_y, &parent_w,
@@ -223,6 +222,8 @@ _calc_base_geometry(Evas_Object *obj, Evas_Coord_Rectangle *rect)
        base_h += box_h ;
 
        edje_object_size_max_get(wd->base, &max_width_size, &max_height_size);
+       max_width_size *= elm_scale_get();
+       max_height_size *= elm_scale_get();
 
    if (base_h > max_height_size)
       base_h = max_height_size;
@@ -232,8 +233,9 @@ _calc_base_geometry(Evas_Object *obj, Evas_Coord_Rectangle *rect)
 
    finger_size = elm_finger_size_get();
 
-       if((base_h == 0) || (base_w == 0))
-               return NONE_ARROW;
+       if((base_h == 0) || (base_w == 0)) {
+               return ELM_CTXPOPUP_ARROW_DOWN;
+       }
 
        if (!wd->arrow_disabled)
                {
@@ -241,85 +243,85 @@ _calc_base_geometry(Evas_Object *obj, Evas_Coord_Rectangle *rect)
                                evas_object_resize( wd->arrow, arrow_w, arrow_h );
                }
 
-   //Phase 1: Define x, y Segments and find invalidated direction.
-   //Left
-   x1 = x - base_w;
-   if ((x1 - arrow_w - finger_size) < parent_x)
-     {
-       x1 = parent_x;
-       available_direction[RIGHT_ARROW] = 0;
-     }
-
-   //Right
-   x2 = x + base_w;
-   if (x2 + arrow_w + finger_size > WORLD_PARENT_W)
-     {
-       x2 = WORLD_PARENT_W - base_w;
-       available_direction[LEFT_ARROW] = 0;
-     }
-
-   //Top
-   y1 = y - base_h;
-   if (y1 - arrow_h - finger_size < parent_y)
-     {
-       y1 = parent_y;
-       available_direction[BOTTOM_ARROW] = 0;
-     }
-   //Bottom
-   y2 = y + base_h;
-   if (y2 + arrow_h + finger_size > WORLD_PARENT_H)
-     {
-       y2 = WORLD_PARENT_H - base_h;
-       available_direction[TOP_ARROW] = 0;
-     }
-
-//ADDITIONAL OPTION: Phase 2: Determine Direction Priority ?
+       //Define x, y Segments and find invalidated direction.
+       //After that, adjust base geometry.
+       for (idx = 0; idx < 4; ++idx)
+       {
+               switch (wd->arrow_priority[idx])
+                 {
+                 case ELM_CTXPOPUP_ARROW_DOWN:
+                          y1 = y - base_h;
+                          if (y1 - arrow_h - finger_size > parent_y) continue;
+                               y1 = parent_y;
+                               available_direction[idx] = 0;
+                    break;
+                 case ELM_CTXPOPUP_ARROW_RIGHT:
+                          x1 = x - base_w;
+                          if ((x1 - arrow_w - finger_size) > parent_x) continue;
+                               x1 = parent_x;
+                               available_direction[idx] = 0;
+                    break;
+                 case ELM_CTXPOPUP_ARROW_LEFT:
+                          x2 = x + base_w;
+                          if (x2 + arrow_w + finger_size < WORLD_PARENT_W) continue;
+                               x2 = WORLD_PARENT_W - base_w;
+                               available_direction[idx] = 0;
+                    break;
+                 case ELM_CTXPOPUP_ARROW_UP:
+                          y2 = y + base_h;
+                          if (y2 + arrow_h + finger_size < WORLD_PARENT_H) continue;
+                               y2 = WORLD_PARENT_H - base_h;
+                               available_direction[idx] = 0;
+                    break;
+                 default:
+                         break;
+                 }
+       }
 
-//Phase 3: adjust base geometry.
    for (idx = 0; idx < 4; ++idx)
      {
        if (available_direction[idx] == 0)
           continue;
 
        //Find the Nearest point to center of box.
-       switch (idx)
+       switch (wd->arrow_priority[idx])
          {
-         case BOTTOM_ARROW:
+         case ELM_CTXPOPUP_ARROW_DOWN:
             ADJUST_POS_X(x);
             y -= (base_h + finger_size);
-            arrow_dir = BOTTOM_ARROW;
+            arrow = ELM_CTXPOPUP_ARROW_DOWN;
             break;
-         case RIGHT_ARROW:
+         case ELM_CTXPOPUP_ARROW_RIGHT:
             ADJUST_POS_Y(y);
             x -= (base_w + finger_size);
-            arrow_dir = RIGHT_ARROW;
+            arrow = ELM_CTXPOPUP_ARROW_RIGHT;
             break;
-         case LEFT_ARROW:
+         case ELM_CTXPOPUP_ARROW_LEFT:
             ADJUST_POS_Y(y);
             x += finger_size;
-            arrow_dir = LEFT_ARROW;
+            arrow = ELM_CTXPOPUP_ARROW_LEFT;
             break;
-         case TOP_ARROW:
+         case ELM_CTXPOPUP_ARROW_UP:
             ADJUST_POS_X(x);
             y += finger_size;
-            arrow_dir = TOP_ARROW;
+            arrow = ELM_CTXPOPUP_ARROW_UP;
             break;
          default:
-            fprintf(stderr, "Not Enough space to show contextual popup!! \n");
+                 break;
          }
-       break;
+               break;
      }
    rect->x = x;
    rect->y = y;
    rect->w = base_w;
    rect->h = base_h;
 
-   return arrow_dir;
+   return arrow;
 }
 
 
 static void
-_update_arrow_obj(Evas_Object *obj, Arrow_Direction arrow_dir)
+_update_arrow_obj(Evas_Object *obj, Elm_Ctxpopup_Arrow arrow_dir)
 {
        Evas_Coord x, y;
        Evas_Coord arrow_x, arrow_y, arrow_w, arrow_h;
@@ -333,28 +335,28 @@ _update_arrow_obj(Evas_Object *obj, Arrow_Direction arrow_dir)
 
        switch (arrow_dir)
      {
-     case LEFT_ARROW:
+     case ELM_CTXPOPUP_ARROW_LEFT:
        {
                edje_object_signal_emit(wd->arrow, "elm,state,left", "elm");
           arrow_y = (y - (arrow_h*0.5));
           arrow_x = (x + elm_finger_size_get());
           break;
        }
-     case RIGHT_ARROW:
+     case ELM_CTXPOPUP_ARROW_RIGHT:
        {
                edje_object_signal_emit(wd->arrow, "elm,state,right", "elm");
           arrow_y = (y - (arrow_h*0.5));
                arrow_x = (x - elm_finger_size_get() - arrow_w);
           break;
        }
-     case TOP_ARROW:
+     case ELM_CTXPOPUP_ARROW_UP:
        {
                edje_object_signal_emit(wd->arrow, "elm,state,top", "elm");
           arrow_x = (x - (arrow_w*0.5));
           arrow_y = (y + elm_finger_size_get());
           break;
        }
-     case BOTTOM_ARROW:
+     case ELM_CTXPOPUP_ARROW_DOWN:
        {
                edje_object_signal_emit(wd->arrow, "elm,state,bottom", "elm");
                arrow_x = (x - (arrow_w*0.5));
@@ -374,10 +376,9 @@ _sizing_eval(Evas_Object *obj)
    Eina_List *elist;
    Elm_Ctxpopup_Item *item;
    Evas_Coord_Rectangle rect = {0,0,1,1};
-   Evas_Coord x, y, w, h;
-   Arrow_Direction arrow_dir;
+   Evas_Coord  y, w, h;
+   Elm_Ctxpopup_Arrow arrow;
    wd = (Widget_Data *) elm_widget_data_get(obj);
-   char buf[256];
 
    if ((!wd) || (!wd->parent))
       return;
@@ -387,18 +388,13 @@ _sizing_eval(Evas_Object *obj)
       _item_sizing_eval(item);
    }
 
-   //button layout
-       sprintf(buf, "actionbtn%d", wd->btn_cnt);
-       edje_object_part_geometry_get( wd->btn_layout,  buf, 0, 0, &w, &h );
-       evas_object_size_hint_min_set( wd->btn_layout, w, h );
-
        //base
-   arrow_dir = _calc_base_geometry(obj, &rect);
+   arrow = _calc_base_geometry(obj, &rect);
 
-       if((!wd->arrow_disabled) && (arrow_dir!=NONE_ARROW)) 
+       if(!wd->arrow_disabled)
        {
-               _update_arrow_obj(obj, arrow_dir);
-               _shift_base_by_arrow(wd->arrow, arrow_dir, &rect);
+               _update_arrow_obj(obj, arrow);
+               _shift_base_by_arrow(wd->arrow, arrow, &rect);
        }
 
        evas_object_resize(wd->base, rect.w, rect.h);
@@ -409,12 +405,10 @@ _sizing_eval(Evas_Object *obj)
        edje_object_part_geometry_get(wd->base, "ctxpopup_list", NULL, &y, NULL, &h );
        evas_object_resize(wd->scroller, w, h+(y*2));
        evas_object_move(wd->scroller, rect.x, rect.y);
-
-
 }
 
 static void
-_shift_base_by_arrow(Evas_Object *arrow, Arrow_Direction arrow_dir,
+_shift_base_by_arrow(Evas_Object *arrow, Elm_Ctxpopup_Arrow arrow_dir,
                         Evas_Coord_Rectangle *rect)
 {
    Evas_Coord arrow_w, arrow_h;
@@ -422,20 +416,20 @@ _shift_base_by_arrow(Evas_Object *arrow, Arrow_Direction arrow_dir,
 
        switch (arrow_dir)
      {
-     case LEFT_ARROW:
+     case ELM_CTXPOPUP_ARROW_LEFT:
        rect->x += arrow_w;
        break;
-     case RIGHT_ARROW:
+     case ELM_CTXPOPUP_ARROW_RIGHT:
        rect->x -= arrow_w;
        break;
-     case TOP_ARROW:
+     case ELM_CTXPOPUP_ARROW_UP:
        rect->y += arrow_h;
        break;
-     case BOTTOM_ARROW:
+     case ELM_CTXPOPUP_ARROW_DOWN:
        rect->y -= arrow_h;
        break;
-     case NONE_ARROW:
-       break;
+    default:
+        break;
      }
 }
 
@@ -543,10 +537,10 @@ _bg_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *s
 static void 
 _parent_move(void *data, Evas *e, Evas_Object *obj, void *event_info)
 {
-   Widget_Data *wd = (Widget_Data *) data;
+       Evas_Coord x, y;
+       Widget_Data *wd = (Widget_Data *) elm_widget_data_get(data);
    if (!wd) return;
 
-       Evas_Coord x, y;
        evas_object_geometry_get(obj, &x, &y, NULL, NULL);
        evas_object_move(wd->bg, x, y);
        _sizing_eval(data);
@@ -555,10 +549,10 @@ _parent_move(void *data, Evas *e, Evas_Object *obj, void *event_info)
 static void
 _parent_resize(void *data, Evas *e, Evas_Object *obj, void *event_info)
 {
-   Widget_Data *wd = (Widget_Data *) data;
+       Evas_Coord w, h;
+       Widget_Data *wd = (Widget_Data *) elm_widget_data_get(data);
    if (!wd) return;
 
-       Evas_Coord w, h;
        evas_object_geometry_get(obj, NULL, NULL, &w, &h);
        evas_object_resize(wd->bg, w, h);
        _sizing_eval(data);
@@ -769,8 +763,6 @@ elm_ctxpopup_add(Evas_Object *parent)
    elm_widget_theme_hook_set(obj, _theme_hook);
 
        wd->parent = parent;
-       wd->align_x = 0.5;
-       wd->align_y = 0.5;
 
        //Background
        wd->bg = edje_object_add(e);
@@ -812,8 +804,13 @@ elm_ctxpopup_add(Evas_Object *parent)
        _elm_theme_object_set(obj, wd->arrow, "ctxpopup", "arrow",
                                      elm_widget_style_get(obj));
 
+       wd->arrow_priority[0] = ELM_CTXPOPUP_ARROW_DOWN;
+       wd->arrow_priority[1] = ELM_CTXPOPUP_ARROW_RIGHT;
+       wd->arrow_priority[2] = ELM_CTXPOPUP_ARROW_LEFT;
+       wd->arrow_priority[3] = ELM_CTXPOPUP_ARROW_UP;
+
        evas_object_event_callback_add(parent, EVAS_CALLBACK_MOVE, _parent_move, obj);
-   evas_object_event_callback_add(parent, EVAS_CALLBACK_RESIZE, _parent_resize,
+       evas_object_event_callback_add(parent, EVAS_CALLBACK_RESIZE, _parent_resize,
                                  obj);
    evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _ctxpopup_show, wd);
    evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE, _ctxpopup_hide, wd);
@@ -1210,6 +1207,15 @@ elm_ctxpopup_screen_dimmed_disabled_set(Evas_Object *obj, Eina_Bool disabled)
        wd->screen_dimmed_disabled = disabled;
 }
 
+/**
+ * Append additional button in ctxpoppup bottom layout.
+ * @param obj          Ctxpopup object
+ * @param label  Button label
+ * @param func   Button clicked event callback function
+ * @param data   Button clicked event callback function data
+ *
+ * @ingroup Ctxpopup
+ */
 EAPI void
 elm_ctxpopup_button_append(Evas_Object *obj, const char *label, Evas_Smart_Cb func, const void *data)
 {
@@ -1238,6 +1244,11 @@ elm_ctxpopup_button_append(Evas_Object *obj, const char *label, Evas_Smart_Cb fu
                evas_object_smart_callback_add(btn, "clicked", func, data);
                sprintf(buf, "actionbtn%d", wd->btn_cnt);
                edje_object_part_swallow(wd->btn_layout,  buf, btn);
+
+               //button layout
+               sprintf(buf, "actionbtn%d", wd->btn_cnt);
+               edje_object_part_geometry_get( wd->btn_layout,  buf, 0, 0, &w, &h );
+               evas_object_size_hint_min_set( wd->btn_layout, w, h );
        }
 
        if(wd->visible)
@@ -1245,8 +1256,17 @@ elm_ctxpopup_button_append(Evas_Object *obj, const char *label, Evas_Smart_Cb fu
 
 }
 
-
-/*
+/**
+ * Sets the size align control hint for the items
+ *
+ *  Please refer the evas_object_size_hint_align_set function
+ *
+ * @param obj          Ctxpopup object
+ * @param align_x Double (0.0..1.0 or -1.0) to use as align x hint
+ * @param align_y Double (0.0..1.0 or -1.0) to use as align y hint
+ *
+ * @ingroup Ctxpopup
+ */
 EAPI void
 elm_ctxpopup_align_set(Evas_Object *obj, double align_x, double align_y)
 {
@@ -1265,7 +1285,17 @@ elm_ctxpopup_align_set(Evas_Object *obj, double align_x, double align_y)
        wd->align_y = align_y;
 }
 
-
+/**
+ * Retrieves the size align control hint
+ *
+ *  Please refer the evas_object_size_hint_align_get function
+ *
+ * @param obj          Ctxpopup object
+ * @param align_x Pointer to a double in which to store the align x.
+ * @param align_y Pointer to a double in which to store the align y.
+ *
+ * @ingroup Ctxpopup
+ */
 EAPI void
 elm_ctxpopup_align_get(Evas_Object *obj, double *align_x, double *align_y)
 {
@@ -1276,6 +1306,35 @@ elm_ctxpopup_align_get(Evas_Object *obj, double *align_x, double *align_y)
        if( align_y ) *align_y = wd->align_y;
 }
 
-*/
+
+
+/**
+ * Set the priority of arrow direction
+ *
+ *  This functions gives user to set the priority of ctxpopup box showing position.
+ *
+ * @param obj          Ctxpopup object
+ * @param first    1st priority of arrow direction
+ * @param second 2nd priority of arrow direction
+ * @param third   3th priority of arrow direction
+ * @param fourth 4th priority of arrow direction
+ *
+ * @ingroup Ctxpopup
+ */
+EAPI void
+elm_ctxpopup_arrow_priority_set(Evas_Object *obj, Elm_Ctxpopup_Arrow first, Elm_Ctxpopup_Arrow second, Elm_Ctxpopup_Arrow third, Elm_Ctxpopup_Arrow fourth)
+{
+       ELM_CHECK_WIDTYPE(obj, widtype);
+       Widget_Data *wd = (Widget_Data *) elm_widget_data_get(obj);
+       if(!wd) return;
+       wd->arrow_priority[0] = first;
+       wd->arrow_priority[1] = second;
+       wd->arrow_priority[2] = third;
+       wd->arrow_priority[3] = fourth;
+}
+
+
+
+
 
 
index 622e2c0..9d312fd 100644 (file)
@@ -248,6 +248,8 @@ _item_new(Evas_Object *obj, const char *label, Evas_Object *icon)
    it = calloc(1, sizeof(   Elm_Segment_Item));
    if (!it) return NULL;
 
+   Evas_Coord mw, mh;
+
    if(obj) it->obj = obj;
    it->delete_me = EINA_FALSE;
    it->segment_id = wd->id;
@@ -282,7 +284,11 @@ _item_new(Evas_Object *obj, const char *label, Evas_Object *icon)
                evas_object_size_hint_max_set(it->base, maxw, maxh);
         }
 
-          return it;
+       edje_object_size_min_restricted_calc(obj, &mw, &mh, 0, 0);
+       evas_object_size_hint_weight_set(obj, 1.0, 1.0);
+       evas_object_size_hint_align_set(obj, -1.0, -1.0);
+
+       return it;
 }
 
 
index 67830f5..9252ae3 100644 (file)
@@ -604,8 +604,10 @@ _softkey_up_cb(void *data, Evas_Object *obj, const char *emission,
       if (!edj) return;
       edje_object_signal_emit(edj, "elm,state,unselected", "elm");
    }
-   if (it->func) it->func((void *) (it->data), it->obj, it);
-   evas_object_smart_callback_call(it->obj, "clicked", it);
+   if (it->func)
+      it->func((void *) (it->data), it->obj, it);
+   else
+      evas_object_smart_callback_call(it->obj, "clicked", it);
 }
 
 static void
@@ -640,8 +642,10 @@ _panel_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
    }
 
    elm_softkey_panel_close(it->obj);
-   if (it->func) it->func((void *) (it->data), it->obj, it);
-   evas_object_smart_callback_call(it->obj, "clicked", it);
+   if (it->func)
+      it->func((void *) (it->data), it->obj, it);
+   else
+      evas_object_smart_callback_call(it->obj, "clicked", it);
 }
 
 static void
index f680172..cffc2c7 100644 (file)
@@ -125,7 +125,8 @@ obj_longpress(Evas_Object *obj)
        top = elm_widget_top_get(obj);
        if(top)
                ext_mod->popup = elm_ctxpopup_add(top);
-       elm_object_style_set(ext_mod->popup,"entry");
+       /*currently below theme not used,when guideline comes a new theme can be created if required*/
+       //elm_object_style_set(ext_mod->popup,"entry");
        elm_ctxpopup_scroller_disabled_set(ext_mod->popup, EINA_TRUE);
        context_menu_orientation = edje_object_data_get
        (ext_mod->ent, "context_menu_orientation");