[slider, editfield, colorpicker, colorpalette] merged
authorWooHyun Jung <wh0705.jung@samsung.com>
Tue, 18 May 2010 12:00:03 +0000 (21:00 +0900)
committerWooHyun Jung <wh0705.jung@samsung.com>
Tue, 18 May 2010 12:00:03 +0000 (21:00 +0900)
src/lib/Elementary.h.in
src/lib/Makefile.am
src/lib/elm_colorpalette.c [new file with mode: 0755]
src/lib/elm_colorpicker.c [new file with mode: 0755]
src/lib/elm_editfield.c [new file with mode: 0755]
src/lib/elm_slider.c

index 1704d89..d01c0fb 100755 (executable)
@@ -1037,6 +1037,12 @@ extern "C" {
    EAPI void         elm_slider_inverted_set(Evas_Object *obj, Eina_Bool inverted);
    EAPI Eina_Bool    elm_slider_inverted_get(const Evas_Object *obj);
 
+   // added for supporting aqua feature
+   EAPI Eina_Bool       elm_slider_right_icon_set(Evas_Object *obj, Evas_Object *icon);
+   EAPI Evas_Object *  elm_slider_right_icon_get(Evas_Object *obj);
+   EAPI void           elm_slider_indicator_show_set(Evas_Object *obj, Eina_Bool show);
+   EAPI void           elm_slider_value_animated_set(Evas_Object *obj, double val);
+
    typedef enum _Elm_Genlist_Item_Flags
      {
        ELM_GENLIST_ITEM_NONE = 0,
@@ -1601,6 +1607,43 @@ extern "C" {
    EAPI void elm_toolbar2_homogenous_set(Evas_Object *obj, Eina_Bool homogenous);
    EAPI void elm_toolbar2_align_set(Evas_Object *obj, double align);
 
+  /* colorpicker */
+   EAPI Evas_Object *elm_colorpicker_add(Evas_Object *parent);
+   EAPI void elm_colorpicker_color_set(Evas_Object *obj, unsigned int r, unsigned int g , unsigned int b);
+   EAPI void elm_colorpicker_color_get(Evas_Object *obj, unsigned int *r, unsigned int *g , unsigned int *b);
+    /* smart callbacks called:
+    * "clicked" - when bar or button is clicked
+    */
+
+
+ /* colorpalette */
+    typedef struct _Colorpalette_Color Elm_Colorpalette_Color; 
+
+    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
+    */
+
+   /* editfield */
+   EAPI Evas_Object *elm_editfield_add(Evas_Object *parent);
+   EAPI void elm_editfield_label_set(Evas_Object *obj, const char *label);
+   EAPI const char* elm_editfield_label_get(Evas_Object *obj);
+   EAPI void elm_editfield_guide_text_set(Evas_Object *obj, const char *text);
+   EAPI const char* elm_editfield_guide_text_get(Evas_Object *obj);
+   EAPI Evas_Object *elm_editfield_entry_get(Evas_Object *obj);
+   EAPI Evas_Object *elm_editfield_clear_button_show(Evas_Object *obj, Eina_Bool show);
+   EAPI Eina_Bool elm_editfield_right_icon_set(Evas_Object *obj, Evas_Object *icon);
+   EAPI Evas_Object *elm_editfield_right_icon_get(Evas_Object *obj);
+   EAPI Eina_Bool elm_editfield_left_icon_set(Evas_Object *obj, Evas_Object *icon);
+   EAPI Evas_Object *elm_editfield_lett_icon_get(Evas_Object *obj);
+   EAPI void elm_editfield_entry_single_line_set(Evas_Object *obj, Eina_Bool single_line);
+       
 #ifdef __cplusplus
 }
 #endif
index 8c514d5..d2cb236 100644 (file)
@@ -80,6 +80,9 @@ elm_config.c \
 elm_diskcontroller.c \
 elm_tab.c \
 elm_tabbar.c \
+elm_editfield.c \
+elm_colorpicker.c \
+elm_colorpalette.c \
 \
 elc_anchorblock.c \
 elc_anchorview.c \
diff --git a/src/lib/elm_colorpalette.c b/src/lib/elm_colorpalette.c
new file mode 100755 (executable)
index 0000000..5635834
--- /dev/null
@@ -0,0 +1,481 @@
+#include <Elementary.h>
+#include "elm_priv.h"
+#include <Ecore.h>
+
+/**
+ * @addtogroup Colorpalette Colorpalette
+ *
+ * Using colorpalette, you can select a color by clicking
+ * a color rectangle on the colorpalette.
+ */
+
+
+#define MAX_NUM_COLORS 30
+#define COLOR_RECT_LENGTH 66
+
+typedef struct _Colorpalette_Item Colorpalette_Item;
+struct _Colorpalette_Item
+{
+       Evas_Object *parent;
+       Evas_Object *lo;
+       Evas_Object *cr;
+       unsigned int r, g, b;
+};
+
+
+typedef struct _Widget_Data Widget_Data;
+struct _Widget_Data
+{
+       Evas_Object *parent;
+       Evas_Object *lay;
+       Evas_Object *tab;
+
+       Evas_Coord x, y, w, h;
+       Evas_Coord tab_w, tab_h;
+       Evas_Coord rect_w, rect_h;
+
+       unsigned int row, col;
+       Elm_Colorpalette_Color *color;
+
+       Eina_List *items;
+
+       unsigned int num;
+};
+
+static void _del_hook(Evas_Object *obj);
+static void _theme_hook(Evas_Object *obj);
+static void _sizing_eval(Evas_Object *obj);
+static void _sub_del(void *data, Evas_Object *obj, void *event_info);
+
+
+static void _colorpalette_object_move(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _colorpalette_object_resize(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _colorpalette_object_show(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _colorpalette_object_hide(void *data, Evas *e, Evas_Object *obj, void *event_info);
+
+static void _color_select_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _color_release_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _color_table_delete(Evas_Object *obj);
+static void _color_table_update(Evas_Object *obj, int row, int col, int color_num, Elm_Colorpalette_Color *color);
+
+static void
+_del_hook(Evas_Object *obj)
+{
+       Widget_Data *wd = elm_widget_data_get(obj);
+
+       if (!wd) return;
+
+       _color_table_delete(obj);
+
+       if (wd->color){
+               free(wd->color);
+       }
+
+       if (wd->lay){
+               evas_object_smart_member_del(wd->lay);
+               evas_object_del(wd->lay);
+               wd->lay = NULL;
+       }
+       free(wd);
+}
+
+static void
+_theme_hook(Evas_Object *obj)
+{
+       Widget_Data *wd = elm_widget_data_get(obj);
+       if (!wd)
+               return;
+
+       _elm_theme_set(wd->lay, "colorpalette", "bg", elm_widget_style_get(obj));
+       _color_table_update(obj, wd->row, wd->col, wd->num, wd->color);
+       _sizing_eval(obj);
+
+    // FIXME : add more codes
+    //
+
+}
+
+
+static void
+_sub_del(void *data, Evas_Object *obj, void *event_info)
+{
+       Widget_Data *wd = elm_widget_data_get(obj);
+       //Evas_Object *sub = event_info;
+       if (!wd)
+               return;
+}
+
+static void
+_sizing_eval(Evas_Object *obj)
+{
+       Widget_Data *wd = elm_widget_data_get(obj);
+
+       if (!wd)
+               return;
+
+       DBG("[%s]\n", __func__);
+
+       _colorpalette_object_move(obj, NULL, obj, NULL);
+       _colorpalette_object_resize(obj, NULL, obj, NULL);
+}
+
+
+static void _colorpalette_object_move(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+       DBG("%s", __func__);
+
+       Widget_Data *wd;
+       Evas_Coord x, y;
+
+       if(!data)
+               return;
+
+       wd = elm_widget_data_get((Evas_Object *)data);
+
+       if(!wd)
+               return;
+
+       evas_object_geometry_get(wd->lay, &x, &y, NULL, NULL);
+
+       wd->x = x;
+       wd->y = y;
+
+       evas_object_move(wd->lay, x, y);
+}
+
+
+static void _colorpalette_object_resize(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+       DBG("%s", __func__);
+
+       Widget_Data *wd;
+       Colorpalette_Item *item;
+       Evas_Coord w, h;
+       Evas_Coord tab_w, tab_h;
+       double pad_x, pad_y;
+
+       if(!data)
+               return;
+
+       wd = elm_widget_data_get((Evas_Object *)data);
+
+       if(!wd)
+               return;
+
+       evas_object_geometry_get(wd->lay, NULL, NULL, &w, &h);
+       wd->w = w;
+       wd->h = h;
+
+       evas_object_geometry_get(wd->tab, NULL, NULL, &tab_w, &tab_h);
+       if (tab_w > 0 && tab_h > 0) {
+               wd->tab_w = tab_w;
+               wd->tab_h = tab_h;
+       }
+
+       if (wd->items)
+               item = wd->items->data;
+
+       edje_object_part_geometry_get(elm_layout_edje_get(item->lo),"focus" ,NULL, NULL, &wd->rect_w, &wd->rect_h);
+
+
+       pad_x = ((double)wd->tab_w - (double)wd->rect_w * (double)wd->col) / (double)(wd->col - 1);
+       pad_y = ((double)wd->tab_h - (double)wd->rect_h * (double)wd->row) / (double)(wd->row - 1);
+
+       if (pad_x < 0.0 )
+               pad_x = 0;
+       if (pad_y < 0.0 )
+               pad_y = 0;
+
+       elm_table_padding_set(wd->tab, (int)pad_x , (int)pad_y);
+
+       if(!wd->lay)
+               return;
+
+       evas_object_resize(wd->lay, w, h);
+}
+
+
+static void _colorpalette_object_show(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+       DBG("%s", __func__);
+
+       Widget_Data *wd = NULL;
+
+       if(data == NULL)
+               return;
+
+       wd = elm_widget_data_get((Evas_Object *)data);
+
+
+       if(wd == NULL)
+               return;
+
+       if (wd->lay) {
+               evas_object_show(wd->lay);
+       }
+}
+
+static void _colorpalette_object_hide(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+       DBG("%s", __func__);
+
+       Widget_Data *wd = NULL;
+
+       if(data == NULL)
+               return;
+
+       wd = elm_widget_data_get((Evas_Object *)data);
+
+       if(wd == NULL)
+               return;
+
+       if (wd->lay) {
+               evas_object_hide(wd->lay);
+       }
+}
+
+static void _color_select_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+       Colorpalette_Item *item = (Colorpalette_Item *) data;
+       Elm_Colorpalette_Color *color;
+
+       color = ELM_NEW(Elm_Colorpalette_Color);
+
+       color->r = item->r;
+       color->g = item->g;
+       color->b = item->b;
+
+       evas_object_smart_callback_call(item->parent, "clicked", color);
+
+       edje_object_signal_emit(elm_layout_edje_get(item->lo), "focus_visible", "elm");
+}
+
+
+static void _color_release_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+       Colorpalette_Item *item = (Colorpalette_Item *) data;
+       edje_object_signal_emit(elm_layout_edje_get(item->lo), "focus_invisible", "elm");
+}
+
+
+static void _color_table_delete(Evas_Object *obj)
+{
+       Widget_Data *wd = NULL;
+       Colorpalette_Item *item;
+       wd = elm_widget_data_get(obj);
+
+       if (!wd) return;
+
+       if (wd->items) {
+               EINA_LIST_FREE(wd->items, item) {
+                       if (item->lo){
+                               evas_object_del(item->lo);
+                               item->lo = NULL;
+                       }
+                       if (item->cr){
+                               evas_object_del(item->cr);
+                               item->cr = NULL;
+                       }
+                       free(item);
+               }
+       }
+
+       if (wd->tab) {
+               edje_object_part_unswallow(wd->lay, wd->tab);
+               evas_object_del(wd->tab);
+       }
+}
+
+
+static void _color_table_update(Evas_Object *obj, int row, int col, int color_num, Elm_Colorpalette_Color *color)
+{
+       Widget_Data *wd = elm_widget_data_get(obj);
+       Colorpalette_Item *item;
+       Evas_Object *lo;
+       Evas_Object *cr;
+       Evas *e;
+       int i, j, count;
+
+       count = 0;
+
+       if ( !wd )
+               return;
+
+       e = evas_object_evas_get(wd->parent);
+
+       _color_table_delete(obj);
+
+       wd->row = row;
+       wd->col = col;
+       wd->num = color_num;
+
+       wd->tab = elm_table_add(obj);
+
+       evas_object_size_hint_weight_set(wd->tab, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       evas_object_size_hint_align_set(wd->tab, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+       edje_object_part_swallow(wd->lay, "palette", wd->tab);
+       evas_object_show(wd->tab);
+
+       for ( i = 0 ; i < row ; i++) {
+               for ( j = 0 ; j < col ; j++ ) {
+                       item = ELM_NEW(Colorpalette_Item);
+                       if (item){
+                               lo = elm_layout_add(obj);
+                               elm_layout_theme_set(lo, "colorpalette", "base", "bg");
+                               evas_object_size_hint_weight_set(lo, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+                               evas_object_size_hint_align_set(lo, EVAS_HINT_FILL, EVAS_HINT_FILL);
+                               evas_object_show(lo);
+                               elm_table_pack(wd->tab, lo, j, i, 1, 1);
+
+                               item->parent = obj;
+                               item->lo = lo;
+
+                               if (count < color_num){
+                                       cr =  edje_object_add(e);
+                                       _elm_theme_set(cr, "colorpalette", "base", "color");
+                                       evas_object_color_set(cr, color[count].r, color[count].g, color[count].b, 255);
+                                       evas_object_size_hint_weight_set(cr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+                                       evas_object_size_hint_align_set(cr, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+                                       evas_object_event_callback_add(cr, EVAS_CALLBACK_MOUSE_DOWN, _color_select_cb, item);
+                                       evas_object_event_callback_add(cr, EVAS_CALLBACK_MOUSE_UP, _color_release_cb, item);
+
+                                       evas_object_show(cr);
+                                       edje_object_part_swallow(elm_layout_edje_get(lo), "color_rect", cr);
+
+                                       item->cr = cr;
+                                       item->r = color[count].r;
+                                       item->g = color[count].g;
+                                       item->b = color[count].b;
+                               }
+
+                               wd->items = eina_list_append(wd->items, item);
+
+                               count ++;
+                       }
+               }
+       }
+}
+
+
+/**
+ * Add a new colorpalette to the parent.
+ *
+ * @param parent The parent object
+ * @return The new object or NULL if it cannot be created
+ *
+ * @ingroup Colorpalette
+ */
+EAPI Evas_Object *elm_colorpalette_add(Evas_Object *parent)
+{
+       Evas_Object *obj = NULL;
+       Widget_Data *wd = NULL;
+       Evas *e;
+       Elm_Colorpalette_Color *color;
+
+       wd = ELM_NEW(Widget_Data);
+       e = evas_object_evas_get(parent);
+       if (e == NULL) return NULL;
+       obj = elm_widget_add(e);
+       elm_widget_type_set(obj, "colorpalette");
+       elm_widget_sub_object_add(parent, obj);
+       elm_widget_data_set(obj, wd);
+       elm_widget_del_hook_set(obj, _del_hook);
+       elm_widget_theme_hook_set(obj, _theme_hook);
+
+       wd->parent = parent;
+       /* load background edj */
+       wd->lay = edje_object_add(e);
+        _elm_theme_set(wd->lay, "colorpalette", "bg", "default");
+
+       evas_object_size_hint_weight_set(wd->lay, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       if(wd->lay == NULL) {
+               printf("Cannot load bg edj\n");
+               return NULL;
+       }
+
+       wd->color = (Elm_Colorpalette_Color*) calloc (10, sizeof(Elm_Colorpalette_Color));
+
+       wd->color[0].r = 55; wd->color[0].g = 90; wd->color[0].b = 18;
+       wd->color[1].r = 255; wd->color[1].g = 213; wd->color[1].b = 0;
+       wd->color[2].r = 146; wd->color[2].g = 255; wd->color[2].b = 11;
+       wd->color[3].r = 9; wd->color[3].g = 186; wd->color[3].b = 10;
+       wd->color[4].r = 86; wd->color[4].g = 201; wd->color[4].b = 242;
+       wd->color[5].r = 18; wd->color[5].g = 83; wd->color[5].b = 128;
+       wd->color[6].r = 140; wd->color[6].g = 53; wd->color[6].b = 238;
+       wd->color[7].r = 255; wd->color[7].g = 145; wd->color[7].b = 145;
+       wd->color[8].r = 255; wd->color[8].g = 59; wd->color[8].b = 119;
+       wd->color[9].r = 133; wd->color[9].g = 100; wd->color[9].b = 69;
+
+       _color_table_update(obj, 2, 5, 10, wd->color);
+
+       elm_widget_resize_object_set(obj, wd->lay);
+//     evas_object_smart_member_add(wd->lay, obj);
+       evas_object_event_callback_add(wd->lay, EVAS_CALLBACK_RESIZE, _colorpalette_object_resize, obj);
+       evas_object_event_callback_add(obj, EVAS_CALLBACK_MOVE, _colorpalette_object_move, obj);
+       evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _colorpalette_object_show, obj);
+       evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE, _colorpalette_object_hide, obj);
+
+       // FIXME
+       // evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
+       // _sizing_eval(obj);
+
+       return obj;
+}
+
+
+/**
+ * Set colors to the colorpalette.
+ *
+ * @param obj   Colorpalette object
+ * @param color_num     number of the colors on the colorpalette
+ * @param color     Color lists
+ *
+ * @ingroup Colorpalette
+ */
+EAPI void elm_colorpalette_color_set(Evas_Object *obj, int color_num, Elm_Colorpalette_Color *color)
+{
+       Widget_Data *wd = elm_widget_data_get(obj);
+       int i;
+
+       if (color_num > MAX_NUM_COLORS) return;
+
+       if (!wd) return;
+
+       if (wd->color) {
+               free(wd->color);
+               wd->color = NULL;
+       }
+
+       wd->color = (Elm_Colorpalette_Color*) calloc (color_num, sizeof(Elm_Colorpalette_Color));
+
+       for ( i = 0 ; i < color_num ; i++) {
+               wd->color[i].r = color[i].r;
+               wd->color[i].g = color[i].g;
+               wd->color[i].b = color[i].b;
+       }
+
+       _color_table_update(obj, wd->row, wd->col, color_num, wd->color);
+       _sizing_eval(obj);
+}
+
+/**
+ * Set row/column value for the colorpalette.
+ *
+ * @param obj   Colorpalette object
+ * @param row   row value for the colorpalette
+ * @param col   column value for the colorpalette
+ *
+ * @ingroup Colorpalette
+ */
+EAPI void elm_colorpalette_row_column_set(Evas_Object *obj, int row, int col)
+{
+       Widget_Data *wd = elm_widget_data_get(obj);
+
+       if (!wd) return ;
+
+       _color_table_update(obj, row, col, wd->num, wd->color);
+       _sizing_eval(obj);
+}
+
diff --git a/src/lib/elm_colorpicker.c b/src/lib/elm_colorpicker.c
new file mode 100755 (executable)
index 0000000..cef9931
--- /dev/null
@@ -0,0 +1,872 @@
+#include <Elementary.h>
+#include "elm_priv.h"
+#include <Ecore.h>
+
+/**
+ * @addtogroup Colorpicker Colorpicker
+ *
+ * By using colorpicker, you can select a color.
+ * Colorpicker made a color using HSV/HSB mode.
+ */
+
+#define BASE_STEP 360
+#define HUE_STEP 360
+#define SAT_STEP 127
+#define LIG_STEP 255
+
+typedef struct _Colorpicker_Data Colorpicker_Data;
+struct _Colorpicker_Data
+{
+       Evas_Object *parent;
+       Evas_Object *colorbar;
+       Evas_Object *bar;
+       Evas_Object *lbt;
+       Evas_Object *rbt;
+       Evas_Object *bg_rect;
+       Evas_Object *arrow;
+       Evas_Object *touch_area;
+
+       int colorpicker_num;
+       int button_state;
+};
+
+typedef struct _Widget_Data Widget_Data;
+struct _Widget_Data
+{
+       Evas_Object *e;
+       Evas_Object *lay;
+       Colorpicker_Data *cp[3];
+       Evas_Coord _x, _y, _w, _h;
+       int r, g, b;
+       int er, eg, eb;
+       int sr, sg, sb;
+       double h, s, l;
+
+       Ecore_Timer *lp_timer;
+       Ecore_Timer *mv_timer;
+};
+
+typedef enum{
+       BUTTON_RELEASED,
+       L_BUTTON_PRESSED,
+       R_BUTTON_PRESSED
+} Button_State;
+
+static void _del_hook(Evas_Object *obj);
+static void _theme_hook(Evas_Object *obj);
+static void _sizing_eval(Evas_Object *obj);
+static void _sub_del(void *data, Evas_Object *obj, void *event_info);
+
+static void _colorpicker_object_move(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _colorpicker_object_resize(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _colorpicker_object_show(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _colorpicker_object_hide(void *data, Evas *e, Evas_Object *obj, void *event_info);
+
+static void _rgb_to_hsl(void *data);
+static void _hsl_to_rgb(void *data);
+static void _color_with_saturation(void *data);
+static void _draw_rects(void *data, double x);
+static void _arrow_cb(void *data, Evas_Object *obj, const char *emission, const char *source);
+static void _colorbar_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static int _mv_timer(void *data);
+static int _long_press_timer(void *data);
+static void _left_button_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _right_button_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _left_button_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _right_button_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _add_colorbar(Evas_Object* obj);
+
+static void
+_del_hook(Evas_Object *obj)
+{
+       Widget_Data *wd = elm_widget_data_get(obj);
+       int i;
+       if (!wd) return;
+
+       for( i=0 ; i<3 ; i++)
+       {
+               evas_object_del(wd->cp[i]->colorbar);
+               wd->cp[i]->colorbar = NULL;
+               evas_object_del(wd->cp[i]->bar);
+               wd->cp[i]->bar = NULL;
+               evas_object_del(wd->cp[i]->lbt);
+               wd->cp[i]->lbt = NULL;
+               evas_object_del(wd->cp[i]->rbt);
+               wd->cp[i]->rbt = NULL;
+               if(i==1){
+                       evas_object_del(wd->cp[i]->bg_rect);
+                       wd->cp[i]->bg_rect = NULL;
+               }
+               evas_object_del(wd->cp[i]->arrow);
+               wd->cp[i]->arrow = NULL;
+               evas_object_del(wd->cp[i]->touch_area);
+               wd->cp[i]->touch_area = NULL;
+       }
+
+       if (wd->lay){
+               evas_object_smart_member_del(wd->lay);
+               evas_object_del(wd->lay);
+               wd->lay = NULL;
+       }
+       free(wd);
+}
+
+static void
+_theme_hook(Evas_Object *obj)
+{
+       Widget_Data *wd = elm_widget_data_get(obj);
+       int i;
+       if (!wd){
+               return;
+       }
+
+       _elm_theme_set(wd->lay, "colorpicker", "bg", elm_widget_style_get(obj));
+
+       for( i=0 ; i<3 ; i++)
+       {
+               evas_object_del(wd->cp[i]->colorbar);
+               wd->cp[i]->colorbar = NULL;
+               evas_object_del(wd->cp[i]->bar);
+               wd->cp[i]->bar = NULL;
+               evas_object_del(wd->cp[i]->lbt);
+               wd->cp[i]->lbt = NULL;
+               evas_object_del(wd->cp[i]->rbt);
+               wd->cp[i]->rbt = NULL;
+               if(i==1){
+                       evas_object_del(wd->cp[i]->bg_rect);
+                       wd->cp[i]->bg_rect = NULL;
+               }
+               evas_object_del(wd->cp[i]->arrow);
+               wd->cp[i]->arrow = NULL;
+               evas_object_del(wd->cp[i]->touch_area);
+               wd->cp[i]->touch_area = NULL;
+       }
+
+       _add_colorbar(obj);
+//     _sizing_eval(obj);
+    // FIXME : add more codes
+    //
+
+}
+
+
+static void
+_sub_del(void *data, Evas_Object *obj, void *event_info)
+{
+       Widget_Data *wd = elm_widget_data_get(obj);
+       //Evas_Object *sub = event_info;
+       if (!wd)
+               return;
+}
+
+static void
+_sizing_eval(Evas_Object *obj)
+{
+       Widget_Data *wd = elm_widget_data_get(obj);
+
+       if (!wd)
+               return;
+
+       DBG("[%s]\n", __func__);
+
+       _colorpicker_object_move(obj, NULL, obj, NULL);
+       _colorpicker_object_resize(obj, NULL, obj, NULL);
+}
+
+
+static void _colorpicker_object_move(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+       DBG("%s", __func__);
+
+       Widget_Data *wd;
+       Evas_Coord x, y;
+
+       if(!data)
+               return;
+
+       wd = elm_widget_data_get((Evas_Object *)data);
+
+       if(!wd)
+               return;
+
+       evas_object_geometry_get(wd->lay, &x, &y, NULL, NULL);
+
+       wd->_x = x;
+       wd->_y = y;
+
+       evas_object_move(wd->lay, x, y);
+}
+
+static void _colorpicker_object_resize(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+       DBG("%s", __func__);
+
+       Widget_Data *wd;
+       Evas_Coord w, h;
+       Evas_Coord arrow_w, arrow_h;
+
+       int i;
+
+       if(!data)
+               return;
+
+       wd = elm_widget_data_get((Evas_Object *)data);
+
+       if(!wd) return;
+       if(!wd->lay) return;
+
+       evas_object_geometry_get(wd->lay, NULL, NULL, &w, &h);
+       wd->_w = w;
+       wd->_h = h;
+
+       edje_object_part_geometry_get(wd->cp[0]->colorbar, "arrow_bg", NULL, NULL, NULL,&arrow_h);
+       edje_object_part_geometry_get(wd->cp[0]->colorbar, "arrow", NULL, NULL, &arrow_w, NULL);
+
+       for (i=0 ;  i<3 ; i++)
+               evas_object_size_hint_min_set(wd->cp[i]->arrow, arrow_w, arrow_h);
+
+       evas_object_resize(wd->lay, w, h);
+
+       elm_colorpicker_color_set((Evas_Object*)data, wd->r, wd->g , wd->b);
+}
+
+
+static void _colorpicker_object_show(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+       DBG("%s", __func__);
+
+       Widget_Data *wd = NULL;
+
+       if(data == NULL)
+               return;
+
+       wd = elm_widget_data_get((Evas_Object *)data);
+
+       if(wd == NULL)
+               return;
+
+       if (wd->lay) {
+               evas_object_show(wd->lay);
+       }
+}
+
+static void _colorpicker_object_hide(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+       DBG("%s", __func__);
+
+       Widget_Data *wd = NULL;
+
+       if(data == NULL)
+               return;
+
+       wd = elm_widget_data_get((Evas_Object *)data);
+
+       if(wd == NULL)
+               return;
+
+       if (wd->lay) {
+               evas_object_hide(wd->lay);
+       }
+}
+
+static void _rgb_to_hsl(void *data)
+{
+       Widget_Data *wd = (Widget_Data*) data;
+
+       double r, g, b;
+       double v, m, vm;
+       double r2, g2, b2;
+
+       r = wd->r;
+       g = wd->g;
+       b = wd->b;
+
+       r /= 255.0;
+       g /= 255.0;
+       b /= 255.0;
+
+       v = (r > g) ? r : g ;
+       v = (v > b) ? v : b ;
+
+       m = (r < g) ? r : g ;
+       m = (m < b) ? m : b ;
+
+       wd->h = 0.0;
+       wd->s = 0.0;
+       wd->l = 0.0;
+
+
+       wd->l = (m + v) / 2.0;
+
+       if (wd->l <= 0.0)
+               return;
+
+       vm = v - m;
+       wd->s = vm;
+
+       if (wd->s > 0.0)
+               wd->s /= (wd->l <= 0.5) ? (v + m ) : (2.0 - v - m) ;
+
+       else
+               return;
+
+       r2 = (v - r) / vm;
+       g2 = (v - g) / vm;
+       b2 = (v - b) / vm;
+
+       if (r == v)
+               wd->h = (g == m ? 5.0 + b2 : 1.0 - g2);
+
+       else if (g == v)
+               wd->h = (b == m ? 1.0 + r2 : 3.0 - b2);
+
+       else
+               wd->h = (r == m ? 3.0 + g2 : 5.0 - r2);
+
+       wd->h *= 60.0 ;
+}
+
+
+static void _hsl_to_rgb(void *data)
+{
+       Widget_Data *wd = (Widget_Data*) data;
+
+       double r, g, b;
+       double _h, _s, _l ;
+       int i;
+       double sv, vsf, f, p, q, t, v;
+
+       _h = wd->h;
+       _s = wd->s;
+       _l = wd->l;
+
+       if(_s == 0.0){
+               r = g = b = _l;
+       }
+
+       else {
+               if ( _h == 360.0 )
+                       _h = 0.0;
+               _h /= 60.0;
+
+               v = (_l <= 0.5)? ( _l * (1.0 + _s)) : ( _l +  _s - (_l * _s));
+               p = _l + _l - v;
+
+               if (v != 0)
+                       sv = (v - p) / v;
+               else
+                       sv = 0;
+
+               i = (int)_h;
+               f = _h - i;
+
+               vsf = v * sv * f;
+
+               t = p + vsf; //mid1
+               q = v - vsf; //mid2
+
+               switch(i) {
+                       case 0: r = v; g = t; b = p; break;
+                       case 1: r = q; g = v; b = p; break;
+                       case 2: r = p; g = v; b = t; break;
+                       case 3: r = p; g = q; b = v; break;
+                       case 4: r = t; g = p; b = v; break;
+                       case 5: r = v; g = p; b = q; break;
+               }
+       }
+
+       i = (int)(r * 255.0);
+       f = (r * 255.0) - i;
+       wd->r = ( f <= 0.5 )? i : (i + 1) ;
+
+       i = (int)(g * 255.0);
+       f = (g * 255.0) - i;
+       wd->g = ( f <= 0.5 )? i : (i + 1) ;
+
+       i = (int)(b * 255.0);
+       f = (b * 255.0) - i;
+       wd->b = ( f <= 0.5 )? i : (i + 1) ;
+
+}
+
+static void _color_with_saturation(void *data)
+{
+       Widget_Data *wd = (Widget_Data*) data;
+
+       if( wd->er > 127 )
+               wd->sr = (int) ( (double)127 + ((double)wd->er - (double)127) * wd->s );
+       else
+               wd->sr = (int) ( (double)127 - ((double)127 - (double)wd->er) * wd->s );
+
+       if( wd->eg > 127 )
+               wd->sg = (int) ( (double)127 + ((double)wd->eg - (double)127) * wd->s );
+       else
+               wd->sg = (int) ( (double)127 - ((double)127 - (double)wd->eg) * wd->s );
+
+       if( wd->eb > 127 )
+               wd->sb = (int) ( (double)127 + ((double)wd->eb - (double)127) * wd->s );
+       else
+               wd->sb = (int) ( (double)127 - ((double)127 - (double)wd->eb) * wd->s );
+}
+
+static void _draw_rects(void *data, double x)
+{
+       Colorpicker_Data *cp = (Colorpicker_Data*)data;
+       Widget_Data *wd = elm_widget_data_get(cp->parent);
+
+       double one_six = (double)1/(double)6;
+
+       switch(cp->colorpicker_num)
+       {
+               case 0 :
+                       wd->h =  360.0 * x ;
+
+                       if( x < one_six ){
+                               wd->er = 255;
+                               wd->eg = (int)((double)255 * x * (double)6 );
+                               wd->eb = 0;
+                       }
+                       else if( x < (double)2 * one_six ){
+                               wd->er = 255 - (int)((double)255 * ( x - one_six ) * (double)6 );
+                               wd->eg = 255;
+                               wd->eb = 0;
+                       }
+                       else if( x < (double)3 * one_six ){
+                               wd->er = 0;
+                               wd->eg = 255;
+                               wd->eb = (int)((double)255 * ( x - (double)2 * one_six ) * (double)6 );
+                       }
+                       else if( x < (double)4 * one_six ){
+                               wd->er = 0;
+                               wd->eg = 255 - (int)((double)255 * ( x - (double)3 * one_six ) * (double)6);
+                               wd->eb = 255;
+                       }
+                       else if( x < (double)5 * one_six ){
+                               wd->er = (int)((double)255 * ( x - (double)4 * one_six ) * (double)6 );
+                               wd->eg = 0;
+                               wd->eb = 255;
+                       }
+                       else {
+                               wd->er = 255;
+                               wd->eg = 0;
+                               wd->eb = 255 - (int)((double)255 * ( x - (double)5 * one_six ) * (double)6 );
+                       }
+
+                       evas_object_color_set(wd->cp[0]->arrow, wd->er, wd->eg, wd->eb, 255);
+                       evas_object_color_set(wd->cp[1]->bg_rect, wd->er, wd->eg, wd->eb, 255);
+
+                       _color_with_saturation(wd);
+
+                       evas_object_color_set(wd->cp[1]->arrow, wd->sr, wd->sg, wd->sb, 255);
+
+                       break;
+
+               case 1:
+                       wd->s = (double)1 - x;
+
+                       _color_with_saturation(wd);
+
+                       evas_object_color_set(wd->cp[1]->arrow, wd->sr, wd->sg, wd->sb, 255);
+
+                       break;
+
+               case 2:
+                       wd->l = x ;
+
+                       evas_object_color_set(wd->cp[2]->arrow, (int)( (double)255 * x ), (int)( (double)255 * x ), (int)( (double)255 * x ), 255);
+
+                       break;
+
+               default:
+                       break;
+
+       }
+
+       _hsl_to_rgb(wd);
+
+}
+
+static void _arrow_cb(void *data, Evas_Object *obj, const char *emission, const char *source)
+{
+       Colorpicker_Data *cp = (Colorpicker_Data*)data;
+       double x, y;
+       edje_object_part_drag_value_get(obj, "arrow", &x, &y);
+
+       _draw_rects(data, x);
+
+       evas_object_smart_callback_call(cp->parent, "clicked", NULL);
+}
+
+static void _colorbar_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+       Colorpicker_Data *cp = (Colorpicker_Data*)data;
+       Evas_Event_Mouse_Down *ev = event_info;
+       Evas_Coord x, y, w, h;
+       double arrow_x, arrow_y;
+
+       evas_object_geometry_get(cp->bar, &x, &y, &w, &h);
+
+       edje_object_part_drag_value_get(cp->colorbar, "arrow", &arrow_x, &arrow_y);
+
+       arrow_x = ((double)ev->output.x - (double)x)  / (double)w;
+
+       if (arrow_x > 1)
+               arrow_x = 1;
+
+       if (arrow_x < 0)
+               arrow_x = 0;
+
+       edje_object_part_drag_value_set(cp->colorbar, "arrow", arrow_x, arrow_y);
+
+       _draw_rects(data, arrow_x);
+
+       evas_object_smart_callback_call(cp->parent, "clicked", NULL);
+       evas_event_feed_mouse_cancel(e, NULL, NULL);
+       evas_event_feed_mouse_down(e, 1, EVAS_BUTTON_NONE, NULL, NULL);
+}
+
+
+static int _mv_timer(void *data)
+{
+       Colorpicker_Data *cp = (Colorpicker_Data *)data;
+
+       double x, y;
+
+       edje_object_part_drag_value_get(cp->colorbar, "arrow", &x, &y);
+
+       if (cp->button_state == L_BUTTON_PRESSED ) {
+               x -= (double)1/(double)BASE_STEP;
+
+               if(x < 0)
+                       x = 0;
+               edje_object_part_drag_value_set(cp->colorbar, "arrow", x, y);
+
+               _draw_rects(data, x);
+
+               evas_object_smart_callback_call(cp->parent, "clicked", NULL);
+
+               return 1;
+       }
+
+       else if (cp->button_state == R_BUTTON_PRESSED ) {
+               x += (double)1/(double)BASE_STEP;
+
+               if(x > 1)
+                       x = 1;
+               edje_object_part_drag_value_set(cp->colorbar, "arrow", x, y);
+
+               _draw_rects(data, x);
+
+               evas_object_smart_callback_call(cp->parent, "clicked", NULL);
+
+               return 1;
+       }
+
+       else
+               return 0;
+}
+
+static int _long_press_timer(void *data)
+{
+       Colorpicker_Data *cp = (Colorpicker_Data *)data;
+       Widget_Data *wd = elm_widget_data_get(cp->parent);
+
+       if(wd->lp_timer){
+               ecore_timer_del(wd->lp_timer);
+               wd->lp_timer = NULL;
+       }
+
+       wd->mv_timer = ecore_timer_add(0.01, _mv_timer, cp);
+
+       return EXIT_SUCCESS;
+}
+
+static void _left_button_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+       Colorpicker_Data *cp = (Colorpicker_Data*)data;
+       Widget_Data *wd = elm_widget_data_get(cp->parent);
+       double x, y;
+
+       edje_object_signal_emit(cp->lbt, "MOUSE_DOWN", "LEFT_ARROW");
+
+       edje_object_part_drag_value_get(cp->colorbar, "arrow", &x, &y);
+
+       if (cp->colorpicker_num == 0)
+               x -= (double)1/(double)HUE_STEP;
+       else if (cp->colorpicker_num == 1)
+               x -= (double)1/(double)SAT_STEP;
+       else if (cp->colorpicker_num == 2)
+               x -= (double)1/(double)LIG_STEP;
+
+       if(x < 0)
+               x = 0;
+       edje_object_part_drag_value_set(cp->colorbar, "arrow", x, y);
+
+       _draw_rects(data, x);
+
+       evas_object_smart_callback_call(cp->parent, "clicked", NULL);
+       cp->button_state = L_BUTTON_PRESSED;
+
+       if(wd->lp_timer){
+               ecore_timer_del(wd->lp_timer);
+               wd->lp_timer = NULL;
+       }
+       wd->lp_timer = ecore_timer_add(1.0, _long_press_timer, cp);
+}
+
+static void _right_button_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+       Colorpicker_Data *cp = (Colorpicker_Data*)data;
+       Widget_Data *wd = elm_widget_data_get(cp->parent);
+       double x, y;
+
+       edje_object_signal_emit(cp->rbt, "MOUSE_DOWN", "RIGHT_ARROW");
+
+       edje_object_part_drag_value_get(cp->colorbar, "arrow", &x, &y);
+
+       if (cp->colorpicker_num == 0)
+               x += (double)1/(double)HUE_STEP;
+       else if (cp->colorpicker_num == 1)
+               x += (double)1/(double)SAT_STEP;
+       else if (cp->colorpicker_num == 2)
+               x += (double)1/(double)LIG_STEP;
+
+       if(x > 1)
+               x = 1;
+       edje_object_part_drag_value_set(cp->colorbar, "arrow", x, y);
+
+       _draw_rects(data, x);
+
+       evas_object_smart_callback_call(cp->parent, "clicked", NULL);
+       cp->button_state = R_BUTTON_PRESSED;
+       if(wd->lp_timer){
+               ecore_timer_del(wd->lp_timer);
+               wd->lp_timer = NULL;
+       }
+       wd->lp_timer = ecore_timer_add(1.0, _long_press_timer, cp);
+}
+
+static void _left_button_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+       Colorpicker_Data *cp = (Colorpicker_Data*)data;
+       Widget_Data *wd = elm_widget_data_get(cp->parent);
+       
+       if(wd->lp_timer){
+               ecore_timer_del(wd->lp_timer);
+               wd->lp_timer = NULL;
+       }
+
+       cp->button_state = BUTTON_RELEASED;
+       edje_object_signal_emit(cp->lbt, "MOUSE_UP", "LEFT_ARROW");
+}
+
+static void _right_button_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+       Colorpicker_Data *cp = (Colorpicker_Data*)data;
+       Widget_Data *wd = elm_widget_data_get(cp->parent);
+       
+       if(wd->lp_timer){
+               ecore_timer_del(wd->lp_timer);
+               wd->lp_timer = NULL;
+       }
+
+       cp->button_state = BUTTON_RELEASED;
+       edje_object_signal_emit(cp->rbt, "MOUSE_UP", "RIGHT_ARROW");
+}
+
+static void _add_colorbar(Evas_Object* obj)
+{
+       int i;
+       Widget_Data *wd ;
+       Evas *e;
+       char colorbar_name[128];
+
+       wd = elm_widget_data_get(obj);
+       if (!wd) return ;
+
+       e = wd->e;
+
+       for( i=0 ; i<3 ; i++ ){
+               wd->cp[i] = ELM_NEW(Colorpicker_Data);
+
+               wd->cp[i]->parent = obj;
+               wd->cp[i]->colorpicker_num = i;
+
+               /* load colorbar area */
+               wd->cp[i]->colorbar =  edje_object_add(e);
+               _elm_theme_set(wd->cp[i]->colorbar, "colorpicker", "base", "default");
+               snprintf(colorbar_name, sizeof(colorbar_name), "colorbar_%d", i);
+               edje_object_signal_callback_add(wd->cp[i]->colorbar, "drag", "*", _arrow_cb, wd->cp[i]);
+               edje_object_part_swallow(wd->lay, colorbar_name, wd->cp[i]->colorbar);
+               evas_object_show(wd->cp[i]->colorbar);
+
+               /* load colorbar image */
+               wd->cp[i]->bar = edje_object_add(e);
+               _elm_theme_set(wd->cp[i]->bar, "colorpicker", "image", colorbar_name);
+               evas_object_show(wd->cp[i]->bar);
+               edje_object_part_swallow(wd->cp[i]->colorbar, "bar", wd->cp[i]->bar);
+
+               /* provide expanded touch area */
+               wd->cp[i]->touch_area = evas_object_rectangle_add(e);
+               evas_object_color_set(wd->cp[i]->touch_area, 0, 0, 0, 0);
+               edje_object_part_swallow(wd->cp[i]->colorbar, "arrow_bg", wd->cp[i]->touch_area);
+               evas_object_event_callback_add(wd->cp[i]->touch_area, EVAS_CALLBACK_MOUSE_DOWN, _colorbar_cb, wd->cp[i]);
+               evas_object_show(wd->cp[i]->touch_area);
+
+               /* load background rectangle of the colorbar. used for changing color of the opacity bar */
+               if(i==1){
+                       wd->cp[i]->bg_rect = evas_object_rectangle_add(e);
+                       evas_object_color_set(wd->cp[i]->bg_rect, wd->er, wd->eg, wd->eb, 255);
+                       evas_object_resize(wd->cp[i]->bg_rect, 10, 10);
+                       evas_object_show(wd->cp[i]->bg_rect);
+                       edje_object_part_swallow(wd->cp[i]->colorbar, "bar_bg", wd->cp[i]->bg_rect);
+               }
+               /* load arrow image, pointing the colorbar */
+               wd->cp[i]->arrow = edje_object_add(e);
+               _elm_theme_set(wd->cp[i]->arrow, "colorpicker", "image", "updown");
+               evas_object_show(wd->cp[i]->arrow);
+               edje_object_part_swallow(wd->cp[i]->colorbar, "arrow", wd->cp[i]->arrow);
+
+               if(i==2)
+                       evas_object_color_set(wd->cp[i]->arrow, 0, 0, 0, 255);
+               else
+                       evas_object_color_set(wd->cp[i]->arrow, wd->er, wd->eg, wd->eb, 255);
+
+               /* load left button */
+               wd->cp[i]->lbt = edje_object_add(e);
+               _elm_theme_set(wd->cp[i]->lbt, "colorpicker", "button", "left");
+               evas_object_event_callback_add(wd->cp[i]->lbt, EVAS_CALLBACK_MOUSE_DOWN, _left_button_down_cb, wd->cp[i]);
+               evas_object_event_callback_add(wd->cp[i]->lbt, EVAS_CALLBACK_MOUSE_UP, _left_button_up_cb, wd->cp[i]);
+               evas_object_show(wd->cp[i]->lbt);
+               edje_object_part_swallow(wd->cp[i]->colorbar, "l_button", wd->cp[i]->lbt);
+
+               /* load right button */
+               wd->cp[i]->rbt = edje_object_add(e);
+               _elm_theme_set(wd->cp[i]->rbt, "colorpicker", "button", "right");
+               evas_object_event_callback_add(wd->cp[i]->rbt, EVAS_CALLBACK_MOUSE_DOWN, _right_button_down_cb, wd->cp[i]);
+               evas_object_event_callback_add(wd->cp[i]->rbt, EVAS_CALLBACK_MOUSE_UP, _right_button_up_cb, wd->cp[i]);
+               evas_object_show( wd->cp[i]->rbt);
+               edje_object_part_swallow(wd->cp[i]->colorbar, "r_button", wd->cp[i]->rbt);
+
+       }
+}
+
+/**
+ * Add a new colorpicker to the parent
+ *
+ * @param parent The parent object
+ * @return The new object or NULL if it cannot be created
+ *
+ * @ingroup Colorpicker
+ */
+EAPI Evas_Object *elm_colorpicker_add(Evas_Object *parent)
+{
+       Evas_Object *obj = NULL;
+       Widget_Data *wd = NULL;
+       Evas *e;
+       wd = ELM_NEW(Widget_Data);
+
+       e = evas_object_evas_get(parent);
+       if (e == NULL) return NULL;
+       obj = elm_widget_add(e);
+       elm_widget_type_set(obj, "colorpicker");
+       elm_widget_sub_object_add(parent, obj);
+       elm_widget_data_set(obj, wd);
+       wd->e = e;
+       elm_widget_del_hook_set(obj, _del_hook);
+       elm_widget_theme_hook_set(obj, _theme_hook);
+
+       /* load background edj */
+       wd->lay = edje_object_add(e);
+       _elm_theme_set(wd->lay, "colorpicker", "bg", "default");
+
+       evas_object_size_hint_weight_set(wd->lay, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       if(wd->lay == NULL) {
+               printf("Cannot load bg edj\n");
+               return NULL;
+       }
+
+       elm_widget_resize_object_set(obj, wd->lay);
+
+       wd->er = 255;
+       wd->eg = 0;
+       wd->eb = 0;
+       wd->h = 0.0;
+       wd->s = 1.0;
+       wd->l = 0.0;
+
+       _hsl_to_rgb(wd);
+
+       _add_colorbar(obj);
+
+//     evas_object_smart_member_add(wd->lay, obj);
+       evas_object_event_callback_add(wd->lay, EVAS_CALLBACK_RESIZE, _colorpicker_object_resize, obj);
+       evas_object_event_callback_add(obj, EVAS_CALLBACK_MOVE, _colorpicker_object_move, obj);
+       evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _colorpicker_object_show, obj);
+       evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE, _colorpicker_object_hide, obj);
+
+       // FIXME
+       // evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
+       // _sizing_eval(obj);
+
+       return obj;
+}
+
+
+/**
+ * Set a color for the colorpicker
+ *
+ * @param obj  Colorpicker object
+ * @param r    r-value of color
+ * @param g    g-value of color
+ * @param b    b-value of color
+ *
+ * @ingroup Colorpicker
+ */
+EAPI void elm_colorpicker_color_set(Evas_Object *obj, unsigned int r, unsigned int g , unsigned int b)
+{
+       Widget_Data *wd = elm_widget_data_get(obj);
+       double x, y;
+
+       wd->r = r;
+       wd->g = g;
+       wd->b = b;
+
+       _rgb_to_hsl(wd);
+
+       edje_object_part_drag_value_get(wd->cp[0]->colorbar, "arrow", &x, &y);
+       x = wd->h / 360.0;
+       edje_object_part_drag_value_set(wd->cp[0]->colorbar, "arrow", x, y);
+       _draw_rects(wd->cp[0], x);
+
+       edje_object_part_drag_value_get(wd->cp[1]->colorbar, "arrow", &x, &y);
+       x = 1.0 - wd->s;
+       edje_object_part_drag_value_set(wd->cp[1]->colorbar, "arrow", x, y);
+       _draw_rects(wd->cp[1], x);
+
+       edje_object_part_drag_value_get(wd->cp[2]->colorbar, "arrow", &x, &y);
+       x = wd->l ;
+       edje_object_part_drag_value_set(wd->cp[2]->colorbar, "arrow", x, y);
+       _draw_rects(wd->cp[2], x);
+}
+
+
+/**
+ * Get a color from the colorpicker
+ *
+ * @param obj  Colorpicker object
+ * @param r    integer pointer for r-value of color
+ * @param g    integer pointer for g-value of color
+ * @param b    integer pointer for b-value of color
+ *
+ * @ingroup Colorpicker
+ */
+EAPI void elm_colorpicker_color_get(Evas_Object *obj, unsigned int *r, unsigned int *g , unsigned int *b)
+{
+       Widget_Data *wd = elm_widget_data_get(obj);
+
+       *r = wd->r;
+       *g = wd->g;
+       *b = wd->b;
+}
+
diff --git a/src/lib/elm_editfield.c b/src/lib/elm_editfield.c
new file mode 100755 (executable)
index 0000000..1605ea1
--- /dev/null
@@ -0,0 +1,495 @@
+#include <Elementary.h>
+#include "elm_priv.h"
+
+/**
+ * @addtogroup Editfield Editfield
+ *
+ * This is a editfield. It can contain a simple label and icon objects.
+ */
+
+typedef struct _Widget_Data Widget_Data;
+
+struct _Widget_Data
+{
+       Evas_Object *base;      
+       Evas_Object *entry;
+       Evas_Object *ricon;
+       Evas_Object *licon;
+       const char *label;
+       const char *guide_text;
+       Eina_Bool needs_size_calc:1;
+       Eina_Bool show_guide_text:1;
+       Eina_Bool editing:1;
+};
+
+static void _del_hook(Evas_Object *obj);
+static void _theme_hook(Evas_Object *obj);
+static void _disable_hook(Evas_Object *obj);
+static void _sizing_eval(Evas_Object *obj);
+static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _on_focus_hook(void *data, Evas_Object *obj);
+static Eina_Bool _empty_entry(Evas_Object *entry);
+
+static void
+_del_hook(Evas_Object *obj)
+{
+       Widget_Data *wd = elm_widget_data_get(obj);
+       if (!wd) return;
+       if (wd->label) eina_stringshare_del(wd->label);
+       free(wd);
+}
+
+static void
+_on_focus_hook(void *data, Evas_Object *obj)
+{
+       Widget_Data *wd = elm_widget_data_get(obj);
+       const char* text;
+       const char* str_text;
+
+       if (!elm_widget_focus_get(obj) && !(elm_widget_disabled_get(obj)) ) {   
+               
+               wd->editing = EINA_FALSE;
+               edje_object_signal_emit(wd->base, "elm,action,unfocus", "elm");
+               edje_object_signal_emit(wd->base, "elm,state,over,show", "elm");
+               
+               // aqua feature
+               text = elm_entry_entry_get(wd->entry);
+               edje_object_part_text_set(wd->base, "elm.content.no.edit", text);
+               edje_object_signal_emit(wd->base, "elm,action,no,edit", "elm");
+               
+               if(_empty_entry(wd->entry)) {
+                       if(wd->guide_text) {
+                               edje_object_part_text_set(wd->base, "elm.guidetext", wd->guide_text);
+                               edje_object_signal_emit(wd->base, "elm,state,guidetext,visible", "elm");
+                               wd->show_guide_text = EINA_TRUE;
+                       }
+               }
+       }
+}
+
+static void
+_theme_hook(Evas_Object *obj)
+{
+       Widget_Data *wd = elm_widget_data_get(obj);
+       if (!wd) return;
+
+       _elm_theme_set(wd->base, "editfield", "base", elm_widget_style_get(obj));
+       edje_object_part_swallow(wd->base, "elm.swallow.content", wd->entry);
+
+       // aqua feature
+       if(wd->ricon)   
+               edje_object_part_swallow(wd->base, "right_icon", wd->ricon);
+       if(wd->licon)
+               edje_object_part_swallow(wd->base, "left_icon", wd->licon);     
+       _sizing_eval(obj);
+}
+
+static void
+_disable_hook(Evas_Object *obj)
+{
+       Widget_Data *wd = elm_widget_data_get(obj);
+       if (elm_widget_disabled_get(obj)) {
+               elm_object_disabled_set(wd->entry, EINA_TRUE);
+               edje_object_signal_emit(wd->base, "elm,action,dim", "elm");             
+       }
+       else {
+               elm_object_disabled_set(wd->entry, EINA_FALSE);
+               edje_object_signal_emit(wd->base, "elm,action,dimup", "elm");           
+       }
+}
+
+static void
+_changed_hook(Evas_Object *obj)
+{
+       Widget_Data *wd = elm_widget_data_get(obj);
+       if (wd->needs_size_calc)
+       {
+               _sizing_eval(obj);
+               wd->needs_size_calc = 0;
+       }
+}
+
+static void
+_sizing_eval(Evas_Object *obj)
+{
+       Widget_Data *wd = elm_widget_data_get(obj);
+       Evas_Coord minw = -1, minh = -1;
+
+       edje_object_size_min_calc(wd->base, &minw, &minh);
+       evas_object_size_hint_min_set(obj, minw, minh);
+       evas_object_size_hint_max_set(obj, -1, -1);
+}
+
+static void
+_request_sizing_eval(Evas_Object *obj)
+{
+       Widget_Data *wd = elm_widget_data_get(obj);
+       if(!wd) return;
+       if (wd->needs_size_calc) return;
+       wd->needs_size_calc = 1;
+       evas_object_smart_changed(obj);
+}
+
+static void
+_changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+       double weight_x;
+       evas_object_size_hint_weight_get(data, &weight_x, NULL);
+       if (weight_x == EVAS_HINT_EXPAND)
+               _request_sizing_eval(data);
+}
+
+static Eina_Bool
+_empty_entry(Evas_Object *entry)
+{
+       const char* text;
+       char *strip_text;
+       int len = 0;
+
+       text = elm_entry_entry_get(entry);
+       if(!text) return EINA_FALSE;
+
+       strip_text = elm_entry_markup_to_utf8(text);
+
+       if (strip_text) {
+               len = strlen(strip_text);
+               free(strip_text);
+       }
+
+       if(len == 0) {
+               return EINA_TRUE;
+       }
+       else {
+               return EINA_FALSE;
+       }
+}
+
+static void
+_entry_changed_cb(void *data, Evas_Object *obj, void* event_info)
+{
+       const char *text;
+       Evas_Object *ef_obj = (Evas_Object *)data;
+       Widget_Data *wd = elm_widget_data_get(ef_obj);
+       
+       if(!wd || !ef_obj) return;
+
+       if(!_empty_entry(wd->entry)) {  
+               
+               // aqua feature
+               text = elm_entry_entry_get(wd->entry);
+               edje_object_part_text_set(wd->base, "elm.content.no.edit", text);       
+               
+               if(wd->guide_text) {
+                       edje_object_signal_emit(wd->base, "elm,state,guidetext,hidden", "elm");
+                       wd->show_guide_text = EINA_FALSE;
+               }
+       }
+}
+
+static void
+_signal_mouse_clicked(void *data, Evas_Object *obj, const char *emission, const char *source)
+{
+       Widget_Data *wd = elm_widget_data_get(data);
+       if(!wd) return;
+
+       if(strcmp(source, "left_icon") && strcmp(source, "right_icon") && strcmp(source, "over_change_bg"))
+       {
+               edje_object_signal_emit(wd->base, "elm,action,focus", "elm");   
+               edje_object_signal_emit(wd->base, "elm,state,over,hide", "elm");
+
+               // aqua feature
+               edje_object_signal_emit(wd->base, "elm,action,edit", "elm");    
+               elm_widget_focus_set(wd->entry, 1);     
+               
+               if(wd->editing == EINA_FALSE) {
+                       elm_entry_cursor_end_set(wd->entry);
+                       evas_object_smart_callback_call(wd->entry, "clicked", NULL);   // after completing of guide, should be eleminated
+               }
+
+               if(!_empty_entry(wd->entry)) {
+                       if(wd->guide_text) {
+                               edje_object_signal_emit(wd->base, "elm,state,guidetext,hidden", "elm");
+                               wd->show_guide_text = EINA_FALSE;
+                       }
+               }
+
+               evas_object_smart_callback_call(data, "clicked", NULL);
+
+               wd->editing = EINA_TRUE;
+       }
+}
+/**
+ * Add a new editfield object
+ *
+ * @param parent The parent object
+ * @return The new object or NULL if it cannot be created
+ *
+ * @ingroup Editfield
+ */
+EAPI Evas_Object *
+elm_editfield_add(Evas_Object *parent)
+{
+       Evas_Object *obj;
+       Evas *e;
+       Widget_Data *wd;
+
+       wd = ELM_NEW(Widget_Data);
+       e = evas_object_evas_get(parent);
+       obj = elm_widget_add(e);
+       elm_widget_type_set(obj, "editfield");
+       elm_widget_sub_object_add(parent, obj);
+       elm_widget_on_focus_hook_set( obj, _on_focus_hook, NULL );
+       elm_widget_data_set(obj, wd);
+       elm_widget_del_hook_set(obj, _del_hook);
+       elm_widget_theme_hook_set(obj, _theme_hook);
+       elm_widget_disable_hook_set(obj, _disable_hook);
+       elm_widget_changed_hook_set(obj, _changed_hook);
+       elm_widget_can_focus_set(obj, EINA_TRUE);
+
+       wd->base = edje_object_add(e);
+       _elm_theme_set(wd->base, "editfield", "base", "default");
+       elm_widget_resize_object_set(obj, wd->base);
+
+       edje_object_signal_callback_add(wd->base, "mouse,clicked,1", "*", 
+                                       _signal_mouse_clicked, obj);
+       wd->editing = EINA_FALSE;
+       wd->entry = elm_entry_add(obj);
+       elm_object_style_set(wd->entry, "editfield");
+       evas_object_size_hint_weight_set(wd->entry, 0, EVAS_HINT_EXPAND);
+       evas_object_size_hint_align_set(wd->entry, 0, EVAS_HINT_FILL);
+       evas_object_event_callback_add(wd->entry,
+                                       EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+                                      _changed_size_hints, obj);
+       edje_object_part_swallow(wd->base, "elm.swallow.content", wd->entry);
+
+       evas_object_smart_callback_add(wd->entry, "changed", _entry_changed_cb, obj);
+
+       _sizing_eval(obj);
+
+       return obj;
+}
+
+/**
+ * Set the label of editfield
+ *
+ * @param obj The editfield object
+ * @param label The label text
+ *
+ * @ingroup Editfield
+ */
+EAPI void
+elm_editfield_label_set(Evas_Object *obj, const char *label)
+{
+       Widget_Data *wd = elm_widget_data_get(obj);
+
+       if (!wd) return;
+       if (wd->label) eina_stringshare_del(wd->label);
+       if (label)
+       {
+               wd->label = eina_stringshare_add(label);
+               edje_object_signal_emit(wd->base, "elm,state,text,visible", "elm");
+               // aqua feature
+               edje_object_signal_emit(wd->base, "elm,state,left,icon,hide", "elm");
+       }
+       else
+       {
+               wd->label = NULL;
+               edje_object_signal_emit(wd->base, "elm,state,text,hidden", "elm");
+               // aqua feature
+               edje_object_signal_emit(wd->base, "elm,state,left,icon,show", "elm");
+       }
+
+       edje_object_message_signal_process(wd->base);
+       edje_object_part_text_set(wd->base, "elm.text", label);
+
+       _sizing_eval(obj);
+}
+
+/**
+ * Get the label used on the editfield object
+ *
+ * @param obj The editfield object
+ * @return label text
+ *
+ * @ingroup Editfield
+ */
+EAPI const char*
+elm_editfield_label_get(Evas_Object *obj)
+{
+       Widget_Data *wd = elm_widget_data_get(obj);
+       if (!wd) return NULL;
+       return wd->label;
+}
+
+/**
+ * Get the label used on the editfield object
+ *
+ * @param obj The editfield object
+ * @return label text
+ *
+ * @ingroup Editfield
+ */
+EAPI void
+elm_editfield_guide_text_set(Evas_Object *obj, const char *text)
+{
+       Widget_Data *wd = elm_widget_data_get(obj);
+       if (!wd) return;
+
+       if (wd->guide_text) eina_stringshare_del(wd->guide_text);
+       if (text)
+       {
+               wd->guide_text = eina_stringshare_add(text);
+               edje_object_part_text_set(wd->base, "elm.guidetext", wd->guide_text);
+               wd->show_guide_text = EINA_TRUE;
+       }
+       else
+       {
+               wd->guide_text = NULL;
+       }
+}
+
+/**
+ * Get the guidance text used on the editfield object
+ *
+ * @param obj The editfield object
+ * @return label text
+ *
+ * @ingroup Editfield
+ */
+EAPI const char*
+elm_editfield_guide_text_get(Evas_Object *obj)
+{
+       Widget_Data *wd = elm_widget_data_get(obj);
+       if (!wd) return NULL;
+
+       return wd->guide_text;
+}
+
+/**
+ * Get the entry of the editfield object
+ *
+ * @param obj The editfield object
+ * @return entry object
+ *
+ * @ingroup Editfield
+ */
+
+EAPI Evas_Object *
+elm_editfield_entry_get(Evas_Object *obj)
+{
+       Widget_Data *wd = elm_widget_data_get(obj);
+       if (!wd) return NULL;
+       return wd->entry;
+}
+
+/**
+ * Set the left side icon.
+ *
+ * @param obj The editfield object
+ * @param icon The icon object
+ * @return 1 if setting is done, 0 if there is no swallow part for the icon.
+ *
+ * @ingroup Editfield
+ */
+EAPI Eina_Bool 
+elm_editfield_left_icon_set(Evas_Object *obj, Evas_Object *icon)
+{
+       Widget_Data *wd = elm_widget_data_get(obj);
+       
+       if ((wd->licon != icon) && (wd->licon))
+               elm_widget_sub_object_del(obj, wd->licon);
+       
+       if (icon)
+       {
+               if ( !(edje_object_part_swallow(wd->base, "left_icon", icon)) )
+                       return EINA_FALSE;              
+               wd->licon = icon;
+               elm_widget_sub_object_add(obj, icon);
+               evas_object_event_callback_add(icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+                               _changed_size_hints, obj);
+               edje_object_signal_emit(wd->base, "elm,state,left,icon,show", "elm");
+               edje_object_signal_emit(wd->base, "elm,state,text,hidden", "elm");
+               _sizing_eval(obj);
+       }       
+       return EINA_TRUE;
+}
+
+/**
+ * Get the left side icon
+ *
+ * @param obj The editfield object
+ * @return icon object
+ *
+ * @ingroup Editfield
+ */
+EAPI Evas_Object *
+elm_editfield_left_icon_get(Evas_Object *obj)
+{
+       Widget_Data *wd = elm_widget_data_get(obj);
+       if (!wd) return NULL;
+       return wd->licon;
+}
+
+/**
+ * Set the right side icon.
+ *
+ * @param obj The editfield object
+ * @param icon The icon object
+ * @return 1 if setting is done, 0 if there is no swallow part for the icon.
+ *
+ * @ingroup Editfield
+ */
+EAPI Eina_Bool 
+elm_editfield_right_icon_set(Evas_Object *obj, Evas_Object *icon)
+{
+       Widget_Data *wd = elm_widget_data_get(obj);
+       
+       if ((wd->ricon != icon) && (wd->ricon))
+               elm_widget_sub_object_del(obj, wd->ricon);
+       
+       if (icon)
+       {
+               if ( !(edje_object_part_swallow(wd->base, "right_icon", icon)) )
+                       return EINA_FALSE;                              
+               wd->ricon = icon;
+               elm_widget_sub_object_add(obj, icon);
+               evas_object_event_callback_add(icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+                               _changed_size_hints, obj);              
+               edje_object_signal_emit(wd->base, "elm,state,right,icon,show", "elm");
+               _sizing_eval(obj);
+       }       
+       return EINA_TRUE;
+}
+
+/**
+ * Get the right side icon
+ *
+ * @param obj The editfield object
+ * @return icon object
+ *
+ * @ingroup Editfield
+ */
+EAPI Evas_Object *
+elm_editfield_right_icon_get(Evas_Object *obj)
+{
+       Widget_Data *wd = elm_widget_data_get(obj);
+       if (!wd) return NULL;
+       return wd->ricon;
+}
+
+/**
+ * Set entry object style as single-line or multi-line.
+ *
+ * @param obj The editfield object  
+ * @param single_line 1 if single-line , 0 if multi-line
+ *
+ * @ingroup Editfield
+ */
+EAPI void
+elm_editfield_entry_single_line_set(Evas_Object *obj, Eina_Bool single_line)
+{
+       Widget_Data *wd = elm_widget_data_get(obj);
+       if (!wd) return NULL;
+       elm_entry_single_line_set(wd->entry, single_line);
+}
+
index 5b4693c..133a14f 100644 (file)
@@ -43,21 +43,28 @@ typedef struct _Widget_Data Widget_Data;
 
 struct _Widget_Data
 {
-   Evas_Object *slider;
-   Evas_Object *icon;
-   Evas_Object *spacer;
-   const char *label;
-   const char *units;
-   const char *indicator;
-   const char *(*indicator_format_func)(double val);
-   Eina_Bool horizontal : 1;
-   Eina_Bool inverted : 1;
-   double val, val_min, val_max;
-   Ecore_Timer *delay;
-   Evas_Coord size;
+       Evas_Object *slider;
+       Evas_Object *icon;      
+       Evas_Object *spacer;
+       const char *label;
+       const char *units;
+       const char *indicator;
+       const char *(*indicator_format_func)(double val);
+       Eina_Bool horizontal : 1;
+       Eina_Bool inverted : 1;
+       double val, val_min, val_max;
+       Ecore_Timer *delay;
+       Evas_Coord size;
+       /* for supporting aqua feature */
+       Ecore_Timer *mv_timer;
+       Evas_Object *r_icon;
+       double src_val;
+       double des_val;
+       double mv_step;
 };
 
-static const char *widtype = NULL;
+#define SLIDER_THUMB_MOVE_STEP 100
+
 static void _del_hook(Evas_Object *obj);
 static void _theme_hook(Evas_Object *obj);
 static void _sizing_eval(Evas_Object *obj);
@@ -66,6 +73,9 @@ static void _sub_del(void *data, Evas_Object *obj, void *event_info);
 static void _units_set(Evas_Object *obj);
 static void _indicator_set(Evas_Object *obj);
 
+/* supporting aqua feature */
+static _mv_timer_cb(void *data);
+
 static const char SIG_CHANGED[] = "changed";
 static const char SIG_DELAY_CHANGED[] = "delay,changed";
 static const char SIG_DRAG_START[] = "slider,drag,start";
@@ -106,6 +116,10 @@ _theme_hook(Evas_Object *obj)
      edje_object_signal_emit(wd->slider, "elm,state,icon,visible", "elm");
    else
      edje_object_signal_emit(wd->slider, "elm,state,icon,hidden", "elm");
+   if (wd->r_icon)
+               edje_object_signal_emit(wd->slider, "elm,state,ricon,visible", "elm");
+       else
+               edje_object_signal_emit(wd->slider, "elm,state,ricon,hidden", "elm");
    if (wd->label)
      edje_object_signal_emit(wd->slider, "elm,state,text,visible", "elm");
    else
@@ -144,7 +158,11 @@ _changed_size_hints(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *even
 {
    Widget_Data *wd = elm_widget_data_get(data);
    if (!wd) return;
-   if (obj != wd->icon) return;
+
+   // if (obj != wd->icon) return;
+  /*supporting aqua feature*/
+   if (obj != wd->icon && obj != wd->r_icon) return;
+
    _sizing_eval(data);
 }
 
@@ -155,13 +173,22 @@ _sub_del(void *data __UNUSED__, Evas_Object *obj, void *event_info)
    Evas_Object *sub = event_info;
    if (!wd) return;
    if (sub == wd->icon)
-     {
+    {
        edje_object_signal_emit(wd->slider, "elm,state,icon,hidden", "elm");
        evas_object_event_callback_del_full
          (sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj);
        wd->icon = NULL;
        _sizing_eval(obj);
      }
+    /*supporting aqua feature*/
+    if (sub == wd->r_icon)
+    {
+        edje_object_signal_emit(wd->slider, "elm,state,ricon,hidden", "elm");
+        evas_object_event_callback_del_full
+        (sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj);
+        wd->r_icon = NULL;
+       _sizing_eval(obj);
+    }
 }
 
 static int
@@ -251,6 +278,12 @@ _indicator_set(Evas_Object *obj)
 static void
 _drag(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
 {
+    Widget_Data *wd = elm_widget_data_get((Evas_Object*)data);
+    /* supporting aqua feature : delete thumb move timer when drag event occured to the moving thumb */
+    if(wd->mv_timer){
+        ecore_timer_del(wd->mv_timer);
+         wd->mv_timer = NULL;
+    }
    _val_fetch(data);
    _units_set(data);
    _indicator_set(data);
@@ -259,6 +292,12 @@ _drag(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__,
 static void
 _drag_start(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
 {
+       Widget_Data *wd = elm_widget_data_get((Evas_Object*)data);
+       /* supporting aqua feature : delete thumb move timer when drag event occured to the moving thumb */
+       if(wd->mv_timer){
+               ecore_timer_del(wd->mv_timer);
+               wd->mv_timer = NULL;
+       }
    _val_fetch(data);
    evas_object_smart_callback_call(data, SIG_DRAG_START, NULL);
    _units_set(data);
@@ -318,6 +357,9 @@ elm_slider_add(Evas_Object *parent)
    wd->val_min = 0.0;
    wd->val_max = 1.0;
 
+    /* supporting aqua feature */
+    wd->mv_step = (double)((wd->val_max - wd->val_min) / (double)SLIDER_THUMB_MOVE_STEP);
+
    wd->slider = edje_object_add(e);
    _elm_theme_object_set(obj, wd->slider, "slider", "horizontal", "default");
    elm_widget_resize_object_set(obj, wd->slider);
@@ -652,6 +694,10 @@ elm_slider_min_max_set(Evas_Object *obj, double min, double max)
    if ((wd->val_min == min) && (wd->val_max == max)) return;
    wd->val_min = min;
    wd->val_max = max;
+
+       /* supporting aqua feature */
+       wd->mv_step = (double)((wd->val_max - wd->val_min) / (double)SLIDER_THUMB_MOVE_STEP);
+
    if (wd->val < wd->val_min) wd->val = wd->val_min;
    if (wd->val > wd->val_max) wd->val = wd->val_max;
    _val_set(obj);
@@ -790,3 +836,151 @@ elm_slider_indicator_format_function_set(Evas_Object *obj, const char *(*func)(d
    _indicator_set(obj);
 }
 
+
+//////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////  supporting aqua feature  ///////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////////////////////////////////
+
+
+
+/**
+ * Set the right icon object of the slider object
+ *
+ * Once the right icon object is set, it will become a child of the slider object and
+ * be deleted when the slider object is deleted. If another icon object is set
+ * then the previous one becomes orophaned and will no longer be deleted along
+ * with the slider.
+ *
+ * @param obj The slider object
+ * @param icon The icon object
+ * 
+ * @return 1 if icon set succeed, 0 if there is no part for right icon 
+ * 
+ * @ingroup Slider
+ */
+EAPI Eina_Bool 
+elm_slider_right_icon_set(Evas_Object *obj, Evas_Object *icon)
+{
+       Widget_Data *wd = elm_widget_data_get(obj);
+       
+       if ((wd->r_icon != icon) && (wd->r_icon))
+               elm_widget_sub_object_del(obj, wd->r_icon);
+       
+       if (icon)
+       {
+               if ( !(edje_object_part_swallow(wd->slider, "right_icon", icon)) )
+                       return EINA_FALSE;              
+               wd->r_icon = icon;
+               elm_widget_sub_object_add(obj, icon);
+               evas_object_event_callback_add(icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+                               _changed_size_hints, obj);
+               edje_object_signal_emit(wd->slider, "elm,state,ricon,visible", "elm");
+               _sizing_eval(obj);
+       }
+       
+       return EINA_TRUE;
+}
+
+
+/**
+ * Get the right icon object of the slider object
+ *
+ * @param obj The slider object
+ * @return The right icon object
+ *
+ * @ingroup Slider
+ */
+EAPI Evas_Object *
+elm_slider_right_icon_get(Evas_Object *obj)
+{
+       Widget_Data *wd = elm_widget_data_get(obj);
+       if (!wd) return NULL;
+       return wd->r_icon;
+}
+
+
+/**
+ * Set whether showing the number(indicator) or not.
+ *
+ * @param obj The slider object
+ * @param show 1 will show the number, 0 will not.
+ *
+ * @ingroup Slider
+ */
+EAPI void
+elm_slider_indicator_show_set(Evas_Object *obj, Eina_Bool show)
+{
+       Widget_Data *wd = elm_widget_data_get(obj);
+       if(show)
+               edje_object_signal_emit(wd->slider, "elm,state,val,show", "elm");
+       else
+               edje_object_signal_emit(wd->slider, "elm,state,val,hide", "elm");                       
+}
+
+
+
+static _mv_timer_cb(void *data)
+{
+       Evas_Object* obj = (Evas_Object*)data;
+       Widget_Data *wd = elm_widget_data_get(obj);
+       
+       if (!wd) return EINA_TRUE;
+       
+       if(wd->src_val < wd->des_val) {
+               wd->src_val += wd->mv_step;
+               if(wd-> src_val > wd->des_val)  
+                       wd->src_val = wd->des_val;
+       }       
+       
+       else if (wd->src_val > wd->des_val) {
+               wd->src_val -= wd->mv_step;
+               if(wd->src_val < wd->des_val)   
+                       wd->src_val = wd->des_val;
+       }       
+               
+       elm_slider_value_set(obj, wd->src_val);
+       evas_object_smart_callback_call(obj, "changed", NULL);
+
+       if (wd->val == wd->des_val ) {
+               if(wd->mv_timer){
+                       ecore_timer_del(wd->mv_timer);
+                       wd->mv_timer = NULL;
+               }       
+               return EINA_FALSE;
+       }
+       else
+               return EINA_TRUE;
+}
+
+
+/**
+ * Move the thumb to the specified value.
+ *
+ * This is different with elm_slider_value_set() in animated moving. 
+ * 
+ * @param obj The slider object
+ * @param val thumb's destination value.
+ *
+ * @ingroup Slider
+ */
+EAPI void
+elm_slider_value_animated_set(Evas_Object *obj, double val)
+{
+       Widget_Data *wd = elm_widget_data_get(obj);
+       
+       if (wd->val == val) return;
+       
+       wd->src_val = wd->val;
+       wd->des_val = val;
+       if (wd->des_val < wd->val_min) wd->des_val = wd->val_min;       
+       if (wd->des_val > wd->val_max) wd->des_val = wd->val_max;
+
+       if(wd->mv_timer){
+               ecore_timer_del(wd->mv_timer);
+               wd->mv_timer = NULL;
+       }
+       
+       wd->mv_timer = ecore_timer_add(0.005, _mv_timer_cb, obj);       
+}
+
+