elementary / calendar, button, colorselector, bg, cnp_helper, bubble, check, box...
authorhermet <hermet@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 1 Apr 2011 11:35:07 +0000 (11:35 +0000)
committerhermet <hermet@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 1 Apr 2011 11:35:07 +0000 (11:35 +0000)
git-svn-id: https://svn.enlightenment.org/svn/e/trunk/elementary@58253 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/elm_bg.c
src/lib/elm_box.c
src/lib/elm_bubble.c
src/lib/elm_button.c
src/lib/elm_calendar.c
src/lib/elm_check.c
src/lib/elm_clock.c
src/lib/elm_cnp_helper.c
src/lib/elm_colorselector.c

index d35f495..9c2bef8 100644 (file)
@@ -49,7 +49,7 @@ _theme_hook(Evas_Object *obj)
    if (wd->overlay)
      edje_object_part_swallow(wd->base, "elm.swallow.content", wd->overlay);
 
-// FIXME: if i don't do this, bg doesnt calc correctly. why?   
+   // FIXME: if i don't do this, bg doesnt calc correctly. why?   
    evas_object_geometry_get(wd->base, NULL, NULL, &w, &h);
    evas_object_resize(wd->base, w, h);
 }
@@ -83,33 +83,33 @@ _custom_resize(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void
    switch (wd->option) 
      {
       case ELM_BG_OPTION_CENTER:
-        fw = nw = iw;
-        fh = nh = ih;
-        nx = ((bw - fw) / 2);
-        ny = ((bh - fh) / 2);
-        mw = iw;
-        mh = ih;
-        break;
+         fw = nw = iw;
+         fh = nh = ih;
+         nx = ((bw - fw) / 2);
+         ny = ((bh - fh) / 2);
+         mw = iw;
+         mh = ih;
+         break;
       case ELM_BG_OPTION_SCALE:
-        fw = bw;
-        fh = ((ih * fw) / iw);
-        if (fh < bh)
-          {
-             fh = bh;
-             fw = ((iw * fh) / ih);
-          }
-        fx = ((bw - fw) / 2);
-        fy = ((bh - fh) / 2);
-        break;
+         fw = bw;
+         fh = ((ih * fw) / iw);
+         if (fh < bh)
+           {
+              fh = bh;
+              fw = ((iw * fh) / ih);
+           }
+         fx = ((bw - fw) / 2);
+         fy = ((bh - fh) / 2);
+         break;
       case ELM_BG_OPTION_TILE:
-        fw = iw;
-        fh = ih;
-        break;
+         fw = iw;
+         fh = ih;
+         break;
       case ELM_BG_OPTION_STRETCH:
       default:
-        fw = bw;
-        fh = bh;
-        break;
+         fw = bw;
+         fh = bh;
+         break;
      }
 
    evas_object_move(wd->img, nx, ny);
@@ -136,7 +136,7 @@ elm_bg_add(Evas_Object *parent)
    Widget_Data *wd;
 
    ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
-   
+
    ELM_SET_WIDTYPE(widtype, "bg");
    elm_widget_type_set(obj, "bg");
    elm_widget_sub_object_add(parent, obj);
@@ -203,7 +203,7 @@ elm_bg_file_set(Evas_Object *obj, const char *file, const char *group)
      {
         wd->img = evas_object_image_add(evas_object_evas_get(wd->base));
         if ((wd->load_opts.w > 0) && (wd->load_opts.h > 0))
-           evas_object_image_load_size_set(wd->img, wd->load_opts.w, wd->load_opts.h);
+          evas_object_image_load_size_set(wd->img, wd->load_opts.w, wd->load_opts.h);
         evas_object_image_file_set(wd->img, file, group);
      }
    evas_object_repeat_events_set(wd->img, EINA_TRUE);
@@ -340,8 +340,8 @@ elm_bg_overlay_set(Evas_Object *obj, Evas_Object *overlay)
    if (!wd) return;
    if (wd->overlay)
      {
-       evas_object_del(wd->overlay);
-       wd->overlay = NULL;
+        evas_object_del(wd->overlay);
+        wd->overlay = NULL;
      }
    if (overlay)
      {
@@ -419,6 +419,6 @@ elm_bg_load_size_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
    wd->load_opts.h = h;
    if (!wd->img) return;
    if (!(((p = strrchr(wd->file, '.'))) && (!strcasecmp(p, ".edj"))))
-      evas_object_image_load_size_set(wd->img, w, h);
+     evas_object_image_load_size_set(wd->img, w, h);
 }
 
index ae2f61d..a3e8a9d 100644 (file)
@@ -40,11 +40,11 @@ struct _Elm_Box_Transition
    Ecore_Animator *animator;
 
    struct
-   {
-      Evas_Object_Box_Layout layout;
-      void *data;
-      void(*free_data)(void *data);
-   } start, end;
+     {
+        Evas_Object_Box_Layout layout;
+        void *data;
+        void(*free_data)(void *data);
+     } start, end;
 
    void(*transition_end_cb)(void *data);
    void *transition_end_data;
@@ -57,9 +57,9 @@ struct _Transition_Animation_Data
 {
    Evas_Object *obj;
    struct
-   {
-      Evas_Coord x, y, w, h;
-   } start, end;
+     {
+        Evas_Coord x, y, w, h;
+     } start, end;
 };
 
 static const char *widtype = NULL;
@@ -71,11 +71,11 @@ static void _sub_del(void *data, Evas_Object *obj, void *event_info);
 static void
 _del_pre_hook(Evas_Object *obj)
 {
-    Widget_Data *wd = elm_widget_data_get(obj);
+   Widget_Data *wd = elm_widget_data_get(obj);
    if (!wd) return;
-    evas_object_event_callback_del_full
-        (wd->box, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj);
-    evas_object_box_remove_all(wd->box, 0);
+   evas_object_event_callback_del_full
+      (wd->box, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj);
+   evas_object_box_remove_all(wd->box, 0);
 }
 
 static void
@@ -166,7 +166,7 @@ _layout(Evas_Object *o, Evas_Object_Box_Data *priv, void *data)
    Widget_Data *wd = elm_widget_data_get(obj);
    if (!wd) return;
    _els_box_layout(o, priv, wd->horizontal, wd->homogeneous,
-         elm_widget_mirrored_get(obj));
+                   elm_widget_mirrored_get(obj));
 }
 
 static Eina_Bool
@@ -226,7 +226,7 @@ _transition_layout_calculate_coords(Evas_Object *obj, Evas_Object_Box_Data *priv
    const double curtime = ecore_loop_time_get();
 
    layout_data->duration = 
-     layout_data->duration - (curtime - layout_data->initial_time);
+      layout_data->duration - (curtime - layout_data->initial_time);
    layout_data->initial_time = curtime;
 
    evas_object_geometry_get(obj, &x, &y, &w, &h);
@@ -256,7 +256,7 @@ _transition_layout_load_children_list(Evas_Object_Box_Data *priv,
    Transition_Animation_Data *tad;
 
    EINA_LIST_FREE(layout_data->objs, tad)
-     free(tad);
+      free(tad);
 
    EINA_LIST_FOREACH(priv->children, l, opt)
      {
@@ -264,7 +264,7 @@ _transition_layout_load_children_list(Evas_Object_Box_Data *priv,
         if (!tad)
           {
              EINA_LIST_FREE(layout_data->objs, tad)
-               free(tad);
+                free(tad);
              layout_data->objs = NULL;
              return EINA_FALSE;
           }
@@ -283,7 +283,7 @@ _transition_layout_animation_start(Evas_Object *obj, Evas_Object_Box_Data *priv,
    layout_data->initial_time = ecore_loop_time_get();
 
    if (!_transition_layout_load_children_list(priv, layout_data))
-      return EINA_FALSE;
+     return EINA_FALSE;
    _transition_layout_calculate_coords(obj, priv, layout_data);
 
    evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, 
@@ -293,7 +293,7 @@ _transition_layout_animation_start(Evas_Object *obj, Evas_Object_Box_Data *priv,
    evas_object_smart_callback_add(obj, SIG_CHILD_REMOVED, 
                                   _transition_layout_child_removed, layout_data);
    if (!layout_data->animator)
-      layout_data->animator = ecore_animator_add(transition_animation_cb, obj);
+     layout_data->animator = ecore_animator_add(transition_animation_cb, obj);
    layout_data->animation_ended = EINA_FALSE;
    return EINA_TRUE;
 }
@@ -309,7 +309,7 @@ _transition_layout_animation_stop(Elm_Box_Transition *layout_data)
      }
 
    if (layout_data->transition_end_cb)
-      layout_data->transition_end_cb(layout_data->transition_end_data);
+     layout_data->transition_end_cb(layout_data->transition_end_data);
 }
 
 static void
@@ -352,7 +352,7 @@ elm_box_add(Evas_Object *parent)
    Widget_Data *wd;
 
    ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
-   
+
    ELM_SET_WIDTYPE(widtype, "box");
    elm_widget_type_set(obj, "box");
    elm_widget_sub_object_add(parent, obj);
@@ -366,11 +366,11 @@ elm_box_add(Evas_Object *parent)
 
    wd->box = evas_object_box_add(e);
    /*evas_object_box_layout_set(wd->box, evas_object_box_layout_vertical,
-                             NULL, NULL);*/
+     NULL, NULL);*/
    evas_object_box_layout_set(wd->box, _layout, obj, NULL);
 
    evas_object_event_callback_add(wd->box, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
-                                 _changed_size_hints, obj);
+                                  _changed_size_hints, obj);
    elm_widget_resize_object_set(obj, wd->box);
 
    evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
@@ -400,21 +400,21 @@ elm_box_horizontal_set(Evas_Object *obj, Eina_Bool horizontal)
    evas_object_smart_calculate(wd->box);
    /*if (wd->horizontal)
      {
-       if (wd->homogeneous)
-         evas_object_box_layout_set(wd->box,
-               evas_object_box_layout_homogeneous_horizontal, NULL, NULL);
-       else
-         evas_object_box_layout_set(wd->box, evas_object_box_layout_horizontal,
-                                    NULL, NULL);
+     if (wd->homogeneous)
+     evas_object_box_layout_set(wd->box,
+     evas_object_box_layout_homogeneous_horizontal, NULL, NULL);
+     else
+     evas_object_box_layout_set(wd->box, evas_object_box_layout_horizontal,
+     NULL, NULL);
      }
-   else
+     else
      {
-       if (wd->homogeneous)
-         evas_object_box_layout_set(wd->box,
-               evas_object_box_layout_homogeneous_vertical, NULL, NULL);
-       else
-         evas_object_box_layout_set(wd->box, evas_object_box_layout_horizontal,
-                                    NULL, NULL);
+     if (wd->homogeneous)
+     evas_object_box_layout_set(wd->box,
+     evas_object_box_layout_homogeneous_vertical, NULL, NULL);
+     else
+     evas_object_box_layout_set(wd->box, evas_object_box_layout_horizontal,
+     NULL, NULL);
      }*/
 }
 
@@ -456,21 +456,21 @@ elm_box_homogenous_set(Evas_Object *obj, Eina_Bool homogenous)
    evas_object_smart_calculate(wd->box);
    /*if (wd->horizontal)
      {
-       if (wd->homogeneous)
-         evas_object_box_layout_set(wd->box,
-               evas_object_box_layout_homogeneous_horizontal, NULL, NULL);
-       else
-         evas_object_box_layout_set(wd->box, evas_object_box_layout_horizontal,
-                                    NULL, NULL);
+     if (wd->homogeneous)
+     evas_object_box_layout_set(wd->box,
+     evas_object_box_layout_homogeneous_horizontal, NULL, NULL);
+     else
+     evas_object_box_layout_set(wd->box, evas_object_box_layout_horizontal,
+     NULL, NULL);
      }
-   else
+     else
      {
-       if (wd->homogeneous)
-         evas_object_box_layout_set(wd->box,
-               evas_object_box_layout_homogeneous_vertical, NULL, NULL);
-       else
-         evas_object_box_layout_set(wd->box, evas_object_box_layout_horizontal,
-                                    NULL, NULL);
+     if (wd->homogeneous)
+     evas_object_box_layout_set(wd->box,
+     evas_object_box_layout_homogeneous_vertical, NULL, NULL);
+     else
+     evas_object_box_layout_set(wd->box, evas_object_box_layout_horizontal,
+     NULL, NULL);
      }*/
 }
 
@@ -703,15 +703,15 @@ elm_box_layout_transition(Evas_Object *obj, Evas_Object_Box_Data *priv, void *da
 
    if (box_data->animation_ended)
      {
-          box_data->end.layout(obj, priv, box_data->end.data);
-          return;
+        box_data->end.layout(obj, priv, box_data->end.data);
+        return;
      }
 
    if (!box_data->animator)
      {
         if (!_transition_layout_animation_start(obj, priv, box_data,
-            _transition_animation))
-           return;
+                                                _transition_animation))
+          return;
      }
    else
      {
@@ -723,9 +723,9 @@ elm_box_layout_transition(Evas_Object *obj, Evas_Object_Box_Data *priv, void *da
      }
 
    if ((curtime >= box_data->duration + box_data->initial_time))
-      _transition_layout_animation_stop(box_data);
+     _transition_layout_animation_stop(box_data);
    else
-      _transition_layout_animation_exec(obj, priv, box_data, curtime);
+     _transition_layout_animation_exec(obj, priv, box_data, curtime);
 }
 
 /**
@@ -751,12 +751,12 @@ elm_box_layout_transition(Evas_Object *obj, Evas_Object_Box_Data *priv, void *da
  */
 EAPI Elm_Box_Transition *
 elm_box_transition_new(const double duration,
-      Evas_Object_Box_Layout start_layout, void *start_layout_data,
-      void(*start_layout_free_data)(void *data),
-      Evas_Object_Box_Layout end_layout, void *end_layout_data,
-      void(*end_layout_free_data)(void *data),
-      void(*transition_end_cb)(void *data),
-      void *transition_end_data)
+                       Evas_Object_Box_Layout start_layout, void *start_layout_data,
+                       void(*start_layout_free_data)(void *data),
+                       Evas_Object_Box_Layout end_layout, void *end_layout_data,
+                       void(*end_layout_free_data)(void *data),
+                       void(*transition_end_cb)(void *data),
+                       void *transition_end_data)
 {
    Elm_Box_Transition *box_data;
 
@@ -765,7 +765,7 @@ elm_box_transition_new(const double duration,
 
    box_data = calloc(1, sizeof(Elm_Box_Transition));
    if (!box_data)
-      return NULL;
+     return NULL;
 
    box_data->start.layout = start_layout;
    box_data->start.data = start_layout_data;
@@ -797,9 +797,9 @@ elm_box_transition_free(void *data)
    Transition_Animation_Data *tad;
    Elm_Box_Transition *box_data = data;
    if ((box_data->start.free_data) && (box_data->start.data))
-      box_data->start.free_data(box_data->start.data);
+     box_data->start.free_data(box_data->start.data);
    if ((box_data->end.free_data) && (box_data->end.data))
-      box_data->end.free_data(box_data->end.data);
+     box_data->end.free_data(box_data->end.data);
    EINA_LIST_FREE(box_data->objs, tad)
       free(tad);
    evas_object_event_callback_del(box_data->box, EVAS_CALLBACK_RESIZE, _transition_layout_obj_resize_cb);
index 4564ffd..26e11af 100644 (file)
@@ -32,8 +32,8 @@ static void _sub_del(void *data, Evas_Object *obj, void *event_info);
 #define SIG_CLICKED "clicked"
 static const Evas_Smart_Cb_Description _signals[] =
 {
-  {SIG_CLICKED, ""},
-  {NULL, NULL}
+     {SIG_CLICKED, ""},
+     {NULL, NULL}
 };
 
 static void
@@ -73,7 +73,7 @@ _theme_hook(Evas_Object *obj)
    if (wd->content)
      {
         edje_object_part_swallow(wd->bbl, "elm.swallow.content", wd->content);
-       edje_object_message_signal_process(wd->bbl);
+        edje_object_message_signal_process(wd->bbl);
      }
    if (wd->icon)
      edje_object_signal_emit(wd->bbl, "elm,state,icon,visible", "elm");
@@ -126,13 +126,13 @@ _sub_del(void *data __UNUSED__, Evas_Object *obj, void *event_info)
    Evas_Object *sub = event_info;
    if (!wd) return;
    evas_object_event_callback_del_full(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
-                                  _changed_size_hints, obj);
+                                       _changed_size_hints, obj);
    if (sub == wd->content) wd->content = NULL;
    else if (sub == wd->icon)
      {
-       edje_object_signal_emit(wd->bbl, "elm,state,icon,hidden", "elm");
-       wd->icon = NULL;
-       edje_object_message_signal_process(wd->bbl);
+        edje_object_signal_emit(wd->bbl, "elm,state,icon,hidden", "elm");
+        wd->icon = NULL;
+        edje_object_message_signal_process(wd->bbl);
      }
    _sizing_eval(obj);
 }
@@ -164,7 +164,7 @@ elm_bubble_add(Evas_Object *parent)
    Widget_Data *wd;
 
    ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
-   
+
    ELM_SET_WIDTYPE(widtype, "bubble");
    elm_widget_type_set(obj, "bubble");
    elm_widget_sub_object_add(parent, obj);
@@ -310,10 +310,10 @@ elm_bubble_content_set(Evas_Object *obj, Evas_Object *content)
    wd->content = content;
    if (content)
      {
-       elm_widget_sub_object_add(obj, content);
-       evas_object_event_callback_add(content, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
-                                      _changed_size_hints, obj);
-       edje_object_part_swallow(wd->bbl, "elm.swallow.content", content);
+        elm_widget_sub_object_add(obj, content);
+        evas_object_event_callback_add(content, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+                                       _changed_size_hints, obj);
+        edje_object_part_swallow(wd->bbl, "elm.swallow.content", content);
      }
    _sizing_eval(obj);
 }
@@ -385,12 +385,12 @@ elm_bubble_icon_set(Evas_Object *obj, Evas_Object *icon)
    wd->icon = icon;
    if (icon)
      {
-       elm_widget_sub_object_add(obj, icon);
-       edje_object_part_swallow(wd->bbl, "elm.swallow.icon", icon);
-       evas_object_event_callback_add(icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
-                                      _changed_size_hints, obj);
-       edje_object_signal_emit(wd->bbl, "elm,state,icon,visible", "elm");
-       edje_object_message_signal_process(wd->bbl);
+        elm_widget_sub_object_add(obj, icon);
+        edje_object_part_swallow(wd->bbl, "elm.swallow.icon", icon);
+        evas_object_event_callback_add(icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+                                       _changed_size_hints, obj);
+        edje_object_signal_emit(wd->bbl, "elm,state,icon,visible", "elm");
+        edje_object_message_signal_process(wd->bbl);
      }
    _sizing_eval(obj);
 }
index 88ca7db..f5b8c5f 100644 (file)
@@ -307,7 +307,7 @@ elm_button_add(Evas_Object *parent)
    Widget_Data *wd;
 
    ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
-   
+
    ELM_SET_WIDTYPE(widtype, "button");
    elm_widget_type_set(obj, "button");
    elm_widget_sub_object_add(parent, obj);
index 79941bd..15848ff 100644 (file)
@@ -27,9 +27,9 @@
 
 typedef enum _Day_Color // EINA_DEPRECATED
 {
-  DAY_WEEKDAY = 0,
-  DAY_SATURDAY = 1,
-  DAY_SUNDAY = 2
+   DAY_WEEKDAY = 0,
+   DAY_SATURDAY = 1,
+   DAY_SUNDAY = 2
 } Day_Color;
 
 typedef struct _Widget_Data Widget_Data;
@@ -72,8 +72,8 @@ static const char *_days_abbrev[] =
 
 static int _days_in_month[2][12] =
 {
-   {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},
-   {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}
+     {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},
+     {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}
 };
 
 static Elm_Calendar_Mark *
@@ -119,10 +119,10 @@ _maxdays_get(struct tm *time)
    month = time->tm_mon;
    year = time->tm_year + 1900;
 
-   return _days_in_month[((!(year % 4)) && 
-                          ((!(year % 400)) || 
-                              (year % 100)))]
-                        [month];
+   return _days_in_month[((!(year % 4)) &&
+                          ((!(year % 400)) ||
+                           (year % 100)))]
+      [month];
 }
 
 static inline void
@@ -186,22 +186,22 @@ static void
 _text_day_color_update(Widget_Data *wd, int pos)
 {
    char emission[32];
-  
+
    switch (wd->day_color[pos])
-    {
-    case DAY_WEEKDAY:
-      snprintf(emission, sizeof(emission), "cit_%i,weekday", pos);
-      break;
-    case DAY_SATURDAY:
-      snprintf(emission, sizeof(emission), "cit_%i,saturday", pos);
-      break;
-    case DAY_SUNDAY:
-      snprintf(emission, sizeof(emission), "cit_%i,sunday", pos);
-      break;
-    default:
-      return;
-    }
-  
+     {
+      case DAY_WEEKDAY:
+         snprintf(emission, sizeof(emission), "cit_%i,weekday", pos);
+         break;
+      case DAY_SATURDAY:
+         snprintf(emission, sizeof(emission), "cit_%i,saturday", pos);
+         break;
+      case DAY_SUNDAY:
+         snprintf(emission, sizeof(emission), "cit_%i,sunday", pos);
+         break;
+      default:
+         return;
+     }
+
    edje_object_signal_emit(wd->calendar, emission, "elm");
 }
 
@@ -239,8 +239,8 @@ _populate(Evas_Object *obj)
    buf = wd->format_func(&wd->selected_time);
    if (buf)
      {
-       edje_object_part_text_set(wd->calendar, "month_text", buf);
-       free(buf);
+        edje_object_part_text_set(wd->calendar, "month_text", buf);
+        free(buf);
      }
    else
      edje_object_part_text_set(wd->calendar, "month_text", "");
@@ -253,129 +253,129 @@ _populate(Evas_Object *obj)
 
    // Layout of the calendar is changed for removing the unfilled last row.
    wd->first_day_it = first_day.tm_wday;
-  
-  if ((35 - wd->first_day_it) > (maxdays - 1)) last_row = EINA_FALSE;
-  
-  if (!last_row)
-    {
-      char emission[32];
-      
-      for (i = 0; i < 5; i++)
-        {
-          snprintf(emission, sizeof(emission), "cseph_%i,row_hide", i);
-          edje_object_signal_emit(wd->calendar, emission, "elm");
-        }
-      snprintf(emission, sizeof(emission), "cseph_%i,row_invisible", 5);
-      edje_object_signal_emit(wd->calendar, emission, "elm");
-      for (i = 0; i < 35; i++)
-        {
-          snprintf(emission, sizeof(emission), "cit_%i,cell_expanded", i);
-          edje_object_signal_emit(wd->calendar, emission, "elm");
-        }
-      for (i = 35; i < 42; i++)
-        {
-          snprintf(emission, sizeof(emission), "cit_%i,cell_invisible", i);
-          edje_object_signal_emit(wd->calendar, emission, "elm");
-        }
-    }
-  else
-    {
-      char emission[32];
-      
-      for (i = 0; i < 6; i++)
-        {
-          snprintf(emission, sizeof(emission), "cseph_%i,row_show", i);
-          edje_object_signal_emit(wd->calendar, emission, "elm");
-        }
-      for (i = 0; i < 42; i++)
-        {
-          snprintf(emission, sizeof(emission), "cit_%i,cell_default", i);
-          edje_object_signal_emit(wd->calendar, emission, "elm");
-        }
-    }
-  
+
+   if ((35 - wd->first_day_it) > (maxdays - 1)) last_row = EINA_FALSE;
+
+   if (!last_row)
+     {
+        char emission[32];
+
+        for (i = 0; i < 5; i++)
+          {
+             snprintf(emission, sizeof(emission), "cseph_%i,row_hide", i);
+             edje_object_signal_emit(wd->calendar, emission, "elm");
+          }
+        snprintf(emission, sizeof(emission), "cseph_%i,row_invisible", 5);
+        edje_object_signal_emit(wd->calendar, emission, "elm");
+        for (i = 0; i < 35; i++)
+          {
+             snprintf(emission, sizeof(emission), "cit_%i,cell_expanded", i);
+             edje_object_signal_emit(wd->calendar, emission, "elm");
+          }
+        for (i = 35; i < 42; i++)
+          {
+             snprintf(emission, sizeof(emission), "cit_%i,cell_invisible", i);
+             edje_object_signal_emit(wd->calendar, emission, "elm");
+          }
+     }
+   else
+     {
+        char emission[32];
+
+        for (i = 0; i < 6; i++)
+          {
+             snprintf(emission, sizeof(emission), "cseph_%i,row_show", i);
+             edje_object_signal_emit(wd->calendar, emission, "elm");
+          }
+        for (i = 0; i < 42; i++)
+          {
+             snprintf(emission, sizeof(emission), "cit_%i,cell_default", i);
+             edje_object_signal_emit(wd->calendar, emission, "elm");
+          }
+     }
+
    for (i = 0; i < 42; i++)
      {
         _text_day_color_update(wd, i); // EINA_DEPRECATED
-       if ((!day) && (i == first_day.tm_wday)) day = 1;
+        if ((!day) && (i == first_day.tm_wday)) day = 1;
 
-       if ((day == wd->current_time.tm_mday)
-             && (mon == wd->current_time.tm_mon)
-             && (year == wd->current_time.tm_year))
-         _today(wd, i);
+        if ((day == wd->current_time.tm_mday)
+            && (mon == wd->current_time.tm_mon)
+            && (year == wd->current_time.tm_year))
+          _today(wd, i);
 
-       if (day == wd->selected_time.tm_mday)
-         {
-            if ((wd->selected_it > -1) && (wd->selected_it != i))
-              _unselect(wd, wd->selected_it);
+        if (day == wd->selected_time.tm_mday)
+          {
+             if ((wd->selected_it > -1) && (wd->selected_it != i))
+               _unselect(wd, wd->selected_it);
 
-            if (wd->selection_enabled) _select(wd, i);
+             if (wd->selection_enabled) _select(wd, i);
 
-            wd->selected_it = i;
-         }
+             wd->selected_it = i;
+          }
 
-       if ((day) && (day <= maxdays))
-         snprintf(day_s, sizeof(day_s), "%i", day++);
-       else
+        if ((day) && (day <= maxdays))
+          snprintf(day_s, sizeof(day_s), "%i", day++);
+        else
           day_s[0] = 0;
 
-       snprintf(part, sizeof(part), "cit_%i.text", i);
-       edje_object_part_text_set(wd->calendar, part, day_s);
-       /* Clear previous marks */
-       _cit_mark(wd->calendar, i, "clear");
+        snprintf(part, sizeof(part), "cit_%i.text", i);
+        edje_object_part_text_set(wd->calendar, part, day_s);
+        /* Clear previous marks */
+        _cit_mark(wd->calendar, i, "clear");
      }
 
    /* Set marks */
    EINA_LIST_FOREACH(wd->marks, l, mark)
      {
-       struct tm *mtime = &mark->mark_time;
-       int mon = wd->selected_time.tm_mon;
-       int year = wd->selected_time.tm_year;
-       int mday_it = mtime->tm_mday + wd->first_day_it - 1;
-
-       switch (mark->repeat)
-         {
-          case ELM_CALENDAR_UNIQUE:
-             if ((mtime->tm_mon == mon) && (mtime->tm_year == year))
-               _cit_mark(wd->calendar, mday_it, mark->mark_type);
-             break;
-          case ELM_CALENDAR_DAILY:
-             if (((mtime->tm_year == year) && (mtime->tm_mon < mon)) ||
-                   (mtime->tm_year < year))
-               day = 1;
-             else if ((mtime->tm_year == year) && (mtime->tm_mon == mon))
-               day = mtime->tm_mday;
-             else
-               break;
-             for (; day <= maxdays; day++)
-               _cit_mark(wd->calendar, day + wd->first_day_it - 1,
-                     mark->mark_type);
-             break;
-          case ELM_CALENDAR_WEEKLY:
-             if (((mtime->tm_year == year) && (mtime->tm_mon < mon)) ||
-                   (mtime->tm_year < year))
-               day = 1;
-             else if ((mtime->tm_year == year) && (mtime->tm_mon == mon))
-               day = mtime->tm_mday;
-             else
-               break;
-             for (; day <= maxdays; day++)
-               if (mtime->tm_wday == _weekday_get(wd->first_day_it, day))
-                 _cit_mark(wd->calendar, day + wd->first_day_it - 1,
-                       mark->mark_type);
-             break;
-          case ELM_CALENDAR_MONTHLY:
-             if (((mtime->tm_year < year) ||
-                      ((mtime->tm_year == year) && (mtime->tm_mon <= mon))) &&
-                   (mtime->tm_mday <= maxdays))
-               _cit_mark(wd->calendar, mday_it, mark->mark_type);
-             break;
-          case ELM_CALENDAR_ANNUALLY:
-             if ((mtime->tm_year <= year) && (mtime->tm_mon == mon) &&
-                   (mtime->tm_mday <= maxdays))
-               _cit_mark(wd->calendar, mday_it, mark->mark_type);
-             break;
-         }
+        struct tm *mtime = &mark->mark_time;
+        int mon = wd->selected_time.tm_mon;
+        int year = wd->selected_time.tm_year;
+        int mday_it = mtime->tm_mday + wd->first_day_it - 1;
+
+        switch (mark->repeat)
+          {
+           case ELM_CALENDAR_UNIQUE:
+              if ((mtime->tm_mon == mon) && (mtime->tm_year == year))
+                _cit_mark(wd->calendar, mday_it, mark->mark_type);
+              break;
+           case ELM_CALENDAR_DAILY:
+              if (((mtime->tm_year == year) && (mtime->tm_mon < mon)) ||
+                  (mtime->tm_year < year))
+                day = 1;
+              else if ((mtime->tm_year == year) && (mtime->tm_mon == mon))
+                day = mtime->tm_mday;
+              else
+                break;
+              for (; day <= maxdays; day++)
+                _cit_mark(wd->calendar, day + wd->first_day_it - 1,
+                          mark->mark_type);
+              break;
+           case ELM_CALENDAR_WEEKLY:
+              if (((mtime->tm_year == year) && (mtime->tm_mon < mon)) ||
+                  (mtime->tm_year < year))
+                day = 1;
+              else if ((mtime->tm_year == year) && (mtime->tm_mon == mon))
+                day = mtime->tm_mday;
+              else
+                break;
+              for (; day <= maxdays; day++)
+                if (mtime->tm_wday == _weekday_get(wd->first_day_it, day))
+                  _cit_mark(wd->calendar, day + wd->first_day_it - 1,
+                            mark->mark_type);
+              break;
+           case ELM_CALENDAR_MONTHLY:
+              if (((mtime->tm_year < year) ||
+                   ((mtime->tm_year == year) && (mtime->tm_mon <= mon))) &&
+                  (mtime->tm_mday <= maxdays))
+                _cit_mark(wd->calendar, mday_it, mark->mark_type);
+              break;
+           case ELM_CALENDAR_ANNUALLY:
+              if ((mtime->tm_year <= year) && (mtime->tm_mon == mon) &&
+                  (mtime->tm_mday <= maxdays))
+                _cit_mark(wd->calendar, mday_it, mark->mark_type);
+              break;
+          }
      }
 }
 
@@ -389,8 +389,8 @@ _set_headers(Evas_Object *obj)
 
    for (i = 0; i < 7; i++)
      {
-       part[3] = i + '0';
-       edje_object_part_text_set(wd->calendar, part, wd->weekdays[i]);
+        part[3] = i + '0';
+        edje_object_part_text_set(wd->calendar, part, wd->weekdays[i]);
      }
 }
 
@@ -408,10 +408,10 @@ _del_hook(Evas_Object *obj)
 
    if (wd->marks)
      {
-       EINA_LIST_FREE(wd->marks, mark)
-         {
-           _mark_free(mark);
-         }
+        EINA_LIST_FREE(wd->marks, mark)
+          {
+             _mark_free(mark);
+          }
      }
 
    for (i = 0; i < 7; i++)
@@ -427,13 +427,13 @@ _on_focus_hook(void *data __UNUSED__, Evas_Object *obj)
    if (!wd) return;
    if (elm_widget_focus_get(obj))
      {
-       edje_object_signal_emit(wd->calendar, "elm,action,focus", "elm");
-       evas_object_focus_set(wd->calendar, EINA_TRUE);
+        edje_object_signal_emit(wd->calendar, "elm,action,focus", "elm");
+        evas_object_focus_set(wd->calendar, EINA_TRUE);
      }
    else
      {
-       edje_object_signal_emit(wd->calendar, "elm,action,unfocus", "elm");
-       evas_object_focus_set(wd->calendar, EINA_FALSE);
+        edje_object_signal_emit(wd->calendar, "elm,action,unfocus", "elm");
+        evas_object_focus_set(wd->calendar, EINA_FALSE);
      }
 }
 
@@ -512,23 +512,23 @@ _update_month(Evas_Object *obj, int delta)
    wd->selected_time.tm_mon += delta;
    if (wd->selected_time.tm_mon < 0)
      {
-       if (wd->selected_time.tm_year == wd->year_min)
-         {
-            wd->selected_time.tm_mon++;
-            return EINA_FALSE;
-         }
-       wd->selected_time.tm_mon = 11;
-       wd->selected_time.tm_year--;
+        if (wd->selected_time.tm_year == wd->year_min)
+          {
+             wd->selected_time.tm_mon++;
+             return EINA_FALSE;
+          }
+        wd->selected_time.tm_mon = 11;
+        wd->selected_time.tm_year--;
      }
    else if (wd->selected_time.tm_mon > 11)
      {
-       if (wd->selected_time.tm_year == wd->year_max)
-         {
-            wd->selected_time.tm_mon--;
-            return EINA_FALSE;
-         }
-       wd->selected_time.tm_mon = 0;
-       wd->selected_time.tm_year++;
+        if (wd->selected_time.tm_year == wd->year_max)
+          {
+             wd->selected_time.tm_mon--;
+             return EINA_FALSE;
+          }
+        wd->selected_time.tm_mon = 0;
+        wd->selected_time.tm_year++;
      }
 
    maxdays = _maxdays_get(&wd->selected_time);
@@ -606,7 +606,7 @@ _update_sel_it(Evas_Object *obj, int sel_it)
    int day;
    Widget_Data *wd = elm_widget_data_get(obj);
    if ((!wd) || (!wd->selection_enabled))
-      return;
+     return;
 
    day = _get_item_day(obj, sel_it);
    if (!day)
@@ -627,7 +627,7 @@ _day_selected(void *data, Evas_Object *obj __UNUSED__, const char *emission __UN
    int sel_it;
    Widget_Data *wd = elm_widget_data_get(data);
    if ((!wd) || (!wd->selection_enabled))
-      return;
+     return;
    sel_it = atoi(source);
 
    _update_sel_it(data, sel_it);
@@ -636,7 +636,7 @@ _day_selected(void *data, Evas_Object *obj __UNUSED__, const char *emission __UN
 static inline int
 _time_to_next_day(struct tm *t)
 {
-  return ((((24 - t->tm_hour) * 60) - t->tm_min) * 60) - t->tm_sec;
+   return ((((24 - t->tm_hour) * 60) - t->tm_min) * 60) - t->tm_sec;
 }
 
 static Eina_Bool
@@ -655,7 +655,7 @@ _update_cur_date(void *data)
    ecore_timer_interval_set(wd->update_timer, t);
 
    if ((wd->current_time.tm_mon != wd->selected_time.tm_mon) ||
-        (wd->current_time.tm_year!= wd->selected_time.tm_year))
+       (wd->current_time.tm_year!= wd->selected_time.tm_year))
      return ECORE_CALLBACK_RENEW;
 
    day = wd->current_time.tm_mday + wd->first_day_it - 1;
@@ -729,7 +729,7 @@ elm_calendar_add(Evas_Object *parent)
    Evas *e;
 
    ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
-   
+
    ELM_SET_WIDTYPE(widtype, "calendar");
    elm_widget_type_set(obj, "calendar");
    elm_widget_sub_object_add(parent, obj);
@@ -781,7 +781,7 @@ elm_calendar_add(Evas_Object *parent)
              /* If we failed getting day, get a default value */
              wd->weekdays[i] = _days_abbrev[i];
              WRN("Failed getting weekday name for '%s' from locale.",
-                  _days_abbrev[i]);
+                 _days_abbrev[i]);
           }
         weekday += 86400; /* Advance by a day */
      }
@@ -1228,14 +1228,14 @@ elm_calendar_marks_draw(Evas_Object *obj)
 
 /**
  * Set a text color to the saturday color.
- * 
+ *
  * Deprecated. use elm_calendar_mark_add() instead like:
- * 
+ *
  * @code
  * struct tm t = { 0, 0, 12, 6, 0, 0, 5, 5, -1 };
  * elm_calendar_mark_add(obj, "sat", &t, ELM_CALENDAR_WEEKLY);
  * @endcode
- * 
+ *
  * @param obj The calendar object
  * @param pos The text position
  *
@@ -1244,22 +1244,22 @@ elm_calendar_marks_draw(Evas_Object *obj)
 EINA_DEPRECATED EAPI void
 elm_calendar_text_saturday_color_set(Evas_Object *obj, int pos)
 {
-  ELM_CHECK_WIDTYPE(obj, widtype);
-  Widget_Data *wd = elm_widget_data_get(obj);
-  if (!wd) return;
-  _text_day_color_set(wd, DAY_SATURDAY, pos);
+   ELM_CHECK_WIDTYPE(obj, widtype);
+   Widget_Data *wd = elm_widget_data_get(obj);
+   if (!wd) return;
+   _text_day_color_set(wd, DAY_SATURDAY, pos);
 }
 
 /**
  * Set a text color to the sunday color.
  *
  * Deprecated. use elm_calendar_mark_add() instead like:
- * 
+ *
  * @code
  * struct tm t = { 0, 0, 12, 7, 0, 0, 6, 6, -1 };
  * elm_calendar_mark_add(obj, "sun", &t, ELM_CALENDAR_WEEKLY);
  * @endcode
- * 
+ *
  * @param obj The calendar object
  * @param pos The text position
  *
@@ -1268,20 +1268,20 @@ elm_calendar_text_saturday_color_set(Evas_Object *obj, int pos)
 EINA_DEPRECATED EAPI void
 elm_calendar_text_sunday_color_set(Evas_Object *obj, int pos)
 {
-  ELM_CHECK_WIDTYPE(obj, widtype);
-  Widget_Data *wd = elm_widget_data_get(obj);
-  if (!wd) return;
-  _text_day_color_set(wd, DAY_SUNDAY, pos);
+   ELM_CHECK_WIDTYPE(obj, widtype);
+   Widget_Data *wd = elm_widget_data_get(obj);
+   if (!wd) return;
+   _text_day_color_set(wd, DAY_SUNDAY, pos);
 }
 
 /**
  * Set a text color to the weekday color.
  *
  * Deprecated. use elm_calendar_mark_add() instead like:
- * 
+ *
  * @code
  * struct tm t = { 0, 0, 12, 1, 0, 0, 0, 0, -1 };
- * 
+ *
  * elm_calendar_mark_add(obj, "week", &t, ELM_CALENDAR_WEEKLY); // monday
  * t.tm_tm_mday++; t.tm_wday++; t.tm_yday++;
  * elm_calendar_mark_add(obj, "week", &t, ELM_CALENDAR_WEEKLY); // tuesday
@@ -1292,7 +1292,7 @@ elm_calendar_text_sunday_color_set(Evas_Object *obj, int pos)
  * t.tm_tm_mday++; t.tm_wday++; t.tm_yday++;
  * elm_calendar_mark_add(obj, "week", &t, ELM_CALENDAR_WEEKLY); // friday
  * @endcode
- * 
+ *
  * @param obj The calendar object
  * @param pos The text position
  *
@@ -1301,8 +1301,8 @@ elm_calendar_text_sunday_color_set(Evas_Object *obj, int pos)
 EINA_DEPRECATED EAPI void
 elm_calendar_text_weekday_color_set(Evas_Object *obj, int pos)
 {
-  ELM_CHECK_WIDTYPE(obj, widtype);
-  Widget_Data *wd = elm_widget_data_get(obj);
-  if (!wd) return;
-  _text_day_color_set(wd, DAY_WEEKDAY, pos);
+   ELM_CHECK_WIDTYPE(obj, widtype);
+   Widget_Data *wd = elm_widget_data_get(obj);
+   if (!wd) return;
+   _text_day_color_set(wd, DAY_WEEKDAY, pos);
 }
index bc57cac..2a71003 100644 (file)
@@ -48,8 +48,8 @@ static Eina_Bool _event_hook(Evas_Object *obj, Evas_Object *src,
 
 static const char SIG_CHANGED[] = "changed";
 static const Evas_Smart_Cb_Description _signals[] = {
-  {SIG_CHANGED, ""},
-  {NULL, NULL}
+       {SIG_CHANGED, ""},
+       {NULL, NULL}
 };
 
 static Eina_Bool
@@ -85,13 +85,13 @@ _on_focus_hook(void *data __UNUSED__, Evas_Object *obj)
    if (!wd) return;
    if (elm_widget_focus_get(obj))
      {
-       edje_object_signal_emit(wd->chk, "elm,action,focus", "elm");
-       evas_object_focus_set(wd->chk, EINA_TRUE);
+        edje_object_signal_emit(wd->chk, "elm,action,focus", "elm");
+        evas_object_focus_set(wd->chk, EINA_TRUE);
      }
    else
      {
-       edje_object_signal_emit(wd->chk, "elm,action,unfocus", "elm");
-       evas_object_focus_set(wd->chk, EINA_FALSE);
+        edje_object_signal_emit(wd->chk, "elm,action,unfocus", "elm");
+        evas_object_focus_set(wd->chk, EINA_FALSE);
      }
 }
 
@@ -112,20 +112,20 @@ _theme_hook(Evas_Object *obj)
    _mirrored_set(obj, elm_widget_mirrored_get(obj));
    _elm_theme_object_set(obj, wd->chk, "check", "base", elm_widget_style_get(obj));
    if (wd->icon)
-      edje_object_signal_emit(wd->chk, "elm,state,icon,visible", "elm");
+     edje_object_signal_emit(wd->chk, "elm,state,icon,visible", "elm");
    else
-      edje_object_signal_emit(wd->chk, "elm,state,icon,hidden", "elm");
+     edje_object_signal_emit(wd->chk, "elm,state,icon,hidden", "elm");
    if (wd->state)
-      edje_object_signal_emit(wd->chk, "elm,state,check,on", "elm");
+     edje_object_signal_emit(wd->chk, "elm,state,check,on", "elm");
    else
-      edje_object_signal_emit(wd->chk, "elm,state,check,off", "elm");
+     edje_object_signal_emit(wd->chk, "elm,state,check,off", "elm");
    if (wd->label)
-      edje_object_signal_emit(wd->chk, "elm,state,text,visible", "elm");
+     edje_object_signal_emit(wd->chk, "elm,state,text,visible", "elm");
    else
-      edje_object_signal_emit(wd->chk, "elm,state,text,hidden", "elm");
+     edje_object_signal_emit(wd->chk, "elm,state,text,hidden", "elm");
    edje_object_part_text_set(wd->chk, "elm.text", wd->label);
    if (elm_widget_disabled_get(obj))
-      edje_object_signal_emit(wd->chk, "elm,state,disabled", "elm");
+     edje_object_signal_emit(wd->chk, "elm,state,disabled", "elm");
    edje_object_message_signal_process(wd->chk);
    edje_object_scale_set(wd->chk, elm_widget_scale_get(obj) * _elm_config->scale);
    _sizing_eval(obj);
@@ -137,9 +137,9 @@ _disable_hook(Evas_Object *obj)
    Widget_Data *wd = elm_widget_data_get(obj);
    if (!wd) return;
    if (elm_widget_disabled_get(obj))
-      edje_object_signal_emit(wd->chk, "elm,state,disabled", "elm");
+     edje_object_signal_emit(wd->chk, "elm,state,disabled", "elm");
    else
-      edje_object_signal_emit(wd->chk, "elm,state,enabled", "elm");
+     edje_object_signal_emit(wd->chk, "elm,state,enabled", "elm");
 }
 
 static void
@@ -174,12 +174,12 @@ _sub_del(void *data __UNUSED__, Evas_Object *obj, void *event_info)
    if (!wd) return;
    if (sub == wd->icon)
      {
-       edje_object_signal_emit(wd->chk, "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);
-       edje_object_message_signal_process(wd->chk);
+        edje_object_signal_emit(wd->chk, "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);
+        edje_object_message_signal_process(wd->chk);
      }
 }
 
@@ -247,7 +247,7 @@ elm_check_add(Evas_Object *parent)
    Widget_Data *wd;
 
    ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
-   
+
    ELM_SET_WIDTYPE(widtype, "check");
    elm_widget_type_set(obj, "check");
    elm_widget_sub_object_add(parent, obj);
@@ -345,12 +345,12 @@ elm_check_icon_set(Evas_Object *obj, Evas_Object *icon)
    wd->icon = icon;
    if (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_part_swallow(wd->chk, "elm.swallow.content", icon);
-       edje_object_signal_emit(wd->chk, "elm,state,icon,visible", "elm");
-       edje_object_message_signal_process(wd->chk);
+        elm_widget_sub_object_add(obj, icon);
+        evas_object_event_callback_add(icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+                                       _changed_size_hints, obj);
+        edje_object_part_swallow(wd->chk, "elm.swallow.content", icon);
+        edje_object_signal_emit(wd->chk, "elm,state,icon,visible", "elm");
+        edje_object_message_signal_process(wd->chk);
      }
    _sizing_eval(obj);
 }
@@ -415,12 +415,12 @@ elm_check_state_set(Evas_Object *obj, Eina_Bool state)
    if (!wd) return;
    if (state != wd->state)
      {
-       wd->state = state;
-       if (wd->statep) *wd->statep = wd->state;
-       if (wd->state)
-         edje_object_signal_emit(wd->chk, "elm,state,check,on", "elm");
-       else
-         edje_object_signal_emit(wd->chk, "elm,state,check,off", "elm");
+        wd->state = state;
+        if (wd->statep) *wd->statep = wd->state;
+        if (wd->state)
+          edje_object_signal_emit(wd->chk, "elm,state,check,on", "elm");
+        else
+          edje_object_signal_emit(wd->chk, "elm,state,check,off", "elm");
      }
 }
 
@@ -464,15 +464,15 @@ elm_check_state_pointer_set(Evas_Object *obj, Eina_Bool *statep)
    if (!wd) return;
    if (statep)
      {
-       wd->statep = statep;
-       if (*wd->statep != wd->state)
-         {
-            wd->state = *wd->statep;
-            if (wd->state)
-              edje_object_signal_emit(wd->chk, "elm,state,check,on", "elm");
-            else
-              edje_object_signal_emit(wd->chk, "elm,state,check,off", "elm");
-         }
+        wd->statep = statep;
+        if (*wd->statep != wd->state)
+          {
+             wd->state = *wd->statep;
+             if (wd->state)
+               edje_object_signal_emit(wd->chk, "elm,state,check,on", "elm");
+             else
+               edje_object_signal_emit(wd->chk, "elm,state,check,off", "elm");
+          }
      }
    else
      wd->statep = NULL;
index 6331db7..77c6bb3 100644 (file)
@@ -31,7 +31,7 @@ struct _Widget_Data
         Eina_Bool seconds : 1;
         Eina_Bool am_pm : 1;
         Eina_Bool edit : 1;
-       Elm_Clock_Digedit digedit;
+        Elm_Clock_Digedit digedit;
      } cur;
 };
 
@@ -52,7 +52,7 @@ _del_hook(Evas_Object *obj)
    int i;
    for (i = 0; i < 6; i++)
      {
-       if (wd->digit[i]) evas_object_del(wd->digit[i]);
+        if (wd->digit[i]) evas_object_del(wd->digit[i]);
      }
    if (wd->ampm) evas_object_del(wd->ampm);
    if (wd->ticker) ecore_timer_del(wd->ticker);
@@ -80,13 +80,13 @@ _on_focus_hook(void *data __UNUSED__, Evas_Object *obj)
    if (!wd) return;
    if (elm_widget_focus_get(obj))
      {
-       edje_object_signal_emit(wd->clk, "elm,action,focus", "elm");
-       evas_object_focus_set(wd->clk, EINA_TRUE);
+        edje_object_signal_emit(wd->clk, "elm,action,focus", "elm");
+        evas_object_focus_set(wd->clk, EINA_TRUE);
      }
    else
      {
-       edje_object_signal_emit(wd->clk, "elm,action,unfocus", "elm");
-       evas_object_focus_set(wd->clk, EINA_FALSE);
+        edje_object_signal_emit(wd->clk, "elm,action,unfocus", "elm");
+        evas_object_focus_set(wd->clk, EINA_FALSE);
      }
 }
 
@@ -99,8 +99,8 @@ _signal_emit_hook(Evas_Object *obj, const char *emission, const char *source)
    edje_object_signal_emit(wd->clk, emission, source);
    for (i = 0; i < 6; i++)
      {
-       if (wd->digit[i])
-         edje_object_signal_emit(wd->digit[i], emission, source);
+        if (wd->digit[i])
+          edje_object_signal_emit(wd->digit[i], emission, source);
      }
 }
 
@@ -113,9 +113,9 @@ _signal_callback_add_hook(Evas_Object *obj, const char *emission, const char *so
    edje_object_signal_callback_add(wd->clk, emission, source, func_cb, data);
    for (i = 0; i < 6; i++)
      {
-       if (wd->digit[i])
-         edje_object_signal_callback_add(wd->digit[i], emission, source,
-               func_cb, data);
+        if (wd->digit[i])
+          edje_object_signal_callback_add(wd->digit[i], emission, source,
+                                          func_cb, data);
      }
 }
 
@@ -126,7 +126,7 @@ _signal_callback_del_hook(Evas_Object *obj, const char *emission, const char *so
    int i;
    for (i = 0; i < 6; i++)
      {
-       edje_object_signal_callback_del_full(wd->digit[i], emission, source,
+        edje_object_signal_callback_del_full(wd->digit[i], emission, source,
                                              func_cb, data);
      }
    edje_object_signal_callback_del_full(wd->clk, emission, source, func_cb,
@@ -144,7 +144,7 @@ _timediff_set(Widget_Data *wd)
    tzset();
    tm = localtime(&tt);
    wd->timediff = (((wd->hrs - tm->tm_hour) * 60 +
-           wd->min - tm->tm_min) * 60) + wd->sec - tm->tm_sec;
+                    wd->min - tm->tm_min) * 60) + wd->sec - tm->tm_sec;
 }
 
 static Eina_Bool
@@ -161,16 +161,16 @@ _ticker(void *data)
    wd->ticker = ecore_timer_add(t, _ticker, data);
    if (!wd->edit)
      {
-       tt = (time_t)(timev.tv_sec) + wd->timediff;
-       tzset();
-       tm = localtime(&tt);
-       if (tm)
-         {
-            wd->hrs = tm->tm_hour;
-            wd->min = tm->tm_min;
-            wd->sec = tm->tm_sec;
-            _time_update(data);
-         }
+        tt = (time_t)(timev.tv_sec) + wd->timediff;
+        tzset();
+        tm = localtime(&tt);
+        if (tm)
+          {
+             wd->hrs = tm->tm_hour;
+             wd->min = tm->tm_min;
+             wd->sec = tm->tm_sec;
+             _time_update(data);
+          }
      }
    return ECORE_CALLBACK_CANCEL;
 }
@@ -184,38 +184,38 @@ _signal_clock_val_up(void *data)
    if (!wd->sel_obj) goto clock_val_up_cancel;
    if (wd->sel_obj == wd->digit[0])
      {
-       wd->hrs = wd->hrs + 10;
-       if (wd->hrs >= 24) wd->hrs -= 24;
+        wd->hrs = wd->hrs + 10;
+        if (wd->hrs >= 24) wd->hrs -= 24;
      }
    if (wd->sel_obj == wd->digit[1])
      {
-       wd->hrs = wd->hrs + 1;
-       if (wd->hrs >= 24) wd->hrs -= 24;
+        wd->hrs = wd->hrs + 1;
+        if (wd->hrs >= 24) wd->hrs -= 24;
      }
    if (wd->sel_obj == wd->digit[2])
      {
-       wd->min = wd->min + 10;
-       if (wd->min >= 60) wd->min -= 60;
+        wd->min = wd->min + 10;
+        if (wd->min >= 60) wd->min -= 60;
      }
    if (wd->sel_obj == wd->digit[3])
      {
-       wd->min = wd->min + 1;
-       if (wd->min >= 60) wd->min -= 60;
+        wd->min = wd->min + 1;
+        if (wd->min >= 60) wd->min -= 60;
      }
    if (wd->sel_obj == wd->digit[4])
      {
-       wd->sec = wd->sec + 10;
-       if (wd->sec >= 60) wd->sec -= 60;
+        wd->sec = wd->sec + 10;
+        if (wd->sec >= 60) wd->sec -= 60;
      }
    if (wd->sel_obj == wd->digit[5])
      {
-       wd->sec = wd->sec + 1;
-       if (wd->sec >= 60) wd->sec -= 60;
+        wd->sec = wd->sec + 1;
+        if (wd->sec >= 60) wd->sec -= 60;
      }
    if (wd->sel_obj == wd->ampm)
      {
-       wd->hrs = wd->hrs + 12;
-       if (wd->hrs > 23) wd->hrs -= 24;
+        wd->hrs = wd->hrs + 12;
+        if (wd->hrs > 23) wd->hrs -= 24;
      }
    wd->interval = wd->interval / 1.05;
    ecore_timer_interval_set(wd->spin, wd->interval);
@@ -237,38 +237,38 @@ _signal_clock_val_down(void *data)
    if (!wd->sel_obj) goto clock_val_down_cancel;
    if (wd->sel_obj == wd->digit[0])
      {
-       wd->hrs = wd->hrs - 10;
-       if (wd->hrs < 0) wd->hrs += 24;
+        wd->hrs = wd->hrs - 10;
+        if (wd->hrs < 0) wd->hrs += 24;
      }
    if (wd->sel_obj == wd->digit[1])
      {
-       wd->hrs = wd->hrs - 1;
-       if (wd->hrs < 0) wd->hrs += 24;
+        wd->hrs = wd->hrs - 1;
+        if (wd->hrs < 0) wd->hrs += 24;
      }
    if (wd->sel_obj == wd->digit[2])
      {
-       wd->min = wd->min - 10;
-       if (wd->min < 0) wd->min += 60;
+        wd->min = wd->min - 10;
+        if (wd->min < 0) wd->min += 60;
      }
    if (wd->sel_obj == wd->digit[3])
      {
-       wd->min = wd->min - 1;
-       if (wd->min < 0) wd->min += 60;
+        wd->min = wd->min - 1;
+        if (wd->min < 0) wd->min += 60;
      }
    if (wd->sel_obj == wd->digit[4])
      {
-       wd->sec = wd->sec - 10;
-       if (wd->sec < 0) wd->sec += 60;
+        wd->sec = wd->sec - 10;
+        if (wd->sec < 0) wd->sec += 60;
      }
    if (wd->sel_obj == wd->digit[5])
      {
-       wd->sec = wd->sec - 1;
-       if (wd->sec < 0) wd->sec += 60;
+        wd->sec = wd->sec - 1;
+        if (wd->sec < 0) wd->sec += 60;
      }
    if (wd->sel_obj == wd->ampm)
      {
-       wd->hrs = wd->hrs - 12;
-       if (wd->hrs < 0) wd->hrs += 24;
+        wd->hrs = wd->hrs - 12;
+        if (wd->hrs < 0) wd->hrs += 24;
      }
    wd->interval = wd->interval / 1.05;
    ecore_timer_interval_set(wd->spin, wd->interval);
@@ -326,188 +326,188 @@ _time_update(Evas_Object *obj)
    if ((wd->cur.seconds != wd->seconds) || (wd->cur.am_pm != wd->am_pm) ||
        (wd->cur.edit != wd->edit) || (wd->cur.digedit != wd->digedit))
      {
-       int i;
-       Evas_Coord mw, mh;
-
-       for (i = 0; i < 6; i++)
-         {
-            if (wd->digit[i])
-              {
-                 evas_object_del(wd->digit[i]);
-                 wd->digit[i] = NULL;
-              }
-         }
-       if (wd->ampm)
-         {
-            evas_object_del(wd->ampm);
-            wd->ampm = NULL;
-         }
-
-       if ((wd->seconds) && (wd->am_pm))
-         _elm_theme_object_set(obj, wd->clk, "clock", "base-all", style);
-       else if (wd->seconds)
-         _elm_theme_object_set(obj, wd->clk, "clock", "base-seconds", style);
-       else if (wd->am_pm)
-         _elm_theme_object_set(obj, wd->clk, "clock", "base-am_pm", style);
-       else
-         _elm_theme_object_set(obj, wd->clk, "clock", "base", style);
-       edje_object_scale_set(wd->clk, elm_widget_scale_get(obj) * 
+        int i;
+        Evas_Coord mw, mh;
+
+        for (i = 0; i < 6; i++)
+          {
+             if (wd->digit[i])
+               {
+                  evas_object_del(wd->digit[i]);
+                  wd->digit[i] = NULL;
+               }
+          }
+        if (wd->ampm)
+          {
+             evas_object_del(wd->ampm);
+             wd->ampm = NULL;
+          }
+
+        if ((wd->seconds) && (wd->am_pm))
+          _elm_theme_object_set(obj, wd->clk, "clock", "base-all", style);
+        else if (wd->seconds)
+          _elm_theme_object_set(obj, wd->clk, "clock", "base-seconds", style);
+        else if (wd->am_pm)
+          _elm_theme_object_set(obj, wd->clk, "clock", "base-am_pm", style);
+        else
+          _elm_theme_object_set(obj, wd->clk, "clock", "base", style);
+        edje_object_scale_set(wd->clk, elm_widget_scale_get(obj) *
                               _elm_config->scale);
 
-       for (i = 0; i < 6; i++)
-         {
-            char buf[16];
+        for (i = 0; i < 6; i++)
+          {
+             char buf[16];
 
-            if ((!wd->seconds) && (i >= 4)) break;
-            wd->digit[i] = edje_object_add(evas_object_evas_get(wd->clk));
-            _elm_theme_object_set(obj, wd->digit[i], "clock", "flipdigit", style);
-            edje_object_scale_set(wd->digit[i], elm_widget_scale_get(obj) * 
+             if ((!wd->seconds) && (i >= 4)) break;
+             wd->digit[i] = edje_object_add(evas_object_evas_get(wd->clk));
+             _elm_theme_object_set(obj, wd->digit[i], "clock", "flipdigit", style);
+             edje_object_scale_set(wd->digit[i], elm_widget_scale_get(obj) *
                                    _elm_config->scale);
-            if ((wd->edit) && (wd->digedit & (1 << i)))
-              edje_object_signal_emit(wd->digit[i], "elm,state,edit,on", "elm");
-            edje_object_signal_callback_add(wd->digit[i], "elm,action,up,start",
-                                            "", _signal_clock_val_up_start, obj);
-            edje_object_signal_callback_add(wd->digit[i], "elm,action,up,stop",
-                                            "", _signal_clock_val_change_stop, obj);
-            edje_object_signal_callback_add(wd->digit[i], "elm,action,down,start",
-                                            "", _signal_clock_val_down_start, obj);
-            edje_object_signal_callback_add(wd->digit[i], "elm,action,down,stop",
-                                            "", _signal_clock_val_change_stop, obj);
-            mw = mh = -1;
-            elm_coords_finger_size_adjust(1, &mw, 2, &mh);
-            edje_object_size_min_restricted_calc(wd->digit[i], &mw, &mh, mw, mh);
-            elm_coords_finger_size_adjust(1, &mw, 2, &mh);
-            edje_extern_object_min_size_set(wd->digit[i], mw, mh);
-            snprintf(buf, sizeof(buf), "d%i", i);
-            edje_object_part_swallow(wd->clk , buf, wd->digit[i]);
-            evas_object_show(wd->digit[i]);
-         }
-       if (wd->am_pm)
-         {
-            wd->ampm = edje_object_add(evas_object_evas_get(wd->clk));
-            _elm_theme_object_set(obj, wd->ampm, "clock", "flipampm", style);
-            edje_object_scale_set(wd->ampm, elm_widget_scale_get(obj) * 
+             if ((wd->edit) && (wd->digedit & (1 << i)))
+               edje_object_signal_emit(wd->digit[i], "elm,state,edit,on", "elm");
+             edje_object_signal_callback_add(wd->digit[i], "elm,action,up,start",
+                                             "", _signal_clock_val_up_start, obj);
+             edje_object_signal_callback_add(wd->digit[i], "elm,action,up,stop",
+                                             "", _signal_clock_val_change_stop, obj);
+             edje_object_signal_callback_add(wd->digit[i], "elm,action,down,start",
+                                             "", _signal_clock_val_down_start, obj);
+             edje_object_signal_callback_add(wd->digit[i], "elm,action,down,stop",
+                                             "", _signal_clock_val_change_stop, obj);
+             mw = mh = -1;
+             elm_coords_finger_size_adjust(1, &mw, 2, &mh);
+             edje_object_size_min_restricted_calc(wd->digit[i], &mw, &mh, mw, mh);
+             elm_coords_finger_size_adjust(1, &mw, 2, &mh);
+             edje_extern_object_min_size_set(wd->digit[i], mw, mh);
+             snprintf(buf, sizeof(buf), "d%i", i);
+             edje_object_part_swallow(wd->clk , buf, wd->digit[i]);
+             evas_object_show(wd->digit[i]);
+          }
+        if (wd->am_pm)
+          {
+             wd->ampm = edje_object_add(evas_object_evas_get(wd->clk));
+             _elm_theme_object_set(obj, wd->ampm, "clock", "flipampm", style);
+             edje_object_scale_set(wd->ampm, elm_widget_scale_get(obj) *
                                    _elm_config->scale);
-            if (wd->edit)
-              edje_object_signal_emit(wd->ampm, "elm,state,edit,on", "elm");
-            edje_object_signal_callback_add(wd->ampm, "elm,action,up,start",
-                                            "", _signal_clock_val_up_start, obj);
-            edje_object_signal_callback_add(wd->ampm, "elm,action,up,stop",
-                                            "", _signal_clock_val_change_stop, obj);
-            edje_object_signal_callback_add(wd->ampm, "elm,action,down,start",
-                                            "", _signal_clock_val_down_start, obj);
-            edje_object_signal_callback_add(wd->ampm, "elm,action,down,stop",
-                                            "", _signal_clock_val_change_stop, obj);
-            mw = mh = -1;
-            elm_coords_finger_size_adjust(1, &mw, 2, &mh);
-            edje_object_size_min_restricted_calc(wd->ampm, &mw, &mh, mw, mh);
-            elm_coords_finger_size_adjust(1, &mw, 2, &mh);
-            edje_extern_object_min_size_set(wd->ampm, mw, mh);
-            edje_object_part_swallow(wd->clk , "ampm", wd->ampm);
-            evas_object_show(wd->ampm);
-         }
-
-       edje_object_size_min_calc(wd->clk, &mw, &mh);
-       evas_object_size_hint_min_set(obj, mw, mh);
-
-       wd->cur.hrs = 0;
-       wd->cur.min = 0;
-       wd->cur.sec = 0;
-       wd->cur.ampm = -1;
-       wd->cur.seconds = wd->seconds;
-       wd->cur.am_pm = wd->am_pm;
-       wd->cur.edit = wd->edit;
-       wd->cur.digedit = wd->digedit;
+             if (wd->edit)
+               edje_object_signal_emit(wd->ampm, "elm,state,edit,on", "elm");
+             edje_object_signal_callback_add(wd->ampm, "elm,action,up,start",
+                                             "", _signal_clock_val_up_start, obj);
+             edje_object_signal_callback_add(wd->ampm, "elm,action,up,stop",
+                                             "", _signal_clock_val_change_stop, obj);
+             edje_object_signal_callback_add(wd->ampm, "elm,action,down,start",
+                                             "", _signal_clock_val_down_start, obj);
+             edje_object_signal_callback_add(wd->ampm, "elm,action,down,stop",
+                                             "", _signal_clock_val_change_stop, obj);
+             mw = mh = -1;
+             elm_coords_finger_size_adjust(1, &mw, 2, &mh);
+             edje_object_size_min_restricted_calc(wd->ampm, &mw, &mh, mw, mh);
+             elm_coords_finger_size_adjust(1, &mw, 2, &mh);
+             edje_extern_object_min_size_set(wd->ampm, mw, mh);
+             edje_object_part_swallow(wd->clk , "ampm", wd->ampm);
+             evas_object_show(wd->ampm);
+          }
+
+        edje_object_size_min_calc(wd->clk, &mw, &mh);
+        evas_object_size_hint_min_set(obj, mw, mh);
+
+        wd->cur.hrs = 0;
+        wd->cur.min = 0;
+        wd->cur.sec = 0;
+        wd->cur.ampm = -1;
+        wd->cur.seconds = wd->seconds;
+        wd->cur.am_pm = wd->am_pm;
+        wd->cur.edit = wd->edit;
+        wd->cur.digedit = wd->digedit;
      }
    if (wd->hrs != wd->cur.hrs)
      {
-       int hrs;
-       int d1, d2, dc1, dc2;
-
-       hrs = wd->hrs;
-       if (wd->am_pm)
-         {
-            if (hrs >= 12)
-              {
-                 if (hrs > 12) hrs -= 12;
-                 ampm = 1;
-              }
-            else if (!hrs) hrs = 12;
-         }
-       d1 = hrs / 10;
-       d2 = hrs % 10;
-       dc1 = wd->cur.hrs / 10;
-       dc2 = wd->cur.hrs % 10;
-       if (d1 != dc1)
-         {
-            msg.val = d1;
-            edje_object_message_send(wd->digit[0], EDJE_MESSAGE_INT, 1, &msg);
-         }
-       if (d2 != dc2)
-         {
-            msg.val = d2;
-            edje_object_message_send(wd->digit[1], EDJE_MESSAGE_INT, 1, &msg);
-         }
-       wd->cur.hrs = hrs;
+        int hrs;
+        int d1, d2, dc1, dc2;
+
+        hrs = wd->hrs;
+        if (wd->am_pm)
+          {
+             if (hrs >= 12)
+               {
+                  if (hrs > 12) hrs -= 12;
+                  ampm = 1;
+               }
+             else if (!hrs) hrs = 12;
+          }
+        d1 = hrs / 10;
+        d2 = hrs % 10;
+        dc1 = wd->cur.hrs / 10;
+        dc2 = wd->cur.hrs % 10;
+        if (d1 != dc1)
+          {
+             msg.val = d1;
+             edje_object_message_send(wd->digit[0], EDJE_MESSAGE_INT, 1, &msg);
+          }
+        if (d2 != dc2)
+          {
+             msg.val = d2;
+             edje_object_message_send(wd->digit[1], EDJE_MESSAGE_INT, 1, &msg);
+          }
+        wd->cur.hrs = hrs;
      }
    if (wd->min != wd->cur.min)
      {
-       int d1, d2, dc1, dc2;
-
-       d1 = wd->min / 10;
-       d2 = wd->min % 10;
-       dc1 = wd->cur.min / 10;
-       dc2 = wd->cur.min % 10;
-       if (d1 != dc1)
-         {
-            msg.val = d1;
-            edje_object_message_send(wd->digit[2], EDJE_MESSAGE_INT, 1, &msg);
-         }
-       if (d2 != dc2)
-         {
-            msg.val = d2;
-            edje_object_message_send(wd->digit[3], EDJE_MESSAGE_INT, 1, &msg);
-         }
-       wd->cur.min = wd->min;
+        int d1, d2, dc1, dc2;
+
+        d1 = wd->min / 10;
+        d2 = wd->min % 10;
+        dc1 = wd->cur.min / 10;
+        dc2 = wd->cur.min % 10;
+        if (d1 != dc1)
+          {
+             msg.val = d1;
+             edje_object_message_send(wd->digit[2], EDJE_MESSAGE_INT, 1, &msg);
+          }
+        if (d2 != dc2)
+          {
+             msg.val = d2;
+             edje_object_message_send(wd->digit[3], EDJE_MESSAGE_INT, 1, &msg);
+          }
+        wd->cur.min = wd->min;
      }
    if (wd->seconds)
      {
-       if (wd->sec != wd->cur.sec)
-         {
-            int d1, d2, dc1, dc2;
-
-            d1 = wd->sec / 10;
-            d2 = wd->sec % 10;
-            dc1 = wd->cur.sec / 10;
-            dc2 = wd->cur.sec % 10;
-            if (d1 != dc1)
-              {
-                 msg.val = d1;
-                 edje_object_message_send(wd->digit[4], EDJE_MESSAGE_INT, 1, &msg);
-              }
-            if (d2 != dc2)
-              {
-                 msg.val = d2;
-                 edje_object_message_send(wd->digit[5], EDJE_MESSAGE_INT, 1, &msg);
-              }
-            wd->cur.sec = wd->sec;
-         }
+        if (wd->sec != wd->cur.sec)
+          {
+             int d1, d2, dc1, dc2;
+
+             d1 = wd->sec / 10;
+             d2 = wd->sec % 10;
+             dc1 = wd->cur.sec / 10;
+             dc2 = wd->cur.sec % 10;
+             if (d1 != dc1)
+               {
+                  msg.val = d1;
+                  edje_object_message_send(wd->digit[4], EDJE_MESSAGE_INT, 1, &msg);
+               }
+             if (d2 != dc2)
+               {
+                  msg.val = d2;
+                  edje_object_message_send(wd->digit[5], EDJE_MESSAGE_INT, 1, &msg);
+               }
+             wd->cur.sec = wd->sec;
+          }
      }
    else
      wd->cur.sec = -1;
 
    if (wd->am_pm)
      {
-       if (wd->hrs >= 12) ampm = 1;
-       if (ampm != wd->cur.ampm)
-         {
-            if (wd->cur.ampm != ampm)
-              {
-                 msg.val = ampm;
-                 edje_object_message_send(wd->ampm, EDJE_MESSAGE_INT, 1, &msg);
-              }
-            wd->cur.ampm = ampm;
-         }
+        if (wd->hrs >= 12) ampm = 1;
+        if (ampm != wd->cur.ampm)
+          {
+             if (wd->cur.ampm != ampm)
+               {
+                  msg.val = ampm;
+                  edje_object_message_send(wd->ampm, EDJE_MESSAGE_INT, 1, &msg);
+               }
+             wd->cur.ampm = ampm;
+          }
      }
    else
      wd->cur.ampm = -1;
@@ -531,7 +531,7 @@ elm_clock_add(Evas_Object *parent)
    Widget_Data *wd;
 
    ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
-   
+
    ELM_SET_WIDTYPE(widtype, "clock");
    elm_widget_type_set(obj, "clock");
    elm_widget_sub_object_add(parent, obj);
index 79cd4bb..81c87e4 100644 (file)
@@ -56,7 +56,7 @@ enum
    CNP_ATOM_TEXT,
    CNP_ATOM_text_plain_utf8,
    CNP_ATOM_text_plain,
-   
+
    CNP_N_ATOMS,
 };
 
@@ -83,7 +83,7 @@ struct _Cnp_Selection
 
    Elm_Sel_Format    format;
    Ecore_X_Selection ecore_sel;
-   
+
    Eina_Bool         active : 1;
 };
 
@@ -168,212 +168,212 @@ static void pasteimage_free(Paste_Image *pi);
 /* Optimisation: Turn this into a 256 byte table:
  *     then can lookup in one index, not N checks */
 static const Escape escapes[] = {
-   { "<br>",   '\n' },
-   { "<\t>",   '\t' },
-   { "gt;",    '>'  },
-   { "lt;",    '<'  },
-   { "amp;",   '&'  },
-   { "quot;",  '\'' },
-   { "dquot;", '"'  }
+       { "<br>",   '\n' },
+       { "<\t>",   '\t' },
+       { "gt;",    '>'  },
+       { "lt;",    '<'  },
+       { "amp;",   '&'  },
+       { "quot;",  '\'' },
+       { "dquot;", '"'  }
 };
 #define N_ESCAPES ((int)(sizeof(escapes) / sizeof(escapes[0])))
 
 static Cnp_Atom atoms[CNP_N_ATOMS] = {
-   [CNP_ATOM_TARGETS] = {
-      "TARGETS",
-      (Elm_Sel_Format) -1, // everything
-      targets_converter,
-      response_handler_targets,
-      notify_handler_targets,
-      0
-   },
-   [CNP_ATOM_XELM] =  {
-      "application/x-elementary-markup",
-      ELM_SEL_FORMAT_MARKUP,
-      edje_converter,
-      NULL,
-      NULL,
-      0
-   },
-   [CNP_ATOM_text_uri] = {
-      "text/uri",
-      ELM_SEL_FORMAT_MARKUP | ELM_SEL_FORMAT_IMAGE, /* Either images or entries */
-      uri_converter,
-      NULL,
-      notify_handler_uri,
-      0
-   },
-   [CNP_ATOM_text_urilist] = {
-      "text/uri-list",
-      ELM_SEL_FORMAT_IMAGE,
-      uri_converter,
-      NULL,
-      notify_handler_uri,
-      0
-   },
-   [CNP_ATOM_text_x_vcard] = {
-      "text/x-vcard",
-      ELM_SEL_FORMAT_VCARD,
-      vcard_send, NULL,
-      vcard_receive, 0
-   },
-   [CNP_ATOM_image_png] = {
-      "image/png",
-      ELM_SEL_FORMAT_IMAGE,
-      image_converter,
-      NULL,
-      notify_handler_image,
-      0
-   },
-   [CNP_ATOM_image_jpeg] = {
-      "image/jpeg",
-      ELM_SEL_FORMAT_IMAGE,
-      image_converter,
-      NULL,
-      notify_handler_image,/* Raw image data is the same */
-      0
-   },
-   [CNP_ATOM_image_bmp] = {
-      "image/x-ms-bmp",
-      ELM_SEL_FORMAT_IMAGE,
-      image_converter,
-      NULL,
-      notify_handler_image,/* Raw image data is the same */
-      0
-   },
-   [CNP_ATOM_image_gif] = {
-      "image/gif",
-      ELM_SEL_FORMAT_IMAGE,
-      image_converter,
-      NULL,
-      notify_handler_image,/* Raw image data is the same */
-      0
-   },
-   [CNP_ATOM_image_tiff] = {
-      "image/tiff",
-      ELM_SEL_FORMAT_IMAGE,
-      image_converter,
-      NULL,
-      notify_handler_image,/* Raw image data is the same */
-      0
-   },
-   [CNP_ATOM_image_svg] = {
-      "image/svg+xml",
-      ELM_SEL_FORMAT_IMAGE,
-      image_converter,
-      NULL,
-      notify_handler_image,/* Raw image data is the same */
-      0
-   },
-   [CNP_ATOM_image_xpm] = {
-      "image/x-xpixmap",
-      ELM_SEL_FORMAT_IMAGE,
-      image_converter,
-      NULL,
-      notify_handler_image,/* Raw image data is the same */
-      0
-   },
-   [CNP_ATOM_image_tga] = {
-      "image/x-tga",
-      ELM_SEL_FORMAT_IMAGE,
-      image_converter,
-      NULL,
-      notify_handler_image,/* Raw image data is the same */
-      0
-   },
-   [CNP_ATOM_image_ppm] = {
-      "image/x-portable-pixmap",
-      ELM_SEL_FORMAT_IMAGE,
-      image_converter,
-      NULL,
-      notify_handler_image,/* Raw image data is the same */
-      0
-   },
-   [CNP_ATOM_text_html_utf8] = {
-      "text/html;charset=utf-8",
-      ELM_SEL_FORMAT_HTML,
-      html_converter,
-      NULL,
-      notify_handler_html,
-      0
-   },
-   [CNP_ATOM_text_html] = {
-      "text/html",
-      ELM_SEL_FORMAT_HTML,
-      html_converter,
-      NULL,
-      notify_handler_html, /* No encoding: Webkit only */
-      0
-   },
-   [CNP_ATOM_UTF8STRING] = {
-      "UTF8_STRING",
-      ELM_SEL_FORMAT_TEXT | ELM_SEL_FORMAT_MARKUP | ELM_SEL_FORMAT_HTML,
-      text_converter,
-      NULL,
-      notify_handler_text,
-      0
-   },
-   [CNP_ATOM_STRING] = {
-      "STRING",
-      ELM_SEL_FORMAT_TEXT | ELM_SEL_FORMAT_MARKUP | ELM_SEL_FORMAT_HTML,
-      text_converter,
-      NULL,
-      notify_handler_text,
-      0
-   },
-   [CNP_ATOM_TEXT] = {
-      "TEXT",
-      ELM_SEL_FORMAT_TEXT | ELM_SEL_FORMAT_MARKUP | ELM_SEL_FORMAT_HTML,
-      text_converter,
-      NULL,
-      NULL,
-      0
-   },
-   [CNP_ATOM_text_plain_utf8] = {
-      "text/plain;charset=utf-8",
-      ELM_SEL_FORMAT_TEXT | ELM_SEL_FORMAT_MARKUP | ELM_SEL_FORMAT_HTML,
-      text_converter,
-      NULL,
-      NULL,
-      0
-   },
-   [CNP_ATOM_text_plain] = {
-      "text/plain",
-      ELM_SEL_FORMAT_TEXT | ELM_SEL_FORMAT_MARKUP | ELM_SEL_FORMAT_HTML,
-      text_converter,
-      NULL,
-      NULL,
-      0
-   },
+     [CNP_ATOM_TARGETS] = {
+          "TARGETS",
+          (Elm_Sel_Format) -1, // everything
+          targets_converter,
+          response_handler_targets,
+          notify_handler_targets,
+          0
+     },
+     [CNP_ATOM_XELM] =  {
+          "application/x-elementary-markup",
+          ELM_SEL_FORMAT_MARKUP,
+          edje_converter,
+          NULL,
+          NULL,
+          0
+     },
+     [CNP_ATOM_text_uri] = {
+          "text/uri",
+          ELM_SEL_FORMAT_MARKUP | ELM_SEL_FORMAT_IMAGE, /* Either images or entries */
+          uri_converter,
+          NULL,
+          notify_handler_uri,
+          0
+     },
+     [CNP_ATOM_text_urilist] = {
+          "text/uri-list",
+          ELM_SEL_FORMAT_IMAGE,
+          uri_converter,
+          NULL,
+          notify_handler_uri,
+          0
+     },
+     [CNP_ATOM_text_x_vcard] = {
+          "text/x-vcard",
+          ELM_SEL_FORMAT_VCARD,
+          vcard_send, NULL,
+          vcard_receive, 0
+     },
+     [CNP_ATOM_image_png] = {
+          "image/png",
+          ELM_SEL_FORMAT_IMAGE,
+          image_converter,
+          NULL,
+          notify_handler_image,
+          0
+     },
+     [CNP_ATOM_image_jpeg] = {
+          "image/jpeg",
+          ELM_SEL_FORMAT_IMAGE,
+          image_converter,
+          NULL,
+          notify_handler_image,/* Raw image data is the same */
+          0
+     },
+     [CNP_ATOM_image_bmp] = {
+          "image/x-ms-bmp",
+          ELM_SEL_FORMAT_IMAGE,
+          image_converter,
+          NULL,
+          notify_handler_image,/* Raw image data is the same */
+          0
+     },
+     [CNP_ATOM_image_gif] = {
+          "image/gif",
+          ELM_SEL_FORMAT_IMAGE,
+          image_converter,
+          NULL,
+          notify_handler_image,/* Raw image data is the same */
+          0
+     },
+     [CNP_ATOM_image_tiff] = {
+          "image/tiff",
+          ELM_SEL_FORMAT_IMAGE,
+          image_converter,
+          NULL,
+          notify_handler_image,/* Raw image data is the same */
+          0
+     },
+     [CNP_ATOM_image_svg] = {
+          "image/svg+xml",
+          ELM_SEL_FORMAT_IMAGE,
+          image_converter,
+          NULL,
+          notify_handler_image,/* Raw image data is the same */
+          0
+     },
+     [CNP_ATOM_image_xpm] = {
+          "image/x-xpixmap",
+          ELM_SEL_FORMAT_IMAGE,
+          image_converter,
+          NULL,
+          notify_handler_image,/* Raw image data is the same */
+          0
+     },
+     [CNP_ATOM_image_tga] = {
+          "image/x-tga",
+          ELM_SEL_FORMAT_IMAGE,
+          image_converter,
+          NULL,
+          notify_handler_image,/* Raw image data is the same */
+          0
+     },
+     [CNP_ATOM_image_ppm] = {
+          "image/x-portable-pixmap",
+          ELM_SEL_FORMAT_IMAGE,
+          image_converter,
+          NULL,
+          notify_handler_image,/* Raw image data is the same */
+          0
+     },
+     [CNP_ATOM_text_html_utf8] = {
+          "text/html;charset=utf-8",
+          ELM_SEL_FORMAT_HTML,
+          html_converter,
+          NULL,
+          notify_handler_html,
+          0
+     },
+     [CNP_ATOM_text_html] = {
+          "text/html",
+          ELM_SEL_FORMAT_HTML,
+          html_converter,
+          NULL,
+          notify_handler_html, /* No encoding: Webkit only */
+          0
+     },
+     [CNP_ATOM_UTF8STRING] = {
+          "UTF8_STRING",
+          ELM_SEL_FORMAT_TEXT | ELM_SEL_FORMAT_MARKUP | ELM_SEL_FORMAT_HTML,
+          text_converter,
+          NULL,
+          notify_handler_text,
+          0
+     },
+     [CNP_ATOM_STRING] = {
+          "STRING",
+          ELM_SEL_FORMAT_TEXT | ELM_SEL_FORMAT_MARKUP | ELM_SEL_FORMAT_HTML,
+          text_converter,
+          NULL,
+          notify_handler_text,
+          0
+     },
+     [CNP_ATOM_TEXT] = {
+          "TEXT",
+          ELM_SEL_FORMAT_TEXT | ELM_SEL_FORMAT_MARKUP | ELM_SEL_FORMAT_HTML,
+          text_converter,
+          NULL,
+          NULL,
+          0
+     },
+     [CNP_ATOM_text_plain_utf8] = {
+          "text/plain;charset=utf-8",
+          ELM_SEL_FORMAT_TEXT | ELM_SEL_FORMAT_MARKUP | ELM_SEL_FORMAT_HTML,
+          text_converter,
+          NULL,
+          NULL,
+          0
+     },
+     [CNP_ATOM_text_plain] = {
+          "text/plain",
+          ELM_SEL_FORMAT_TEXT | ELM_SEL_FORMAT_MARKUP | ELM_SEL_FORMAT_HTML,
+          text_converter,
+          NULL,
+          NULL,
+          0
+     },
 };
 
 static Cnp_Selection selections[ELM_SEL_MAX] = {
-   ARRAYINIT(ELM_SEL_PRIMARY) {
-      .debug = "Primary",
-      .ecore_sel = ECORE_X_SELECTION_PRIMARY,
-      .set = ecore_x_selection_primary_set,
-      .clear = ecore_x_selection_primary_clear,
-      .request = ecore_x_selection_primary_request,
-   },
-   ARRAYINIT(ELM_SEL_SECONDARY) {
-      .debug = "Secondary",
-      .ecore_sel = ECORE_X_SELECTION_SECONDARY,
-      .set = ecore_x_selection_secondary_set,
-      .clear = ecore_x_selection_secondary_clear,
-      .request = ecore_x_selection_secondary_request,
-   },
-   ARRAYINIT(ELM_SEL_CLIPBOARD) {
-      .debug = "Clipboard",
-      .ecore_sel = ECORE_X_SELECTION_CLIPBOARD,
-      .set = ecore_x_selection_clipboard_set,
-      .clear = ecore_x_selection_clipboard_clear,
-      .request = ecore_x_selection_clipboard_request,
-   },
-   ARRAYINIT(ELM_SEL_XDND) {
-      .debug = "XDnD",
-      .ecore_sel = ECORE_X_SELECTION_XDND,
-      .request = ecore_x_selection_xdnd_request,
-   },
+     ARRAYINIT(ELM_SEL_PRIMARY) {
+          .debug = "Primary",
+          .ecore_sel = ECORE_X_SELECTION_PRIMARY,
+          .set = ecore_x_selection_primary_set,
+          .clear = ecore_x_selection_primary_clear,
+          .request = ecore_x_selection_primary_request,
+     },
+     ARRAYINIT(ELM_SEL_SECONDARY) {
+          .debug = "Secondary",
+          .ecore_sel = ECORE_X_SELECTION_SECONDARY,
+          .set = ecore_x_selection_secondary_set,
+          .clear = ecore_x_selection_secondary_clear,
+          .request = ecore_x_selection_secondary_request,
+     },
+     ARRAYINIT(ELM_SEL_CLIPBOARD) {
+          .debug = "Clipboard",
+          .ecore_sel = ECORE_X_SELECTION_CLIPBOARD,
+          .set = ecore_x_selection_clipboard_set,
+          .clear = ecore_x_selection_clipboard_clear,
+          .request = ecore_x_selection_clipboard_request,
+     },
+     ARRAYINIT(ELM_SEL_XDND) {
+          .debug = "XDnD",
+          .ecore_sel = ECORE_X_SELECTION_XDND,
+          .request = ecore_x_selection_xdnd_request,
+     },
 };
 
 /* Data for DND in progress */
@@ -415,7 +415,7 @@ elm_selection_set(Elm_Sel_Type selection, Evas_Object *widget, Elm_Sel_Format fo
    if ((unsigned int)selection >= (unsigned int)ELM_SEL_MAX) return EINA_FALSE;
    if (!_elm_cnp_init_count) _elm_cnp_init();
    if ((!selbuf) && (format != ELM_SEL_FORMAT_IMAGE))
-      return elm_selection_clear(selection, widget);
+     return elm_selection_clear(selection, widget);
 
    sel = selections + selection;
 
@@ -458,7 +458,7 @@ elm_selection_clear(Elm_Sel_Type selection, Evas_Object *widget)
 
 Eina_Bool
 elm_selection_get(Elm_Sel_Type selection, Elm_Sel_Format format,
-                       Evas_Object *widget, Elm_Drop_Cb datacb, void *udata)
+                  Evas_Object *widget, Elm_Drop_Cb datacb, void *udata)
 {
 #ifdef HAVE_ELEMENTARY_X
    Evas_Object *top;
@@ -489,19 +489,19 @@ static Eina_Bool
 _elm_cnp_init(void)
 {
    int i;
-   
+
    if (_elm_cnp_init_count++) return EINA_TRUE;
    for (i = 0; i < CNP_N_ATOMS; i++)
      {
-       atoms[i].atom = ecore_x_atom_get(atoms[i].name);
-       ecore_x_selection_converter_atom_add(atoms[i].atom,
+        atoms[i].atom = ecore_x_atom_get(atoms[i].name);
+        ecore_x_selection_converter_atom_add(atoms[i].atom,
                                              atoms[i].converter);
      }
    clipboard_atom = ecore_x_atom_get("CLIPBOARD");
 
    ecore_event_handler_add(ECORE_X_EVENT_SELECTION_CLEAR, selection_clear, NULL);
    ecore_event_handler_add(ECORE_X_EVENT_SELECTION_NOTIFY, selection_notify, NULL);
-   
+
    text_uri = eina_stringshare_add("text/uri-list");
    return EINA_TRUE;
 }
@@ -512,10 +512,10 @@ selection_clear(void *udata __UNUSED__, int type __UNUSED__, void *event)
    Ecore_X_Event_Selection_Clear *ev = event;
    Cnp_Selection *sel;
    int i;
-   
+
    for (i = 0; i < ELM_SEL_MAX; i++)
      {
-       if (selections[i].ecore_sel == ev->selection) break;
+        if (selections[i].ecore_sel == ev->selection) break;
      }
    cnp_debug("selection %d clear\n", i);
    /* Not me... Don't care */
@@ -542,41 +542,41 @@ selection_notify(void *udata __UNUSED__, int type __UNUSED__, void *event)
    Ecore_X_Event_Selection_Notify *ev = event;
    Cnp_Selection *sel;
    int i;
-   
+
    cnp_debug("selection notify callback: %d\n",ev->selection);
    switch (ev->selection)
      {
       case ECORE_X_SELECTION_CLIPBOARD:
-        sel = selections + ELM_SEL_CLIPBOARD;
-        break;
+         sel = selections + ELM_SEL_CLIPBOARD;
+         break;
       case ECORE_X_SELECTION_PRIMARY:
-        sel = selections + ELM_SEL_PRIMARY;
-        break;
+         sel = selections + ELM_SEL_PRIMARY;
+         break;
       case ECORE_X_SELECTION_SECONDARY:
-        sel = selections + ELM_SEL_SECONDARY;
-        break;
+         sel = selections + ELM_SEL_SECONDARY;
+         break;
       case ECORE_X_SELECTION_XDND:
-        sel = selections + ELM_SEL_XDND;
-        break;
+         sel = selections + ELM_SEL_XDND;
+         break;
       default:
-        return ECORE_CALLBACK_PASS_ON;
+         return ECORE_CALLBACK_PASS_ON;
      }
    cnp_debug("Target is %s\n", ev->target);
-   
+
    for (i = 0; i < CNP_N_ATOMS; i++)
      {
-       if (!strcmp(ev->target, atoms[i].name))
-         {
-            if (atoms[i].notify)
+        if (!strcmp(ev->target, atoms[i].name))
+          {
+             if (atoms[i].notify)
                {
                   cnp_debug("Found something: %s\n", atoms[i].name);
-                 atoms[i].notify(sel, ev);
-               } 
-             else 
+                  atoms[i].notify(sel, ev);
+               }
+             else
                {
-                 cnp_debug("Ignored: No handler!\n");
+                  cnp_debug("Ignored: No handler!\n");
                }
-         }
+          }
      }
 
    return ECORE_CALLBACK_PASS_ON;
@@ -590,20 +590,20 @@ targets_converter(char *target __UNUSED__, void *data, int size __UNUSED__, void
    int i,count;
    Ecore_X_Atom *aret;
    Cnp_Selection *sel;
-   
+
    if (!data_ret) return EINA_FALSE;
 
    sel = selections + *((int *)data);
 
    for (i = 0, count = 0; i < CNP_N_ATOMS ; i++)
      {
-       if (sel->format & atoms[i].formats) count++;
+        if (sel->format & atoms[i].formats) count++;
      }
 
    aret = malloc(sizeof(Ecore_X_Atom) * count);
    for (i = 0, count = 0; i < CNP_N_ATOMS; i++)
      {
-       if (sel->format & atoms[i].formats) aret[count ++] = atoms[i].atom;
+        if (sel->format & atoms[i].formats) aret[count ++] = atoms[i].atom;
      }
 
    *data_ret = aret;
@@ -627,7 +627,7 @@ vcard_send(char *target __UNUSED__, void *data __UNUSED__, int size __UNUSED__,
    Cnp_Selection *sel;
 
    cnp_debug("Vcard send called\n");
-   
+
    sel = selections + *((int *)data);
 
    if (data_ret) *data_ret = strdup(sel->selbuf);
@@ -645,28 +645,28 @@ notify_handler_targets(Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *notif
    Ecore_X_Selection_Data_Targets *targets;
    Ecore_X_Atom *atomlist;
    int i, j;
-   
+
    targets = notify->data;
    atomlist = (Ecore_X_Atom *)(targets->data.data);
 
    for (j = 1; j < CNP_N_ATOMS; j++)
      {
-       cnp_debug("\t%s %d\n", atoms[j].name, atoms[j].atom);
-       if (!(atoms[j].formats & sel->requestformat)) continue;
-       for (i = 0; i < targets->data.length; i++)
-         {
-            if ((atoms[j].atom == atomlist[i]) && (atoms[j].notify))
-              {
-                 cnp_debug("Atom %s matches\n",atoms[j].name);
-                 goto done;
-              }
-         }
+        cnp_debug("\t%s %d\n", atoms[j].name, atoms[j].atom);
+        if (!(atoms[j].formats & sel->requestformat)) continue;
+        for (i = 0; i < targets->data.length; i++)
+          {
+             if ((atoms[j].atom == atomlist[i]) && (atoms[j].notify))
+               {
+                  cnp_debug("Atom %s matches\n",atoms[j].name);
+                  goto done;
+               }
+          }
      }
 
    cnp_debug("Couldn't find anything that matches\n");
    return ECORE_CALLBACK_PASS_ON;
 
-   done:
+done:
    cnp_debug("Sending request for %s\n",atoms[j].name);
    sel->request(elm_win_xwindow_get(sel->requestwidget), atoms[j].name);
 
@@ -687,26 +687,26 @@ response_handler_targets(Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *not
    /* Start from 1: Skip targets */
    for (j = 1 ; j < CNP_N_ATOMS ; j ++)
      {
-       if (!(atoms[j].formats & sel->requestformat)) continue;
-       for (i = 0 ; i < targets->data.length ; i ++)
-         {
-            if ((atoms[j].atom == atomlist[i]) && (atoms[j].response))
+        if (!(atoms[j].formats & sel->requestformat)) continue;
+        for (i = 0 ; i < targets->data.length ; i ++)
+          {
+             if ((atoms[j].atom == atomlist[i]) && (atoms[j].response))
                {
-                 /* Found a match: Use it */
-                 goto found;
+                  /* Found a match: Use it */
+                  goto found;
                }
           }
      }
 found:
    if (j == CNP_N_ATOMS)
      {
-       cnp_debug("No matching type found\n");
-       return 0;
+        cnp_debug("No matching type found\n");
+        return 0;
      }
-   
+
    top = elm_widget_top_get(sel->requestwidget);
    if (!top) return 0;
-   
+
    sel->request(elm_win_xwindow_get(top), atoms[j].name);
    return 0;
 }
@@ -717,7 +717,7 @@ notify_handler_text(Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *notify)
 {
    Ecore_X_Selection_Data *data;
    char *str;
-   
+
    data = notify->data;
    cnp_debug("Notify handler text %d %d %p\n", data->format,data->length, data->data);
    str = mark_up((char *)data->data, data->length, NULL);
@@ -805,7 +805,7 @@ vcard_receive(Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *notify)
    if (sel == (selections + ELM_SEL_XDND))
      {
         Elm_Selection_Data ddata;
-        
+
         cnp_debug("drag & drop\n");
         /* FIXME: this needs to be generic: Used for all receives */
         EINA_LIST_FOREACH(drops, l, dropable)
@@ -840,7 +840,7 @@ vcard_receive(Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *notify)
      {
         cnp_debug("Paste request\n");
      }
-   
+
    return 0;
 
 }
@@ -852,16 +852,16 @@ notify_handler_image(Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *notify)
    Ecore_X_Selection_Data *data;
    Tmp_Info *tmp;
    Paste_Image *pi;
-   
+
    cnp_debug("got a png (or a jpeg)!\n");
    data = notify->data;
-   
+
    cnp_debug("Size if %d\n", data->length);
 
    if (sel->datacb)
      {
         Elm_Selection_Data ddata;
-        
+
         ddata.x = ddata.y = 0;
         ddata.format = ELM_SEL_FORMAT_IMAGE;
         ddata.data = data->data;
@@ -869,12 +869,12 @@ notify_handler_image(Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *notify)
         sel->datacb(sel->udata, sel->widget, &ddata);
         return 0;
      }
-   
+
    /* generate tmp name */
    tmp = elm_cnp_tempfile_create(data->length);
    memcpy(tmp->map, data->data, data->length);
    munmap(tmp->map,data->length);
-   
+
    /* FIXME: Add to paste image data to clean up */
    pi = pasteimage_alloc(tmp->filename, strlen(tmp->filename));
    pasteimage_append(pi, sel->requestwidget);
@@ -893,10 +893,10 @@ static int
 notify_handler_html(Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *notify)
 {
    Ecore_X_Selection_Data *data;
-   
+
    cnp_debug("Got some HTML: Checking encoding is useful\n");
    data = notify->data;
-   
+
    if (sel->datacb)
      {
         Elm_Selection_Data ddata;
@@ -927,11 +927,11 @@ text_converter(char *target __UNUSED__, void *data, int size __UNUSED__, void **
    cnp_debug("text converter\n");
    sel = selections + *((int *)data);
    if (!sel->active) return EINA_TRUE;
-   
+
    if ((sel->format & ELM_SEL_FORMAT_MARKUP) ||
        (sel->format & ELM_SEL_FORMAT_HTML))
      {
-       *data_ret = remove_tags(sel->selbuf, size_ret);
+        *data_ret = remove_tags(sel->selbuf, size_ret);
      }
    else if (sel->format & ELM_SEL_FORMAT_TEXT)
      {
@@ -940,12 +940,12 @@ text_converter(char *target __UNUSED__, void *data, int size __UNUSED__, void **
      }
    else if (sel->format & ELM_SEL_FORMAT_IMAGE)
      {
-       cnp_debug("Image %s\n", evas_object_type_get(sel->widget));
-       cnp_debug("Elm type: %s\n", elm_object_widget_type_get(sel->widget));
-       evas_object_image_file_get(elm_photocam_internal_image_get(sel->widget), (const char **)data_ret, NULL);
-       if (!*data_ret) *data_ret = strdup("No file");
-       else *data_ret = strdup(*data_ret);
-       *size_ret = strlen(*data_ret);
+        cnp_debug("Image %s\n", evas_object_type_get(sel->widget));
+        cnp_debug("Elm type: %s\n", elm_object_widget_type_get(sel->widget));
+        evas_object_image_file_get(elm_photocam_internal_image_get(sel->widget), (const char **)data_ret, NULL);
+        if (!*data_ret) *data_ret = strdup("No file");
+        else *data_ret = strdup(*data_ret);
+        *size_ret = strlen(*data_ret);
      }
    return EINA_TRUE;
 }
@@ -978,12 +978,12 @@ html_converter(char *target __UNUSED__, void *data, int size __UNUSED__, void **
 static Eina_Bool
 uri_converter(char *target __UNUSED__, void *data, int size __UNUSED__, void **data_ret, int *size_ret, Ecore_X_Atom *ttype __UNUSED__, int *typesize __UNUSED__)
 {
-    Cnp_Selection *sel;
-    sel = selections + *((int *)data);
-    cnp_debug("Uri converter\n");
-    if (data_ret) *data_ret = strdup(sel->selbuf);
-    if (size_ret) *size_ret = strlen(sel->selbuf);
-    return EINA_TRUE;
+   Cnp_Selection *sel;
+   sel = selections + *((int *)data);
+   cnp_debug("Uri converter\n");
+   if (data_ret) *data_ret = strdup(sel->selbuf);
+   if (size_ret) *size_ret = strlen(sel->selbuf);
+   return EINA_TRUE;
 }
 
 /*
@@ -1001,17 +1001,17 @@ image_provider(void *images __UNUSED__, Evas_Object *entry, const char *item)
    cnp_debug("image provider for %s called\n", item);
    EINA_LIST_FOREACH(pastedimages, l, pi)
      {
-       cnp_debug("is it %s?\n",pi->tag);
-       if (!strcmp(pi->tag, item))
+        cnp_debug("is it %s?\n",pi->tag);
+        if (!strcmp(pi->tag, item))
           {
-            /* Found it */
-            Evas_Object *o;
-            o = evas_object_image_filled_add(evas_object_evas_get(entry));
-            /* FIXME: Handle eets */
-            cnp_debug("file is %s (object is %p)\n", pi->file, o);
-            evas_object_image_file_set(o, pi->file, NULL);
-            evas_object_show(o);
-            return o;
+             /* Found it */
+             Evas_Object *o;
+             o = evas_object_image_filled_add(evas_object_evas_get(entry));
+             /* FIXME: Handle eets */
+             cnp_debug("file is %s (object is %p)\n", pi->file, o);
+             evas_object_image_file_set(o, pi->file, NULL);
+             evas_object_show(o);
+             return o;
           }
      }
    return NULL;
@@ -1028,7 +1028,7 @@ pasteimage_alloc(const char *file, int pathlen)
 
    pi = calloc(1, sizeof(Paste_Image));
    if (!pi) return NULL;
-   
+
    len = snprintf(NULL, 0, "pasteimage-%p", pi);
    len++;
    buf = malloc(len);
@@ -1039,7 +1039,7 @@ pasteimage_alloc(const char *file, int pathlen)
      }
    snprintf(buf, len, "pasteimage-%p", pi);
    pi->tag = buf;
-   
+
    if (file)
      {
         if (strstr(file,"file://")) file += prefixlen;
@@ -1066,12 +1066,12 @@ pasteimage_provider_set(Evas_Object *entry)
 {
    void *v;
    const char *type;
-   
+
    if (!entry) return EINA_FALSE;
    type = elm_widget_type_get(entry);
    cnp_debug("type is %s\n", type);
    if ((!type) || (strcmp(type, "entry"))) return EINA_FALSE;
-   
+
    v = evas_object_data_get(entry, PROVIDER_SET);
    if (!v)
      {
@@ -1114,8 +1114,8 @@ entry_deleted(void *images __UNUSED__, Evas *e __UNUSED__, Evas_Object *entry, v
 
    EINA_LIST_FOREACH_SAFE(pastedimages, l, next, pi)
      {
-       if (pi->entry == entry)
-           pastedimages = eina_list_remove_list(pastedimages, l);
+        if (pi->entry == entry)
+          pastedimages = eina_list_remove_list(pastedimages, l);
      }
 }
 
@@ -1126,36 +1126,36 @@ remove_tags(const char *p, int *len)
    char *q,*ret;
    int i;
    if (!p) return NULL;
-   
+
    q = malloc(strlen(p) + 1);
    if (!q) return NULL;
    ret = q;
 
    while (*p)
      {
-       if ((*p != '<') && (*p != '&')) *q++ = *p++;
+        if ((*p != '<') && (*p != '&')) *q++ = *p++;
         else if (*p == '<')
           {
-            if ((p[1] == 'b') && (p[2] == 'r') &&
+             if ((p[1] == 'b') && (p[2] == 'r') &&
                  ((p[3] == ' ') || (p[3] == '/') || (p[3] == '>')))
-               *q++ = '\n';
-            while ((*p) && (*p != '>')) p++;
-            p++;
-          } 
+               *q++ = '\n';
+             while ((*p) && (*p != '>')) p++;
+             p++;
+          }
         else if (*p == '&')
           {
-            p++;
-            for (i = 0 ; i < N_ESCAPES ; i++)
+             p++;
+             for (i = 0 ; i < N_ESCAPES ; i++)
                {
                   if (!strncmp(p,escapes[i].escape, strlen(escapes[i].escape)))
                     {
                        p += strlen(escapes[i].escape);
-                      *q = escapes[i].value;
-                      q++;
-                      break;
+                       *q = escapes[i].value;
+                       q++;
+                       break;
                     }
                }
-            if (i == N_ESCAPES) *q ++= '&';
+             if (i == N_ESCAPES) *q ++= '&';
           }
      }
    *q = 0;
@@ -1171,7 +1171,7 @@ mark_up(const char *start, int inlen, int *lenp)
    const char *p;
    char *q, *ret;
    const char *endp = NULL;
-   
+
    if (!start) return NULL;
    if (inlen >= 0) endp = start + inlen;
    /* First pass: Count characters */
@@ -1187,26 +1187,26 @@ mark_up(const char *start, int inlen, int *lenp)
           }
         if (i == N_ESCAPES) l++;
      }
-   
+
    q = ret = malloc(l + 1);
-   
+
    /* Second pass: Change characters */
-  for (p = start; *p; )
-    {
-       for (i = 0; i < N_ESCAPES; i++)
-         {
-            if (*p == escapes[i].value)
-              {
-                 strcpy(q, escapes[i].escape);
-                 q += strlen(escapes[i].escape);
-                 p ++;
-                 break;
-              }
-         }
-       if (i == N_ESCAPES) *q++ = *p++;
-    }
+   for (p = start; *p; )
+     {
+        for (i = 0; i < N_ESCAPES; i++)
+          {
+             if (*p == escapes[i].value)
+               {
+                  strcpy(q, escapes[i].escape);
+                  q += strlen(escapes[i].escape);
+                  p ++;
+                  break;
+               }
+          }
+        if (i == N_ESCAPES) *q++ = *p++;
+     }
    *q = 0;
-   
+
    if (lenp) *lenp = l;
    return ret;
 }
@@ -1226,7 +1226,7 @@ _dnd_enter(void *data __UNUSED__, int etype __UNUSED__, void *ev)
    if (savedtypes.types) free(savedtypes.types);
    savedtypes.types = malloc(sizeof(char *) * enter->num_types);
    if (!savedtypes.types) return EINA_FALSE;
-   
+
    for (i = 0; i < enter->num_types; i++)
      {
         savedtypes.types[i] = eina_stringshare_add(enter->types[i]);
@@ -1282,7 +1282,7 @@ _dnd_drop(void *data __UNUSED__, int etype __UNUSED__, void *ev)
    ecore_evas_geometry_get(ee, &x, &y, NULL, NULL);
    savedtypes.x = drop->position.x - x;
    savedtypes.y = drop->position.y - y;
-   
+
    cnp_debug("Drop position is %d,%d\n", savedtypes.x, savedtypes.y);
 
    for (; l; l = l->next)
@@ -1291,31 +1291,31 @@ _dnd_drop(void *data __UNUSED__, int etype __UNUSED__, void *ev)
         evas_object_geometry_get(dropable->obj, &x, &y, &w, &h);
         if ((savedtypes.x >= x) && (savedtypes.y >= y) &&
             (savedtypes.x < x + w) && (savedtypes.y < y + h))
-           break; /* found! */
+          break; /* found! */
      }
-   
+
    if (!l) return EINA_TRUE; /* didn't find one */
-   
+
    evas_object_geometry_get(dropable->obj, &x, &y, NULL, NULL);
    savedtypes.x -= x;
    savedtypes.y -= y;
-   
+
    /* Find our type from the previous list */
    for (i = 0; i < CNP_N_ATOMS; i++)
      {
-       for (j = 0; j < savedtypes.ntypes; j++)
+        for (j = 0; j < savedtypes.ntypes; j++)
           {
              if (!strcmp(savedtypes.types[j], atoms[i].name)) goto found;
           }
      }
-   
+
    cnp_debug("Didn't find a target\n");
    return EINA_TRUE;
-   
+
 found:
    cnp_debug("Found a target we'd like: %s\n", atoms[i].name);
    cnp_debug("0x%x\n",xwin);
-   
+
    if (i == CNP_ATOM_text_urilist)
      {
         cnp_debug("We found a URI... (%scached) %s\n",
@@ -1325,13 +1325,13 @@ found:
           {
              char *entrytag;
              static const char *tagstring = "<item absize=240x180 href="
-                                                   "file://%s></item>";
+                "file://%s></item>";
              ddata.x = savedtypes.x;
              ddata.y = savedtypes.y;
 
              /* If it's markup that also supports images */
              if ((dropable->types & ELM_SEL_FORMAT_MARKUP) &&
-                    (dropable->types & ELM_SEL_FORMAT_IMAGE))
+                 (dropable->types & ELM_SEL_FORMAT_IMAGE))
                {
                   int len;
                   ddata.format = ELM_SEL_FORMAT_MARKUP;
@@ -1417,7 +1417,7 @@ _dnd_status(void *data __UNUSED__, int etype __UNUSED__, void *ev)
    struct _Ecore_X_Event_Xdnd_Status *status = ev;
 
    if (!status) return EINA_TRUE;
-   
+
    /* Only thing we care about: will accept */
    if (status->will_accept)
      {
@@ -1486,9 +1486,9 @@ elm_drop_target_add(Evas_Object *obj, Elm_Sel_Type format, Elm_Drop_Cb dropcb, v
 
    xwin = (Ecore_X_Window)ecore_evas_window_get
       (ecore_evas_ecore_evas_get(evas_object_evas_get(obj)));
-   
+
    ecore_x_dnd_aware_set(xwin, EINA_TRUE);
-   
+
    cnp_debug("Adding drop target calls\n");
    handler_enter = ecore_event_handler_add(ECORE_X_EVENT_XDND_ENTER,
                                            _dnd_enter, NULL);
@@ -1496,7 +1496,7 @@ elm_drop_target_add(Evas_Object *obj, Elm_Sel_Type format, Elm_Drop_Cb dropcb, v
                                          _dnd_position, NULL);
    handler_drop = ecore_event_handler_add(ECORE_X_EVENT_XDND_DROP,
                                           _dnd_drop, NULL);
-   
+
    return EINA_TRUE;
 }
 
@@ -1506,7 +1506,7 @@ elm_drop_target_del(Evas_Object *obj)
    Dropable *drop,*del;
    Eina_List *item;
    Ecore_X_Window xwin;
-   
+
    del = NULL;
    EINA_LIST_FOREACH(drops, item, drop)
      {
@@ -1518,28 +1518,28 @@ elm_drop_target_del(Evas_Object *obj)
           }
      }
    if (!del) return EINA_FALSE;
-   
+
    evas_object_event_callback_del(obj, EVAS_CALLBACK_FREE,
                                   (Evas_Object_Event_Cb)elm_drop_target_del);
    free(drop);
    /* If still drops there: All fine.. continue */
    if (drops) return EINA_TRUE;
-   
+
    cnp_debug("Disabling DND\n");
    xwin = (Ecore_X_Window)ecore_evas_window_get
       (ecore_evas_ecore_evas_get(evas_object_evas_get(obj)));
    ecore_x_dnd_aware_set(xwin, EINA_FALSE);
-   
+
    ecore_event_handler_del(handler_pos);
    ecore_event_handler_del(handler_drop);
    ecore_event_handler_del(handler_enter);
-   
+
    if (savedtypes.pi)
      {
         pasteimage_free(savedtypes.pi);
         savedtypes.pi = NULL;
      }
-   
+
    return EINA_TRUE;
 }
 
@@ -1564,8 +1564,8 @@ _drag_mouse_up(void *un __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *
 static void
 _drag_move(void *data __UNUSED__, Ecore_X_Xdnd_Position *pos)
 {
-   evas_object_move(dragwin, 
-                    pos->position.x - _dragx, 
+   evas_object_move(dragwin,
+                    pos->position.x - _dragx,
                     pos->position.y - _dragy);
 }
 
@@ -1580,9 +1580,9 @@ elm_drag_start(Evas_Object *obj, Elm_Sel_Format format, const char *data, void (
    int x, y, x2, y2, x3, y3;
    Evas_Object *icon;
    int w, h;
-   
+
    if (!_elm_cnp_init_count) _elm_cnp_init();
-   
+
    xwin = elm_win_xwindow_get(obj);
 
    cnp_debug("starting drag...\n");
@@ -1595,18 +1595,18 @@ elm_drag_start(Evas_Object *obj, Elm_Sel_Format format, const char *data, void (
    sel->selbuf = data ? strdup(data) : NULL;
    dragdonecb = dragdone;
    dragdonedata = donecbdata;
-   
+
    ecore_x_dnd_callback_pos_update_set(_drag_move, NULL);
    ecore_x_dnd_begin(xwin, (unsigned char *)&xdnd, sizeof(Elm_Sel_Type));
    evas_object_event_callback_add(obj, EVAS_CALLBACK_MOUSE_UP,
                                   _drag_mouse_up, NULL);
-   
+
    handler_status = ecore_event_handler_add(ECORE_X_EVENT_XDND_STATUS,
                                             _dnd_status, NULL);
-   
+
    dragwin = elm_win_add(NULL, "Elm Drag Object", ELM_WIN_UTILITY);
    elm_win_override_set(dragwin, 1);
-   
+
    /* FIXME: Images only */
    icon = elm_icon_add(dragwin);
    elm_icon_file_set(icon, data + 7, NULL); /* 7!? "file://" */
@@ -1623,7 +1623,7 @@ elm_drag_start(Evas_Object *obj, Elm_Sel_Format format, const char *data, void (
    evas_object_move(dragwin, x, y);
    evas_object_resize(icon, w, h);
    evas_object_resize(dragwin, w, h);
-   
+
    evas_object_show(icon);
    evas_object_show(dragwin);
 
@@ -1640,10 +1640,10 @@ elm_cnp_tempfile_create(int size)
    Tmp_Info *info;
    const char *tmppath;
    int len;
-   
+
    info = malloc(sizeof(Tmp_Info));
    if (!info) return NULL;
-   
+
    tmppath = getenv("TMP");
    if (!tmppath) tmppath = P_tmpdir;
    if (!tmppath) tmppath = "/tmp";
@@ -1661,15 +1661,15 @@ elm_cnp_tempfile_create(int size)
         return NULL;
      }
    snprintf(info->filename,len,"%s/%sXXXXXX", tmppath, "elmcnpitem-");
-   
+
    info->fd = mkstemp(info->filename);
-   
+
 # ifdef __linux__
      {
         char *tmp;
         /* And before someone says anything see POSIX 1003.1-2008 page 400 */
         long pid;
-        
+
         pid = (long)getpid();
         /* Use pid instead of /proc/self: That way if can be passed around */
         len = snprintf(NULL,0,"/proc/%li/fd/%i", pid, info->fd);
@@ -1684,7 +1684,7 @@ elm_cnp_tempfile_create(int size)
           }
      }
 # endif
-   
+
    cnp_debug("filename is %s\n", info->filename);
    if (size < 1)
      {
@@ -1693,7 +1693,7 @@ elm_cnp_tempfile_create(int size)
         info->len = 0;
         return info;
      }
-   
+
    /* Map it in */
    if (ftruncate(info->fd, size))
      {
@@ -1702,7 +1702,7 @@ elm_cnp_tempfile_create(int size)
         info->len = 0;
         return info;
      }
-   
+
    info->map = mmap(NULL, size, PROT_READ|PROT_WRITE, MAP_SHARED, info->fd, 0);
    if (info->map == MAP_FAILED)
      {
@@ -1710,7 +1710,7 @@ elm_cnp_tempfile_create(int size)
         info->map = NULL;
         info->len = 0;
      }
-   
+
    return info;
 }
 
index bd58cc4..ed68871 100644 (file)
@@ -84,8 +84,8 @@ static void _set_color(Evas_Object *obj, int r, int g, int b, int a);
 
 static const Evas_Smart_Cb_Description _signals[] =
 {
-   {SIG_CHANGED, ""},
-   {NULL, NULL}
+     {SIG_CHANGED, ""},
+     {NULL, NULL}
 };
 
 static void
@@ -258,35 +258,35 @@ _hsl_to_rgb(void *data)
         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;
+              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);
@@ -357,79 +357,79 @@ _draw_rects(void *data, double x)
 
    switch (cp->color_type)
      {
-     case HUE:
-        wd->h = 360.0 * x;
-
-        if (x < one_six)
-          {
-             wd->er = 255;
-             wd->eg = (255.0 * x * 6.0);
-             wd->eb = 0;
-          }
-        else if (x < 2 * one_six)
-          {
-             wd->er = 255 - (int)(255.0 * (x - one_six) * 6.0);
-             wd->eg = 255;
-             wd->eb = 0;
-          }
-        else if (x < 3 * one_six)
-          {
-             wd->er = 0;
-             wd->eg = 255;
-             wd->eb = (int)(255.0 * (x - (2.0 * one_six)) * 6.0);
-          }
-        else if (x < 4 * one_six)
-          {
-             wd->er = 0;
-             wd->eg = 255 - (int)(255.0 * (x - (3.0 * one_six)) * 6.0);
-             wd->eb = 255;
-          }
-        else if (x < 5 * one_six)
-          {
-             wd->er = 255.0 * (x - (4.0 * one_six)) * 6.0;
-             wd->eg = 0;
-             wd->eb = 255;
-          }
-        else
-          {
-             wd->er = 255;
-             wd->eg = 0;
-             wd->eb = 255 - (int)(255.0 * (x - (5.0 * one_six)) * 6.0);
-          }
-
-        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);
-        evas_object_color_set(wd->cp[2]->bg_rect, wd->er, wd->eg, wd->eb, 255);
-        evas_object_color_set(wd->cp[3]->bar, 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);
-
-        _color_with_lightness(wd);
-        evas_object_color_set(wd->cp[2]->arrow, wd->lr, wd->lg, wd->lb, 255);
-
-        evas_object_color_set(wd->cp[3]->arrow,
-                              (wd->er * wd->a) / 255,
-                              (wd->eg * wd->a) / 255,
-                              (wd->eb * wd->a) / 255,
-                              wd->a);
-        break;
-     case SATURATION:
-        wd->s = 1.0 - x;
-        _color_with_saturation(wd);
-        evas_object_color_set(wd->cp[1]->arrow, wd->sr, wd->sg, wd->sb, 255);
-        break;
-     case LIGHTNESS:
-        wd->l = x;
-        _color_with_lightness(wd);
-        evas_object_color_set(wd->cp[2]->arrow, wd->lr, wd->lg, wd->lb, 255);
-        break;
-     case ALPHA:
-        wd->a = 255.0 * x;
-        evas_object_color_set(wd->cp[3]->arrow, wd->er, wd->eg, wd->eb, wd->a);
-        break;
-     default:
-        break;
+      case HUE:
+         wd->h = 360.0 * x;
+
+         if (x < one_six)
+           {
+              wd->er = 255;
+              wd->eg = (255.0 * x * 6.0);
+              wd->eb = 0;
+           }
+         else if (x < 2 * one_six)
+           {
+              wd->er = 255 - (int)(255.0 * (x - one_six) * 6.0);
+              wd->eg = 255;
+              wd->eb = 0;
+           }
+         else if (x < 3 * one_six)
+           {
+              wd->er = 0;
+              wd->eg = 255;
+              wd->eb = (int)(255.0 * (x - (2.0 * one_six)) * 6.0);
+           }
+         else if (x < 4 * one_six)
+           {
+              wd->er = 0;
+              wd->eg = 255 - (int)(255.0 * (x - (3.0 * one_six)) * 6.0);
+              wd->eb = 255;
+           }
+         else if (x < 5 * one_six)
+           {
+              wd->er = 255.0 * (x - (4.0 * one_six)) * 6.0;
+              wd->eg = 0;
+              wd->eb = 255;
+           }
+         else
+           {
+              wd->er = 255;
+              wd->eg = 0;
+              wd->eb = 255 - (int)(255.0 * (x - (5.0 * one_six)) * 6.0);
+           }
+
+         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);
+         evas_object_color_set(wd->cp[2]->bg_rect, wd->er, wd->eg, wd->eb, 255);
+         evas_object_color_set(wd->cp[3]->bar, 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);
+
+         _color_with_lightness(wd);
+         evas_object_color_set(wd->cp[2]->arrow, wd->lr, wd->lg, wd->lb, 255);
+
+         evas_object_color_set(wd->cp[3]->arrow,
+                               (wd->er * wd->a) / 255,
+                               (wd->eg * wd->a) / 255,
+                               (wd->eb * wd->a) / 255,
+                               wd->a);
+         break;
+      case SATURATION:
+         wd->s = 1.0 - x;
+         _color_with_saturation(wd);
+         evas_object_color_set(wd->cp[1]->arrow, wd->sr, wd->sg, wd->sb, 255);
+         break;
+      case LIGHTNESS:
+         wd->l = x;
+         _color_with_lightness(wd);
+         evas_object_color_set(wd->cp[2]->arrow, wd->lr, wd->lg, wd->lb, 255);
+         break;
+      case ALPHA:
+         wd->a = 255.0 * x;
+         evas_object_color_set(wd->cp[3]->arrow, wd->er, wd->eg, wd->eb, wd->a);
+         break;
+      default:
+         break;
      }
    _hsl_to_rgb(wd);
 }
@@ -805,7 +805,7 @@ elm_colorselector_add(Evas_Object *parent)
    Evas *e;
 
    ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
-   
+
    ELM_SET_WIDTYPE(widtype, "colorselector");
    elm_widget_type_set(obj, "colorselector");
    elm_widget_sub_object_add(parent, obj);