Merge "[*][button] change _sizing_eval for scale"
authorJaehwan Kim <jae.hwan.kim@samsung.com>
Wed, 21 Sep 2011 10:48:17 +0000 (19:48 +0900)
committerGerrit Code Review <git@Maetan>
Wed, 21 Sep 2011 10:48:17 +0000 (19:48 +0900)
17 files changed:
TC/elm_ts/controlbar/Makefile
TC/elm_ts/controlbar/tslist
TC/elm_ts/controlbar/utc_UIFW_elm_controlbar_item_disabled_set_func.c [moved from TC/elm_ts/controlbar/utc_UIFW_elm_controlbar_item_disable_set_func.c with 72% similarity]
TC/elm_ts/ctxpopup/Makefile
TC/elm_ts/editfield/Makefile
debian/changelog
src/lib/Elementary.h.in
src/lib/elc_ctxpopup.c
src/lib/elc_naviframe.c
src/lib/elc_navigationbar.c
src/lib/elc_navigationbar_ex.c
src/lib/elm_cnp_helper.c
src/lib/elm_colorpalette.c
src/lib/elm_entry.c
src/lib/elm_imageslider.c
src/lib/elm_multibuttonentry.c
src/modules/ctxpopup_copypasteUI/copypaste.c

index e54c9a4..464e297 100755 (executable)
@@ -17,7 +17,7 @@ TARGETS = utc_UIFW_elm_controlbar_add_func \
                  utc_UIFW_elm_controlbar_item_select_func \
                  utc_UIFW_elm_controlbar_item_visible_set_func \
                  utc_UIFW_elm_controlbar_item_visible_get_func \
-                 utc_UIFW_elm_controlbar_item_disable_set_func \
+                 utc_UIFW_elm_controlbar_item_disabled_set_func \
                  utc_UIFW_elm_controlbar_item_icon_set_func \
                  utc_UIFW_elm_controlbar_item_icon_get_func \
                  utc_UIFW_elm_controlbar_item_label_set_func \
index c0ddf16..1600429 100644 (file)
@@ -15,7 +15,7 @@
 /elm_ts/controlbar/utc_UIFW_elm_controlbar_item_select_func
 /elm_ts/controlbar/utc_UIFW_elm_controlbar_item_visible_set_func
 /elm_ts/controlbar/utc_UIFW_elm_controlbar_item_visible_get_func
-/elm_ts/controlbar/utc_UIFW_elm_controlbar_item_disable_set_func
+/elm_ts/controlbar/utc_UIFW_elm_controlbar_item_disabled_set_func
 /elm_ts/controlbar/utc_UIFW_elm_controlbar_item_icon_set_func
 /elm_ts/controlbar/utc_UIFW_elm_controlbar_item_icon_get_func
 /elm_ts/controlbar/utc_UIFW_elm_controlbar_item_label_set_func
@@ -38,8 +38,8 @@ static void cleanup(void);
 void (*tet_startup)(void) = startup;
 void (*tet_cleanup)(void) = cleanup;
 
-static void utc_UIFW_elm_controlbar_item_disable_set_func_01(void);
-static void utc_UIFW_elm_controlbar_item_disable_set_func_02(void);
+static void utc_UIFW_elm_controlbar_item_disabled_set_func_01(void);
+static void utc_UIFW_elm_controlbar_item_disabled_set_func_02(void);
 
 enum {
        POSITIVE_TC_IDX = 0x01,
@@ -47,8 +47,8 @@ enum {
 };
 
 struct tet_testlist tet_testlist[] = {
-       { utc_UIFW_elm_controlbar_item_disable_set_func_01, POSITIVE_TC_IDX },
-       { utc_UIFW_elm_controlbar_item_disable_set_func_02, NEGATIVE_TC_IDX },
+       { utc_UIFW_elm_controlbar_item_disabled_set_func_01, POSITIVE_TC_IDX },
+       { utc_UIFW_elm_controlbar_item_disabled_set_func_02, NEGATIVE_TC_IDX },
        { NULL, 0 }
 };
 
@@ -76,21 +76,21 @@ static void cleanup(void)
 }
 
 /**
- * @brief Positive test case of elm_controlbar_item_disable_set()
+ * @brief Positive test case of elm_controlbar_item_disabled_set()
  */
-static void utc_UIFW_elm_controlbar_item_disable_set_func_01(void)
+static void utc_UIFW_elm_controlbar_item_disabled_set_func_01(void)
 {
-       elm_controlbar_item_disable_set(item1, EINA_TRUE);
+       elm_controlbar_item_disabled_set(item1, EINA_TRUE);
 
        tet_result(TET_PASS);
 }
 
 /**
- * @brief Negative test case of ug_init elm_controlbar_item_disable_set()
+ * @brief Negative test case of ug_init elm_controlbar_item_disabled_set()
  */
-static void utc_UIFW_elm_controlbar_item_disable_set_func_02(void)
+static void utc_UIFW_elm_controlbar_item_disabled_set_func_02(void)
 {
-       elm_controlbar_item_disable_set(NULL, EINA_TRUE);
+       elm_controlbar_item_disabled_set(NULL, EINA_TRUE);
 
        tet_result(TET_PASS);
 }
index cbf81ca..6a42008 100755 (executable)
@@ -1,27 +1,25 @@
 CC ?= gcc
 
-TARGETS = uts_elm_ctxpopup_add_func \
-         uts_elm_ctxpopup_horizontal_set \
-         uts_elm_ctxpopup_horizontal_get \
-         uts_elm_ctxpopup_item_append \
-         uts_elm_ctxpopup_item_icon_set \
-         uts_elm_ctxpopup_item_label_set \
-         uts_elm_ctxpopup_item_del \
-         uts_elm_ctxpopup_item_disabled_set \
-     uts_elm_ctxpopup_item_disabled_get \
-     uts_elm_ctxpopup_clear \
-         uts_elm_ctxpopup_item_label_get \
-         uts_elm_ctxpopup_item_icon_get \
-     uts_elm_ctxpopup_direction_priority_set \
-     uts_elm_ctxpopup_direction_priority_get \
-         uts_elm_ctxpopup_content_set \
-     uts_elm_ctxpopup_content_unset \
-         uts_elm_ctxpopup_hover_parent_set \
-         uts_elm_ctxpopup_hover_parent_get
-           
-
-
-PKGS = elementary
+TARGETS = utc_UIFW_elm_ctxpopup_add_func \
+         utc_UIFW_elm_ctxpopup_horizontal_set_func \
+         utc_UIFW_elm_ctxpopup_horizontal_get_func \
+         utc_UIFW_elm_ctxpopup_item_append_func \
+         utc_UIFW_elm_ctxpopup_item_icon_set_func \
+         utc_UIFW_elm_ctxpopup_item_label_set_func \
+         utc_UIFW_elm_ctxpopup_item_del_func \
+         utc_UIFW_elm_ctxpopup_item_disabled_set_func \
+         utc_UIFW_elm_ctxpopup_item_disabled_get_func \
+         utc_UIFW_elm_ctxpopup_clear_func \
+         utc_UIFW_elm_ctxpopup_item_label_get_func \
+         utc_UIFW_elm_ctxpopup_item_icon_get_func \
+         utc_UIFW_elm_ctxpopup_direction_priority_set_func \
+         utc_UIFW_elm_ctxpopup_direction_priority_get_func \
+         utc_UIFW_elm_ctxpopup_content_set_func \
+         utc_UIFW_elm_ctxpopup_content_unset_func \
+         utc_UIFW_elm_ctxpopup_hover_parent_set_func \
+         utc_UIFW_elm_ctxpopup_hover_parent_get_func
+
+PKGS = elementary evas
 
 LDFLAGS = `pkg-config --libs $(PKGS)`
 LDFLAGS += $(TET_ROOT)/lib/tet3/tcm_s.o
@@ -34,8 +32,8 @@ CFLAGS += -Wall
 
 all: $(TARGETS)
 
-$(TARGET): %: %.c
-       $(CC) -o $@ $< $(CFLAGS) $(LDFLAGS)
+$(TARGETS): %: %.c
+       $(CC) $(CFLAGS) $< -o $@ $(LDFLAGS)
 
 clean:
        rm -f $(TARGETS)
index 68c9408..23821de 100755 (executable)
@@ -15,7 +15,7 @@ TARGETS = utc_UIFW_elm_editfield_add_func \
          utc_UIFW_elm_editfield_entry_eraser_set_func\
          utc_UIFW_elm_editfield_entry_eraser_get_func
 
-PKGS = elementary
+PKGS = elementary evas
 
 LDFLAGS = `pkg-config --libs $(PKGS)`
 LDFLAGS += $(TET_ROOT)/lib/tet3/tcm_s.o
@@ -28,8 +28,8 @@ CFLAGS += -Wall
 
 all: $(TARGETS)
 
-$(TARGET): %: %.c
-       $(CC) -o $@ $< $(CFLAGS) $(LDFLAGS)
+$(TARGETS): %: %.c
+       $(CC) $(CFLAGS) $< -o $@ $(LDFLAGS)
 
 clean:
        rm -f $(TARGETS)
index ed0b4ec..9913f2f 100644 (file)
@@ -1,3 +1,11 @@
+elementary (1.0.0+svn.61256slp2+build38) unstable; urgency=low
+
+  * Package Upload.
+  * Git: 165.213.180.234:slp/pkgs/e/elementary
+  * Tag: elementary_1.0.0+svn.61256slp2+build38
+
+ -- ChunEon Park <chuneon.park@samsung.com>  Wed, 21 Sep 2011 16:49:09 +0900
+
 elementary (1.0.0+svn.61256slp2+build37) unstable; urgency=low
 
   * Package Upload.
index 1bc75cd..cd2b022 100644 (file)
@@ -8274,6 +8274,7 @@ extern "C" {
    Eina_Bool         elm_navigationbar_ex_title_object_visible_get(Elm_Navigationbar_ex_Item* item);
 
   /* naviframe */
+  #define ELM_NAVIFRAME_ITEM_CONTENT "elm.swallow.content"
   #define ELM_NAVIFRAME_ITEM_ICON "elm.swallow.icon"
   #define ELM_NAVIFRAME_ITEM_OPTIONHEADER "elm.swallow.optionheader"
   #define ELM_NAVIFRAME_ITEM_TITLE_LABEL "elm.text.title"
@@ -8284,6 +8285,7 @@ extern "C" {
    EAPI Evas_Object        *elm_naviframe_add(Evas_Object *parent) EINA_ARG_NONNULL(1);
    EAPI Elm_Object_Item    *elm_naviframe_item_push(Evas_Object *obj, const char *title_label, Evas_Object *prev_btn, Evas_Object *next_btn, Evas_Object *content, const char *item_style) EINA_ARG_NONNULL(1, 5);
    EAPI Evas_Object        *elm_naviframe_item_pop(Evas_Object *obj) EINA_ARG_NONNULL(1);
+   EAPI void                elm_naviframe_item_pop_to(Elm_Object_Item *it) EINA_ARG_NONNULL(1);
    EAPI void                elm_naviframe_content_preserve_on_pop_set(Evas_Object *obj, Eina_Bool preserve) EINA_ARG_NONNULL(1);
    EAPI Eina_Bool           elm_naviframe_content_preserve_on_pop_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
    EAPI Elm_Object_Item    *elm_naviframe_top_item_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
index a890dec..c667b55 100644 (file)
@@ -407,60 +407,65 @@ _calc_base_geometry(Evas_Object *obj, Evas_Coord_Rectangle *rect)
    //In this case, all directions are invalid because of lack of space.
    if (idx == 4)
      {
-        //TODO 1: Find the largest space direction.
         Evas_Coord length[2];
 
-        length[0] = pos.y - hover_area.y;
-        length[1] = (hover_area.y + hover_area.h) - pos.y;
-
-        if (length[0] > length[1])
-           idx = ELM_CTXPOPUP_DIRECTION_UP;
+        if(!wd->horizontal)
+          {
+             length[0] = pos.y - hover_area.y;
+             length[1] = (hover_area.y + hover_area.h) - pos.y;
+
+             // ELM_CTXPOPUP_DIRECTION_UP
+             if (length[0] > length[1])
+               {
+                  _adjust_pos_x(&pos, &base_size, &hover_area);
+                  pos.y -= base_size.y;
+                  arrow = ELM_CTXPOPUP_DIRECTION_UP;
+                  if (pos.y < (hover_area.y + arrow_size.y))
+                    {
+                       base_size.y -= ((hover_area.y + arrow_size.y) - pos.y);
+                       pos.y = hover_area.y + arrow_size.y;
+                    }
+               }
+             //ELM_CTXPOPUP_DIRECTION_DOWN
+             else
+               {
+                  _adjust_pos_x(&pos, &base_size, &hover_area);
+                  arrow = ELM_CTXPOPUP_DIRECTION_DOWN;
+                  if ((pos.y + arrow_size.y + base_size.y) >
+                      (hover_area.y + hover_area.h))
+                     base_size.y -=
+                        ((pos.y + arrow_size.y + base_size.y) -
+                         (hover_area.y + hover_area.h));
+               }
+          }
         else
-           idx = ELM_CTXPOPUP_DIRECTION_DOWN;
-
-        //TODO 2: determine x , y
-        switch (idx)
           {
-           case ELM_CTXPOPUP_DIRECTION_UP:
-              _adjust_pos_x(&pos, &base_size, &hover_area);
-              pos.y -= base_size.y;
-              arrow = ELM_CTXPOPUP_DIRECTION_DOWN;
-              if (pos.y < hover_area.y + arrow_size.y)
-                {
-                   base_size.y -= ((hover_area.y + arrow_size.y) - pos.y);
-                   pos.y = hover_area.y + arrow_size.y;
-                }
-              break;
-           case ELM_CTXPOPUP_DIRECTION_LEFT:
-              _adjust_pos_y(&pos, &base_size, &hover_area);
-              pos.x -= base_size.x;
-              arrow = ELM_CTXPOPUP_DIRECTION_RIGHT;
-              if (pos.x < hover_area.x + arrow_size.x)
-                {
-                   base_size.x -= ((hover_area.x + arrow_size.x) - pos.x);
-                   pos.x = hover_area.x + arrow_size.x;
-                }
-              break;
-           case ELM_CTXPOPUP_DIRECTION_RIGHT:
-              _adjust_pos_y(&pos, &base_size, &hover_area);
-              arrow = ELM_CTXPOPUP_DIRECTION_LEFT;
-              if (pos.x + arrow_size.x + base_size.x >
-                  hover_area.x + hover_area.w)
-                 base_size.x -=
-                    ((pos.x + arrow_size.x + base_size.x) -
-                     (hover_area.x + hover_area.w));
-              break;
-           case ELM_CTXPOPUP_DIRECTION_DOWN:
-              _adjust_pos_x(&pos, &base_size, &hover_area);
-              arrow = ELM_CTXPOPUP_DIRECTION_UP;
-              if (pos.y + arrow_size.y + base_size.y >
-                  hover_area.y + hover_area.h)
-                 base_size.y -=
-                    ((pos.y + arrow_size.y + base_size.y) -
-                     (hover_area.y + hover_area.h));
-              break;
-           default:
-              break;
+             length[0] = pos.x - hover_area.x;
+             length[1] = (hover_area.x + hover_area.w) - pos.x;
+
+             //ELM_CTXPOPUP_DIRECTION_LEFT
+             if (length[0] > length[1])
+               {
+                  _adjust_pos_y(&pos, &base_size, &hover_area);
+                  pos.x -= base_size.x;
+                  arrow = ELM_CTXPOPUP_DIRECTION_LEFT;
+                  if (pos.x < (hover_area.x + arrow_size.x))
+                    {
+                       base_size.x -= ((hover_area.x + arrow_size.x) - pos.x);
+                       pos.x = hover_area.x + arrow_size.x;
+                    }
+               }
+             //ELM_CTXPOPUP_DIRECTION_RIGHT
+             else
+               {
+                  _adjust_pos_y(&pos, &base_size, &hover_area);
+                  arrow = ELM_CTXPOPUP_DIRECTION_RIGHT;
+                  if (pos.x + (arrow_size.x + base_size.x) >
+                      hover_area.x + hover_area.w)
+                     base_size.x -=
+                        ((pos.x + arrow_size.x + base_size.x) -
+                         (hover_area.x + hover_area.w));
+               }
           }
      }
 
index dc24e21..f76e5ab 100644 (file)
@@ -136,7 +136,7 @@ _del_hook(Evas_Object *obj)
    wd = elm_widget_data_get(obj);
    if (!wd) return;
 
-   EINA_LIST_FOREACH(wd->stack, list, it)
+   EINA_LIST_REVERSE_FOREACH(wd->stack, list, it)
      _item_del(it);
    eina_list_free(wd->stack);
    free(wd);
@@ -618,11 +618,9 @@ _item_del(Elm_Naviframe_Item *it)
    eina_list_free(it->content_list);
    eina_list_free(it->text_list);
 
-   evas_object_del(it->base.view);
-
    wd->stack = eina_list_remove(wd->stack, it);
 
-   free(it);
+   elm_widget_item_del(it);
 }
 
 static void
@@ -761,14 +759,13 @@ elm_naviframe_item_push(Evas_Object *obj, const char *title_label, Evas_Object *
                                    "elm,action,popped,finished",
                                    "",
                                    _popped_finished, it);
-   elm_naviframe_item_style_set(ELM_CAST(it), item_style);
-
-   //title
    edje_object_signal_callback_add(it->base.view,
                                    "elm,action,title,clicked",
-                                   "elm",
+                                   "",
                                    _title_clicked, it);
 
+   elm_naviframe_item_style_set(ELM_CAST(it), item_style);
+
    _item_text_set_hook(ELM_CAST(it), "elm.text.title", title_label);
 
    //title buttons
@@ -843,6 +840,29 @@ elm_naviframe_item_pop(Evas_Object *obj)
 }
 
 EAPI void
+elm_naviframe_item_pop_to(Elm_Object_Item *it)
+{
+   ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
+   Elm_Naviframe_Item *navi_it = ELM_CAST(it);
+   Widget_Data *wd = elm_widget_data_get(navi_it->base.widget);
+   Eina_List *l, *prev_l;
+
+   if (it == elm_naviframe_top_item_get(navi_it->base.widget)) return;
+
+   l = eina_list_last(wd->stack)->prev;
+
+   while(l)
+     {
+        if (l->data == it) break;
+        prev_l = l->prev;
+        _item_del(l->data);
+        wd->stack = eina_list_remove(wd->stack, l);
+        l = prev_l;
+     }
+   elm_naviframe_item_pop(navi_it->base.widget);
+}
+
+EAPI void
 elm_naviframe_content_preserve_on_pop_set(Evas_Object *obj, Eina_Bool preserve)
 {
    ELM_CHECK_WIDTYPE(obj, widtype);
index 3a931bd..8a33a0f 100644 (file)
@@ -37,6 +37,7 @@ typedef enum
 struct _Widget_Data
 {
    Eina_List *stack;
+   Evas_Object *rect;
    Evas_Object *base;
    Evas_Object *pager;
    Eina_Bool title_visible : 1;
@@ -349,10 +350,37 @@ _item_sizing_eval(Elm_Navigationbar_Item *it)
 static void
 _resize(void *data __UNUSED__, Evas *e  __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
 {
+   Widget_Data *wd = elm_widget_data_get(obj);
+   if (!wd) return;
+
+   Evas_Coord w, h;
+   evas_object_geometry_get(obj, NULL, NULL, &w, &h);
+   evas_object_resize(wd->rect, w, h);
+
    _sizing_eval(obj);
 }
 
 static void
+_hide(void *data __UNUSED__, Evas *e  __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
+{
+   Widget_Data *wd = elm_widget_data_get(obj);
+   if (!wd) return;
+
+   evas_object_hide(wd->rect);
+}
+
+static void
+_move(void *data __UNUSED__, Evas *e  __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
+{
+   Widget_Data *wd = elm_widget_data_get(obj);
+   if (!wd) return;
+
+   Evas_Coord x, y;
+   evas_object_geometry_get(obj, &x, &y, NULL, NULL);
+   evas_object_move(wd->rect, x, y);
+}
+
+static void
 _titleobj_switching(Evas_Object *obj, Elm_Navigationbar_Item *it)
 {
    Widget_Data *wd = elm_widget_data_get(obj);
@@ -457,6 +485,7 @@ _transition_complete_cb(void *data)
              else
                edje_object_signal_emit(wd->base, "elm,action,push", "elm");
              evas_object_pass_events_set(wd->base, EINA_TRUE);
+             evas_object_show(wd->rect);
           }
         if (it->title_obj)
           {
@@ -517,6 +546,7 @@ _hide_finished(void *data, Evas_Object *obj __UNUSED__, void *event_info)
    wd->popping = EINA_FALSE;
    evas_object_smart_callback_call(navi_bar, SIG_HIDE_FINISHED, event_info);
    evas_object_pass_events_set(wd->base, EINA_FALSE);
+   evas_object_hide(wd->rect);
 }
 
 static void
@@ -655,11 +685,18 @@ elm_navigationbar_add(Evas_Object *parent)
    edje_object_part_swallow(wd->base, "elm.swallow.content", wd->pager);
    evas_object_smart_callback_add(wd->pager, "hide,finished", _hide_finished, obj);
    evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, _resize, NULL);
+   evas_object_event_callback_add(obj, EVAS_CALLBACK_MOVE, _move, NULL);
+   evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE, _hide, NULL);
 
    wd->title_visible = EINA_TRUE;
 
    evas_object_smart_callbacks_descriptions_set(obj, _signals);
 
+   //Rect
+   wd->rect = evas_object_rectangle_add(e);
+   evas_object_color_set(wd->rect, 0, 0, 0, 0);
+   elm_widget_sub_object_add(obj, wd->rect);
+
    //TODO: apply elm_object_disabled_set
 
    return obj;
index 2c9a1b1..a890bb6 100644 (file)
@@ -561,7 +561,7 @@ elm_navigationbar_ex_item_push(Evas_Object *obj, Evas_Object *content, const cha
 \r
    strncpy(buf, "item/", sizeof(buf));\r
    strncat(buf, item_style, sizeof(buf) - strlen(buf));\r
-   if (!eina_stringshare_replace(&it->item_style, item_style)) return NULL;\r
+   eina_stringshare_replace(&it->item_style, item_style);\r
    _elm_theme_object_set(obj, it->base,  "navigationbar_ex", buf, elm_widget_style_get(obj));\r
 \r
 \r
index dac89ad..dd99db6 100644 (file)
@@ -163,6 +163,7 @@ static int vcard_receive(Cnp_Selection *sed, Ecore_X_Event_Selection_Notify *not
 static Paste_Image *pasteimage_alloc(const char *file, int pathlen);
 static Eina_Bool pasteimage_append(Paste_Image *pi, Evas_Object *entry);
 static void pasteimage_free(Paste_Image *pi);
+static void entry_insert_filter(Evas_Object* entry, char* str);
 
 /* Optimisation: Turn this into a 256 byte table:
  *     then can lookup in one index, not N checks */
@@ -1428,8 +1429,6 @@ is_uri_type_data(Cnp_Selection *sel __UNUSED__, Ecore_X_Event_Selection_Notify *
    cnp_debug("Got %s\n", p);
    if (strncmp(p, "file://", 7))
      {
-        /* elm_selection_set send target notify->data just "x" */
-        if (*p == 'x') return EINA_TRUE;
         if (*p != '/') return EINA_FALSE;
      }
 
@@ -1459,11 +1458,11 @@ notify_handler_targets(Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *notif
           {
              if ((atoms[j].atom == atomlist[i]) && (atoms[j].notify))
                {
-                  if ((j == CNP_ATOM_text_uri) ||
+/*                  if ((j == CNP_ATOM_text_uri) ||
                       (j == CNP_ATOM_text_urilist))
                     {
                       if(!is_uri_type_data(sel, notify)) continue;
-                    }
+                    }*/
                   cnp_debug("Atom %s matches\n",atoms[j].name);
                   goto done;
                }
@@ -1520,6 +1519,69 @@ found:
    return 0;
 }
 
+static void
+entry_insert_filter(Evas_Object* entry, char* str)
+{
+   if (!entry || !str)
+     return;
+
+   char *insertStr = str;
+   // if entry has text only set then remove item tags
+   if (elm_entry_cnp_textonly_get(entry))
+     {
+        while (EINA_TRUE)
+          {
+             char *startTag = NULL;
+             char *endTag = NULL;
+
+             startTag = strstr(insertStr, "<item");
+             if (!startTag)
+               startTag = strstr(insertStr, "</item");
+             if (startTag)
+               endTag = strstr(insertStr, ">");
+             else
+               break;
+             if (!endTag || startTag > endTag)
+               {
+                  cnp_debug("Broken tag: %s\n", str);
+                  break;
+               }
+
+             size_t sindex = startTag - insertStr;
+             size_t eindex = endTag - insertStr + 1;
+
+             Eina_Strbuf *buf = eina_strbuf_new();
+             if (buf)
+               {
+                  eina_strbuf_append(buf, insertStr);
+                  eina_strbuf_remove(buf, sindex, eindex);
+                  insertStr = eina_strbuf_string_steal(buf);
+                  eina_strbuf_free(buf);
+               }
+          }
+     }
+   cnp_debug("remove item tag: %s\n", insertStr);
+
+   // if entry has single line set then remove <br> & <ps> tags
+   if (elm_entry_single_line_get(entry))
+     {
+        Eina_Strbuf *buf = eina_strbuf_new();
+        if (buf)
+          {
+             eina_strbuf_append(buf, insertStr);
+             eina_strbuf_replace_all(buf, "<br>", "");
+             eina_strbuf_replace_all(buf, "<ps>", "");
+             insertStr = eina_strbuf_string_steal(buf);
+             eina_strbuf_free(buf);
+          }
+     }
+   cnp_debug("remove break tag: %s\n", insertStr);
+
+   elm_entry_entry_insert(entry, insertStr);
+
+   if (insertStr != str)
+     free(insertStr);
+}
 
 static int
 notify_handler_text(Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *notify)
@@ -1546,7 +1608,8 @@ notify_handler_text(Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *notify)
    cnp_debug("Notify handler text %d %d %p\n", data->format,data->length, data->data);
    str = mark_up((char *)data->data, data->length, NULL);
    cnp_debug("String is %s (from %s)\n", str, data->data);
-   elm_entry_entry_insert(sel->requestwidget, str);
+   entry_insert_filter(sel->requestwidget, str);
+   //elm_entry_entry_insert(sel->requestwidget, str);
    free(str);
    return 0;
 }
@@ -1740,7 +1803,8 @@ notify_handler_edje(Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *notify)
         sel->datacb(sel->udata, sel->widget, &ddata);
      }
    else
-     elm_entry_entry_insert(sel->requestwidget, stripstr);
+     entry_insert_filter(sel->requestwidget, stripstr);
+     //elm_entry_entry_insert(sel->requestwidget, stripstr);
 
    cnp_debug("String is %s (%d bytes)\n", stripstr, data->length);
    free(stripstr);
@@ -1775,7 +1839,8 @@ notify_handler_html(Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *notify)
         sel->datacb(sel->udata, sel->widget, &ddata);
      }
    else
-     elm_entry_entry_insert(sel->requestwidget, stripstr);
+     entry_insert_filter(sel->requestwidget, stripstr);
+     //elm_entry_entry_insert(sel->requestwidget, stripstr);
 
    cnp_debug("String is %s (%d bytes)\n", stripstr, data->length);
    free(stripstr);
@@ -2064,6 +2129,7 @@ pasteimage_append(Paste_Image *pi, Evas_Object *entry)
 
    if (!pi) return EINA_FALSE;
    if (!entry) return EINA_FALSE;
+   if (elm_entry_cnp_textonly_get(entry)) return EINA_FALSE;
 
    pasteimage_provider_set(entry);
 
index 3f0fd32..ce971c6 100644 (file)
  *
  */
 
-
 #define MAX_NUM_COLORS 30
 
 typedef struct _Colorpalette_Item Colorpalette_Item;
+typedef struct _Widget_Data Widget_Data;
+
 struct _Colorpalette_Item
 {
-   Evas_Object *parent;
+   Evas_Object *obj;
    Evas_Object *lo;
    Evas_Object *cr;
    unsigned int r, g, b;
 };
 
-
-typedef struct _Widget_Data Widget_Data;
 struct _Widget_Data
 {
-   Evas_Object *parent;
-   Evas_Object *lay;
+   Evas_Object *base;
    Evas_Object *tab;
-
-   Evas_Coord x, y, w, h;
-   Evas_Coord tab_w, tab_h;
-   Evas_Coord rect_w, rect_h;
-
-   unsigned int row, col;
    Elm_Colorpalette_Color *color;
-
    Eina_List *items;
-
+   unsigned int row, col;
    unsigned int num;
 };
 
+static const char *widtype = NULL;
 static void _del_hook(Evas_Object *obj);
 static void _theme_hook(Evas_Object *obj);
 static void _sizing_eval(Evas_Object *obj);
-
-static void _colorpalette_object_move(void *data, Evas *e, Evas_Object *obj, void *event_info);
 static void _colorpalette_object_resize(void *data, Evas *e, Evas_Object *obj, void *event_info);
-static void _colorpalette_object_show(void *data, Evas *e, Evas_Object *obj, void *event_info);
-static void _colorpalette_object_hide(void *data, Evas *e, Evas_Object *obj, void *event_info);
-
 static void _color_select_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
 static void _color_release_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
 static void _color_table_delete(Evas_Object *obj);
-static void _color_table_update(Evas_Object *obj, int row, int col, int color_num, Elm_Colorpalette_Color *color);
+static void _color_table_update(Evas_Object *obj, unsigned int row, unsigned int col, unsigned int color_num, Elm_Colorpalette_Color *color);
 
 static void
 _del_hook(Evas_Object *obj)
 {
    Widget_Data *wd = elm_widget_data_get(obj);
-
    if (!wd) return;
-
    _color_table_delete(obj);
-
-   if (wd->color){
+   if (wd->color)
+     {
         free(wd->color);
-   }
-
-   if (wd->lay){
-        evas_object_smart_member_del(wd->lay);
-        evas_object_del(wd->lay);
-        wd->lay = NULL;
-   }
+     }
    free(wd);
 }
 
@@ -86,261 +65,173 @@ static void
 _theme_hook(Evas_Object *obj)
 {
    Widget_Data *wd = elm_widget_data_get(obj);
-   if (!wd)
-      return;
-
-   _elm_theme_object_set(obj, wd->lay, "colorpalette", "bg", elm_widget_style_get(obj));
+   _elm_theme_object_set(obj, wd->base, "colorpalette", "base", elm_widget_style_get(obj));
    _color_table_update(obj, wd->row, wd->col, wd->num, wd->color);
    _sizing_eval(obj);
-
 }
 
 static void
 _sizing_eval(Evas_Object *obj)
 {
-   Widget_Data *wd = elm_widget_data_get(obj);
-
-   if (!wd)
-      return;
-
-   _colorpalette_object_move(obj, NULL, obj, NULL);
-   _colorpalette_object_resize(obj, NULL, obj, NULL);
-}
-
-
-static void _colorpalette_object_move(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
-{
-   DBG("%s", __func__);
-
-   Widget_Data *wd;
-   Evas_Coord x, y;
-
-   if(!data)
-      return;
-
-   wd = elm_widget_data_get((Evas_Object *)data);
-
-   if(!wd)
-      return;
-
-   evas_object_geometry_get(wd->lay, &x, &y, NULL, NULL);
-
-   wd->x = x;
-   wd->y = y;
-
-   evas_object_move(wd->lay, x, y);
-}
-
-
-static void _colorpalette_object_resize(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
-{
-   Widget_Data *wd;
+   Widget_Data *wd = NULL;
    Colorpalette_Item *item = NULL;
-   Evas_Coord w, h;
-   Evas_Coord tab_w, tab_h;
-   double pad_x, pad_y;
-
-   if(!data)
-      return;
-
-   wd = elm_widget_data_get((Evas_Object *)data);
-
-   if(!wd)
-      return;
-
-   evas_object_geometry_get(wd->lay, NULL, NULL, &w, &h);
-   wd->w = w;
-   wd->h = h;
-
-   evas_object_geometry_get(wd->tab, NULL, NULL, &tab_w, &tab_h);
-   if (tab_w > 0 && tab_h > 0) {
-        wd->tab_w = tab_w;
-        wd->tab_h = tab_h;
-   }
-
+   Evas_Coord tab_w = 0, tab_h = 0;
+   Evas_Coord pad_x = 0, pad_y = 0;
+   Evas_Coord rect_w = 0, rect_h = 0;
+   Evas_Coord minw = -1, minh = -1;
+
+   wd = elm_widget_data_get((Evas_Object *)obj);
+   elm_coords_finger_size_adjust(1, &minw, 1, &minh);
+   edje_object_size_min_restricted_calc(wd->base, &minw, &minh, minw, minh);
+   evas_object_size_hint_min_set(obj, minw, minh);
+   evas_object_size_hint_max_set(obj, -1, -1);
+
+   edje_object_part_geometry_get(wd->base,"bg" ,NULL, NULL, &tab_w, &tab_h);
    if (wd->items)
-      item = wd->items->data;
-
-   edje_object_part_geometry_get(elm_layout_edje_get(item->lo),"bg" ,NULL, NULL, &wd->rect_w, &wd->rect_h);
-
-   pad_x = ((double)wd->tab_w - (double)wd->rect_w * (double)wd->col) / (double)(wd->col - 1);
-   pad_y = ((double)wd->tab_h - (double)wd->rect_h * (double)wd->row) / (double)(wd->row - 1);
-
-   if (pad_x < 0.0 )
-      pad_x = 0;
-   if (pad_y < 0.0 )
-      pad_y = 0;
-
-   elm_table_padding_set(wd->tab, (int)pad_x , (int)pad_y);
-
-   if(!wd->lay)
-      return;
-
-   evas_object_resize(wd->lay, w, h);
-}
-
-
-static void _colorpalette_object_show(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
-{
-   DBG("%s", __func__);
-
-   Widget_Data *wd = NULL;
-
-   if(data == NULL)
-      return;
-
-   wd = elm_widget_data_get((Evas_Object *)data);
-
-
-   if(wd == NULL)
-      return;
-
-   if (wd->lay) {
-        evas_object_show(wd->lay);
-   }
+     item = wd->items->data;
+   edje_object_part_geometry_get(elm_layout_edje_get(item->lo),"bg" ,NULL, NULL, &rect_w, &rect_h);
+   if (wd->col - 1) /*value cannot be 0 else divide by zero error will cause floating point exception*/
+     pad_x = (tab_w - (rect_w * wd->col)) / (wd->col - 1);
+   if (wd->row - 1) /*value cannot be 0 else divide by zero error will cause floating point exception*/
+     pad_y = (tab_h - (rect_h * wd->row)) / (wd->row - 1);
+   elm_table_padding_set(wd->tab, pad_x, pad_y);
+   elm_table_homogeneous_set(wd->tab, EINA_TRUE);
 }
 
-static void _colorpalette_object_hide(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
+static void _colorpalette_object_resize(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
 {
-   DBG("%s", __func__);
-
-   Widget_Data *wd = NULL;
-
-   if(data == NULL)
-      return;
-
-   wd = elm_widget_data_get((Evas_Object *)data);
-
-   if(wd == NULL)
-      return;
-
-   if (wd->lay) {
-        evas_object_hide(wd->lay);
-   }
+   _sizing_eval(data);
 }
 
 static void _color_select_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
 {
-   Colorpalette_Item *item = (Colorpalette_Item *) data;
    Elm_Colorpalette_Color *color;
-
+   Colorpalette_Item *item = (Colorpalette_Item *) data;
    color = ELM_NEW(Elm_Colorpalette_Color);
-
+   if (!color) return;
    color->r = item->r;
    color->g = item->g;
    color->b = item->b;
-
-   evas_object_smart_callback_call(item->parent, "clicked", color);
-
+   evas_object_smart_callback_call(item->obj, "clicked", color);
    edje_object_signal_emit(elm_layout_edje_get(item->lo), "focus_visible", "elm");
 }
 
-
 static void _color_release_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
 {
    Colorpalette_Item *item = (Colorpalette_Item *) data;
    edje_object_signal_emit(elm_layout_edje_get(item->lo), "focus_invisible", "elm");
 }
 
-
 static void _color_table_delete(Evas_Object *obj)
 {
    Widget_Data *wd = NULL;
    Colorpalette_Item *item;
    wd = elm_widget_data_get(obj);
 
-   if (!wd) return;
-
-   if (wd->items) {
-        EINA_LIST_FREE(wd->items, item) {
-             if (item->lo){
+   if (wd->items)
+     {
+        EINA_LIST_FREE(wd->items, item)
+          {
+             if (item->lo)
+               {
                   evas_object_del(item->lo);
                   item->lo = NULL;
-             }
-             if (item->cr){
+               }
+             if (item->cr)
+               {
                   evas_object_del(item->cr);
                   item->cr = NULL;
-             }
+               }
              free(item);
-        }
-   }
-
-   if (wd->tab) {
-        edje_object_part_unswallow(wd->lay, wd->tab);
-        evas_object_del(wd->tab);
-   }
+          }
+     }
+   if (wd->tab) evas_object_del(wd->tab);
 }
 
-
-static void _color_table_update(Evas_Object *obj, int row, int col, int color_num, Elm_Colorpalette_Color *color)
+static void _color_table_update(Evas_Object *obj, unsigned int row, unsigned int col, unsigned int color_num, Elm_Colorpalette_Color *color)
 {
    Widget_Data *wd = elm_widget_data_get(obj);
    Colorpalette_Item *item;
    Evas_Object *lo;
    Evas_Object *cr;
-   Evas *e;
-   int i, j, count;
-
-   if ( !wd )
-      return;
-
-   count = 0;
-
-   e = evas_object_evas_get(wd->parent);
+   unsigned int i, j, count;
 
    _color_table_delete(obj);
-
+   count = 0;
    wd->row = row;
    wd->col = col;
    wd->num = color_num;
 
    wd->tab = elm_table_add(obj);
-
    evas_object_size_hint_weight_set(wd->tab, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_size_hint_align_set(wd->tab, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   edje_object_part_swallow(wd->base, "palette", wd->tab);
 
-   edje_object_part_swallow(wd->lay, "palette", wd->tab);
-   evas_object_show(wd->tab);
-
-   for ( i = 0 ; i < row ; i++) {
-        for ( j = 0 ; j < col ; j++ ) {
+   for ( i = 0 ; i < row ; i++)
+     {
+        for ( j = 0 ; j < col ; j++ )
+          {
              item = ELM_NEW(Colorpalette_Item);
-             if (item){
+             if (item)
+               {
                   lo = elm_layout_add(obj);
                   elm_layout_theme_set(lo, "colorpalette", "base", "bg");
                   evas_object_size_hint_weight_set(lo, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
                   evas_object_size_hint_align_set(lo, EVAS_HINT_FILL, EVAS_HINT_FILL);
                   evas_object_show(lo);
-                  elm_table_pack(wd->tab, lo, j, i, 1, 1);
-
-                  item->parent = obj;
+                  elm_table_pack(wd->tab, lo, (int)j, (int)i, 1, 1);
+                  item->obj = obj;
                   item->lo = lo;
-
-                  if (count < color_num){
-                       cr =  edje_object_add(e);
+                  if (count < color_num)
+                    {
+                       cr =  edje_object_add(evas_object_evas_get(obj));
                        _elm_theme_object_set(obj, cr, "colorpalette", "base", "color");
                        evas_object_color_set(cr, color[count].r, color[count].g, color[count].b, 255);
                        evas_object_size_hint_weight_set(cr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
                        evas_object_size_hint_align_set(cr, EVAS_HINT_FILL, EVAS_HINT_FILL);
-
                        evas_object_event_callback_add(cr, EVAS_CALLBACK_MOUSE_DOWN, _color_select_cb, item);
                        evas_object_event_callback_add(cr, EVAS_CALLBACK_MOUSE_UP, _color_release_cb, item);
-
                        evas_object_show(cr);
                        edje_object_part_swallow(elm_layout_edje_get(lo), "color_rect", cr);
-
                        item->cr = cr;
                        item->r = color[count].r;
                        item->g = color[count].g;
                        item->b = color[count].b;
-                  }
+                    }
                   wd->items = eina_list_append(wd->items, item);
                   count ++;
-             }
-        }
-   }
+               }
+          }
+     }
+}
+
+static int
+_hex_string_get(char ch)
+{
+   if ((ch >= '0') && (ch <= '9')) return (ch - '0');
+   else if ((ch >= 'A') && (ch <= 'F')) return (ch - 'A' + 10);
+   else if ((ch >= 'a') && (ch <= 'f')) return (ch - 'a' + 10);
+   return 0;
 }
 
+static void
+_color_parse(const char *str, unsigned char *r, unsigned char *g, unsigned char *b)
+{
+   int slen;
+
+   slen = strlen(str);
+   *r = *g = *b = 0;
+
+   if (slen == 7) /* #RRGGBB */
+     {
+        *r = (_hex_string_get(str[1]) << 4) | (_hex_string_get(str[2]));
+        *g = (_hex_string_get(str[3]) << 4) | (_hex_string_get(str[4]));
+        *b = (_hex_string_get(str[5]) << 4) | (_hex_string_get(str[6]));
+     }
+   *r = (*r * 0xff) / 255;
+   *g = (*g * 0xff) / 255;
+   *b = (*b * 0xff) / 255;
+}
 
 /**
  * Add a new colorpalette to the parent.
@@ -355,48 +246,48 @@ EAPI Evas_Object *elm_colorpalette_add(Evas_Object *parent)
    Evas_Object *obj = NULL;
    Widget_Data *wd = NULL;
    Evas *e;
+   Eina_List *colors;
+   const Eina_List *l;
+   const char *color_code;
+   int color_num = 0;
+   int row = 0;
+   int col = 0;
+   int index = 0;
 
-   e = evas_object_evas_get(parent);
-   if (e == NULL) return NULL;
-   wd = ELM_NEW(Widget_Data);
-   obj = elm_widget_add(e);
+   ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
+
+   ELM_SET_WIDTYPE(widtype, "colorpalette");
    elm_widget_type_set(obj, "colorpalette");
    elm_widget_sub_object_add(parent, obj);
    elm_widget_data_set(obj, wd);
    elm_widget_del_hook_set(obj, _del_hook);
    elm_widget_theme_hook_set(obj, _theme_hook);
 
-   wd->parent = parent;
-   wd->lay = edje_object_add(e);
-   _elm_theme_object_set(obj, wd->lay, "colorpalette", "bg", "default");
-
-   evas_object_size_hint_weight_set(wd->lay, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-   if(wd->lay == NULL) {
-        printf("Cannot load bg edj\n");
-        return NULL;
-   }
-
-   wd->color = (Elm_Colorpalette_Color*) calloc (10, sizeof(Elm_Colorpalette_Color));
-
-   wd->color[0].r = 55; wd->color[0].g = 90; wd->color[0].b = 18;
-   wd->color[1].r = 255; wd->color[1].g = 213; wd->color[1].b = 0;
-   wd->color[2].r = 146; wd->color[2].g = 255; wd->color[2].b = 11;
-   wd->color[3].r = 9; wd->color[3].g = 186; wd->color[3].b = 10;
-   wd->color[4].r = 86; wd->color[4].g = 201; wd->color[4].b = 242;
-   wd->color[5].r = 18; wd->color[5].g = 83; wd->color[5].b = 128;
-   wd->color[6].r = 140; wd->color[6].g = 53; wd->color[6].b = 238;
-   wd->color[7].r = 255; wd->color[7].g = 145; wd->color[7].b = 145;
-   wd->color[8].r = 255; wd->color[8].g = 59; wd->color[8].b = 119;
-   wd->color[9].r = 133; wd->color[9].g = 100; wd->color[9].b = 69;
-
-   _color_table_update(obj, 2, 5, 10, wd->color);
-
-   elm_widget_resize_object_set(obj, wd->lay);
-   evas_object_event_callback_add(wd->lay, EVAS_CALLBACK_RESIZE, _colorpalette_object_resize, obj);
-   evas_object_event_callback_add(obj, EVAS_CALLBACK_MOVE, _colorpalette_object_move, obj);
-   evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _colorpalette_object_show, obj);
-   evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE, _colorpalette_object_hide, obj);
+   wd->base = edje_object_add(e);
+   _elm_theme_object_set(obj, wd->base, "colorpalette", "base", "default");
+   elm_widget_resize_object_set(obj, wd->base);
 
+   color_num = atoi(edje_object_data_get(wd->base, "color_num")); /* Need to get this value
+   from edc inorder to allocate memory in advance: Think of a better way*/
+   row = atoi(edje_object_data_get(wd->base, "row"));
+   col = atoi(edje_object_data_get(wd->base, "col"));
+   wd->color = (Elm_Colorpalette_Color*) calloc (color_num, sizeof(Elm_Colorpalette_Color));
+   colors = elm_widget_stringlist_get(edje_object_data_get(wd->base, "colors"));
+   EINA_LIST_FOREACH(colors, l, color_code)
+     {
+        unsigned char r, g, b;
+        /*Optimized color parsing algorithm*/
+        _color_parse(color_code, &r, &g, &b);
+        /*TODO: Make color storing structure and item also take unsigned char*/
+        wd->color[index].r = (unsigned int)r;
+        wd->color[index].g = (unsigned int)g;
+        wd->color[index].b = (unsigned int)b;
+        index++;
+     }
+   elm_widget_stringlist_free(colors);
+   _color_table_update(obj, row, col, color_num, wd->color);
+   evas_object_event_callback_add(wd->base, EVAS_CALLBACK_RESIZE, _colorpalette_object_resize, obj);
+   _sizing_eval(obj);
    return obj;
 }
 
@@ -412,26 +303,25 @@ EAPI Evas_Object *elm_colorpalette_add(Evas_Object *parent)
  */
 EAPI void elm_colorpalette_color_set(Evas_Object *obj, int color_num, Elm_Colorpalette_Color *color)
 {
+   ELM_CHECK_WIDTYPE(obj, widtype);
    Widget_Data *wd = elm_widget_data_get(obj);
    int i;
 
    if (color_num > MAX_NUM_COLORS) return;
-
    if (!wd) return;
 
-   if (wd->color) {
+   if (wd->color)
+     {
         free(wd->color);
         wd->color = NULL;
-   }
-
+     }
    wd->color = (Elm_Colorpalette_Color*) calloc (color_num, sizeof(Elm_Colorpalette_Color));
-
-   for ( i = 0 ; i < color_num ; i++) {
+   for (i = 0; i < color_num; i++)
+     {
         wd->color[i].r = color[i].r;
         wd->color[i].g = color[i].g;
         wd->color[i].b = color[i].b;
-   }
-
+     }
    _color_table_update(obj, wd->row, wd->col, color_num, wd->color);
    _sizing_eval(obj);
 }
@@ -447,12 +337,12 @@ EAPI void elm_colorpalette_color_set(Evas_Object *obj, int color_num, Elm_Colorp
  */
 EAPI void elm_colorpalette_row_column_set(Evas_Object *obj, int row, int col)
 {
+   ELM_CHECK_WIDTYPE(obj, widtype);
    Widget_Data *wd = elm_widget_data_get(obj);
-
-   if (!wd) return ;
-
+   if (!wd) return;
+   /*Row can be incomplete with atleast one color*/
+   if(((row-1)*col) > MAX_NUM_COLORS) return;
    _color_table_update(obj, row, col, wd->num, wd->color);
    _sizing_eval(obj);
 }
 
-/* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/
index b38cafa..17b0b2d 100644 (file)
@@ -125,7 +125,6 @@ struct _Widget_Data
    Ecore_Job *deferred_recalc_job;
    Ecore_Event_Handler *sel_notify_handler;
    Ecore_Event_Handler *sel_clear_handler;
-   Ecore_Timer *longpress_timer;
    Ecore_Timer *delay_write;
    /* for deferred appending */
    Ecore_Idler *append_text_idler;
@@ -601,7 +600,6 @@ _del_hook(Evas_Object *obj)
         wd->append_text_idler = NULL;
      }
    if (wd->matchlist_job) ecore_job_del(wd->matchlist_job);
-   if (wd->longpress_timer) ecore_timer_del(wd->longpress_timer);
    if (wd->mgf_proxy) evas_object_del(wd->mgf_proxy);
    if (wd->mgf_bg) evas_object_del(wd->mgf_bg);
    if (wd->mgf_clip) evas_object_del(wd->mgf_clip);
@@ -921,7 +919,6 @@ _on_focus_hook(void *data __UNUSED__, Evas_Object *obj)
    Widget_Data *wd = elm_widget_data_get(obj);
    Evas_Object *top = elm_widget_top_get(obj);
    if (!wd) return;
-   if (!wd->editable) return;
    if (elm_widget_focus_get(obj))
      {
         printf("[Elm_entry::Focused] obj : %p\n", obj);
@@ -1475,19 +1472,13 @@ _magnifier_create(void *data)
 }
 
 static Eina_Bool
-_long_press(void *data)
+_signal_long_pressed(void *data)
 {
    Widget_Data *wd = elm_widget_data_get(data);
    if (!wd) return ECORE_CALLBACK_CANCEL;
 
    wd->long_pressed = EINA_TRUE;
 
-   if (wd->longpress_timer)
-     {
-        ecore_timer_del(wd->longpress_timer);
-        wd->longpress_timer = NULL;
-     }
-
    _cancel(data, NULL, NULL);
 
    _magnifier_create(data);
@@ -1495,7 +1486,6 @@ _long_press(void *data)
    _magnifier_show(data);
    elm_object_scroll_freeze_push(data);
 
-   wd->longpress_timer = NULL;
    evas_object_smart_callback_call(data, SIG_LONGPRESSED, NULL);
    return ECORE_CALLBACK_CANCEL;
 }
@@ -1511,11 +1501,6 @@ _mouse_down(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void
    wd->downx = ev->canvas.x;
    wd->downy = ev->canvas.y;
    wd->long_pressed = EINA_FALSE;
-   if (ev->button == 1)
-     {
-        if (wd->longpress_timer) ecore_timer_del(wd->longpress_timer);
-        wd->longpress_timer = ecore_timer_add(_elm_config->longpress_timeout, _long_press, data);
-     }
 }
 
 static void
@@ -1530,25 +1515,13 @@ _mouse_up(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *
         if (!wd->double_clicked)
           {
              if ((wd->api) && (wd->api->obj_mouseup))
-               {
-                  wd->api->obj_mouseup(data);
-               }
+               wd->api->obj_mouseup(data);
           }
-
-        if (wd->longpress_timer)
-          {
-             ecore_timer_del(wd->longpress_timer);
-             wd->longpress_timer = NULL;
-          }
-
         _magnifier_hide(data);
         elm_object_scroll_freeze_pop(data);
 
         if (wd->long_pressed)
-          {
-             _menu_press(data);
-          }
-
+          _menu_press(data);
      }
    else if (ev->button == 3)
      {
@@ -1564,49 +1537,6 @@ _mouse_move(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void
    Evas_Event_Mouse_Move *ev = event_info;
    if (!wd) return;
    if (wd->disabled) return;
-   if (!wd->selmode)
-     {
-        if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
-          {
-             if (wd->longpress_timer)
-               {
-                  ecore_timer_del(wd->longpress_timer);
-                  wd->longpress_timer = NULL;
-               }
-          }
-        else if (wd->longpress_timer)
-          {
-             Evas_Coord dx, dy;
-
-             dx = wd->downx - ev->cur.canvas.x;
-             dx *= dx;
-             dy = wd->downy - ev->cur.canvas.y;
-             dy *= dy;
-             if ((dx + dy) >
-                 ((_elm_config->finger_size / 2) *
-                  (_elm_config->finger_size / 2)))
-               {
-                  ecore_timer_del(wd->longpress_timer);
-                  wd->longpress_timer = NULL;
-               }
-          }
-     }
-   else if (wd->longpress_timer)
-     {
-        Evas_Coord dx, dy;
-
-        dx = wd->downx - ev->cur.canvas.x;
-        dx *= dx;
-        dy = wd->downy - ev->cur.canvas.y;
-        dy *= dy;
-        if ((dx + dy) >
-            ((_elm_config->finger_size / 2) *
-             (_elm_config->finger_size / 2)))
-          {
-             ecore_timer_del(wd->longpress_timer);
-             wd->longpress_timer = NULL;
-          }
-     }
 
    if (ev->buttons == 1)
      {
@@ -1880,11 +1810,12 @@ _signal_preedit_changed(void *data, Evas_Object *obj __UNUSED__, const char *emi
    _entry_changed_common_handling(data, SIG_PREEDIT_CHANGED);
 }
 
-
 static void
 _signal_handler_move_start(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
 {
    Widget_Data *wd = elm_widget_data_get(data);
+   if (!wd) return;
+
    elm_object_scroll_freeze_push(data);
 
    if ((wd->api) && (wd->api->obj_hidemenu))
@@ -1901,6 +1832,8 @@ static void
 _signal_handler_move_end(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
 {
    Widget_Data *wd = elm_widget_data_get(data);
+   if (!wd) return;
+
    elm_object_scroll_freeze_pop(data);
 
    if (wd->have_selection)
@@ -1917,6 +1850,39 @@ _signal_handler_moving(void *data, Evas_Object *obj __UNUSED__, const char *emis
    _magnifier_show(data);
 }
 
+static Evas_Object *
+_viewport_obj_get(Evas_Object *data)
+{
+   Widget_Data *wd = elm_widget_data_get(data);
+   if (!wd) return NULL;
+
+   if(!data || !strlen(elm_widget_type_get(data)))
+     return NULL;
+
+   Evas_Coord x, y, w, h;
+   x = y = w = h = -1;
+
+   if (wd->scroll)
+     {
+        //evas_object_geometry_get(wd->scroller, &x, &y, &w, &h);
+        //printf(">>> wd->scroller (%d, %d, %d, %d) \n", x, y, w, h);
+        return wd->scroller;
+     }
+
+   Evas_Object *parent_obj = data;
+
+   while(parent_obj = elm_widget_parent_get(parent_obj))
+     {
+        //evas_object_geometry_get(parent_obj, &x, &y, &w, &h);
+        //printf(">>> %s (%d, %d, %d, %d) \n", elm_widget_type_get(parent_obj), x, y, w, h);
+        if (!strcmp(elm_widget_type_get(parent_obj), "scroller") ||
+            !strcmp(elm_widget_type_get(parent_obj), "genlist"))
+          return parent_obj;
+     }
+
+   return NULL;
+}
+
 static void
 _signal_selection_end(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
 {
@@ -1949,6 +1915,9 @@ _signal_selection_start(void *data, Evas_Object *obj __UNUSED__, const char *emi
           elm_selection_set(ELM_SEL_PRIMARY, data, ELM_SEL_FORMAT_MARKUP, txt);
      }
 #endif
+
+   if (!_elm_config->desktop_entry)
+     edje_object_part_text_viewport_object_set(wd->ent, "elm.text", _viewport_obj_get(data));
 }
 
 static void
@@ -2199,9 +2168,7 @@ _signal_mouse_down(void *data, Evas_Object *obj __UNUSED__, const char *emission
    evas_object_smart_callback_call(data, SIG_PRESS, NULL);
 
    if ((wd->api) && (wd->api->obj_hidemenu))
-     {
-        wd->api->obj_hidemenu(data);
-     }
+     wd->api->obj_hidemenu(data);
 }
 
 static void
@@ -2210,6 +2177,9 @@ _signal_mouse_clicked(void *data, Evas_Object *obj __UNUSED__, const char *emiss
    Widget_Data *wd = elm_widget_data_get(data);
    if (!wd) return;
    evas_object_smart_callback_call(data, SIG_CLICKED, NULL);
+
+   if (!_elm_config->desktop_entry && !wd->double_clicked)
+     _cancel(data, NULL, NULL);
 }
 
 static void
@@ -2820,6 +2790,8 @@ elm_entry_add(Evas_Object *parent)
                                    _signal_selection_start, obj);
    edje_object_signal_callback_add(wd->ent, "selection,end", "elm.text",
                                    _signal_selection_end, obj);
+   edje_object_signal_callback_add(wd->ent, "long,pressed", "elm.text",
+                                   _signal_long_pressed, obj);
    edje_object_signal_callback_add(wd->ent, "magnifier,changed", "elm.text",
                                    _signal_magnifier_changed, obj);
    edje_object_signal_callback_add(wd->ent, "selection,changed", "elm.text",
@@ -2905,7 +2877,6 @@ EAPI void elm_entry_extension_module_data_get(Evas_Object *obj,Elm_Entry_Extensi
    ext_mod->selectall = _selectall;
    ext_mod->ent = wd->ent;
    ext_mod->items = wd->items;
-   ext_mod->longpress_timer = wd->longpress_timer;
    ext_mod->editable = wd->editable;
    ext_mod->have_selection = wd->have_selection;
    ext_mod->password = wd->password;
index d3c112c..07d8b5b 100644 (file)
@@ -49,9 +49,6 @@ struct _Imageslider_Item
    const char *photo_file;
    void (*func) (void *data, Evas_Object *obj, void *event_info);
    void *data;
-   //Evas_Coord x, y, w, h;
-   //Evas_Coord ox, oy, ow, oh;
-   //int moving:1;
 };
 
 // Image Slider Widget Data.
@@ -76,12 +73,6 @@ struct _Widget_Data
    int move_cnt;
    int ani_lock:1;
    int moving:1;
-
-   Eina_Bool on_zoom:1;
-   int dx, dy, mx, my;
-   int mdx, mdy, mmx, mmy;
-   int dratio;
-   int ratio;
 };
 
 // Global value declaration.
@@ -103,7 +94,6 @@ static void _imageslider_hide(void *data, Evas * e, Evas_Object *obj, void *even
 static void _imageslider_update(Widget_Data * wd);
 
 static void _imageslider_update_pos(Widget_Data * wd, Evas_Coord x, Evas_Coord y, Evas_Coord w);
-static void _imageslider_update_center_pos(Widget_Data * wd, Evas_Coord x, Evas_Coord my, Evas_Coord y, Evas_Coord w);
 
 static void _imageslider_obj_shift(Widget_Data * wd, Eina_Bool left);
 
@@ -113,13 +103,10 @@ static Eina_Bool _icon_to_image(void *data);
 
 static int _check_drag(int state, void *data);
 
-static void _check_zoom(void *data);
-
 static void _anim(Widget_Data * wd);
 
 static Eina_Bool _timer_cb(void *data);
 
-//static void _signal_clicked(void *data, Evas_Object *obj, const char *emission, const char *source);
 static void _ev_imageslider_down_cb(void *data, Evas * e, Evas_Object *obj, void *event_info);
 static void _ev_imageslider_up_cb(void *data, Evas * e, Evas_Object *obj, void *event_info);
 static void _ev_imageslider_move_cb(void *data, Evas * e, Evas_Object *obj, void *event_info);
@@ -128,20 +115,11 @@ static void _ev_imageslider_move_cb(void *data, Evas * e, Evas_Object *obj, void
 static void
 _del_hook(Evas_Object *obj)
 {
-   int i;
-
    Widget_Data *wd;
 
    wd = elm_widget_data_get(obj);
 
-   if (!wd)
-      return;
-
-   for (i = 0; i < BLOCK_MAX; i++)
-     {
-       elm_widget_sub_object_del(wd->obj, wd->ly[i]);
-       evas_object_del(wd->ly[i]);
-     }
+   if (!wd) return;
 
    if (wd->its)
      {
@@ -161,8 +139,7 @@ _del_hook(Evas_Object *obj)
         wd->anim_timer = NULL;
      }
 
-   if (wd)
-      free(wd);
+   if (wd) free(wd);
 
 }
 
@@ -245,7 +222,7 @@ _imageslider_resize(void *data, Evas * e __UNUSED__, Evas_Object *obj, void *eve
      return;
 
    evas_object_geometry_get(obj, NULL, NULL, &w, &h);
-   fprintf(stderr, "%d %d -resize\n", w, h);
+   DBG("%d %d -resize\n", w, h);
    wd->w = w;
    wd->h = h;
 
@@ -292,30 +269,9 @@ _imageslider_hide(void *data, Evas * e __UNUSED__, Evas_Object *obj __UNUSED__,
 static void
 _imageslider_update_pos(Widget_Data * wd, Evas_Coord x, Evas_Coord y, Evas_Coord w)
 {
-   int i = 0;
    evas_object_move(wd->ly[BLOCK_LEFT], x - (w + INTERVAL_WIDTH), y);
    evas_object_move(wd->ly[BLOCK_CENTER], x, y);
    evas_object_move(wd->ly[BLOCK_RIGHT], x + (w + INTERVAL_WIDTH), y);
-   //making sure that the clipping happens for all three layouts based on clipper's geometry
-   for (i = 0; i < BLOCK_MAX; i++)
-     evas_object_clip_set(wd->ly[i], wd->clip);
-   evas_render_idle_flush(evas_object_evas_get(wd->obj));
-}
-
-// Update the center position of Image Slider item.
-static void
-_imageslider_update_center_pos(Widget_Data * wd, Evas_Coord x, Evas_Coord my __UNUSED__, Evas_Coord y, Evas_Coord w)
-{
-   Evas_Coord ix = 0, iy = 0, iw = 0, ih = 0;
-   const Evas_Object *eo = elm_layout_content_get((const Evas_Object*)(wd->ly[BLOCK_CENTER]), "swl.photo");
-   if (eo)
-     evas_object_geometry_get(eo, &ix, &iy, &iw, &ih);
-   if ((ix > 0) || (ix + iw < wd->w))
-     {
-        edje_object_signal_emit(elm_layout_edje_get(wd->ly[BLOCK_CENTER]), "block.on", "block");
-        _imageslider_update_pos(wd, x, y, w);
-        wd->on_zoom = EINA_FALSE;
-     }
 }
 
 // Shift next/previous Image Slider item in layouts.
@@ -392,12 +348,10 @@ _imageslider_obj_move(Widget_Data * wd, Evas_Coord step)
 
 // Whenever MOUSE DOWN event occurs, Call this function.
 static void
-_ev_imageslider_down_cb(void *data, Evas * e __UNUSED__, Evas_Object *obj, void *event_info)
+_ev_imageslider_down_cb(void *data, Evas * e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
 {
    Widget_Data *wd = data;
-   Evas_Coord ix = 0, iy = 0, iw = 0, ih = 0;
    Evas_Event_Mouse_Down *ev = event_info;
-   Evas_Object *eo = NULL;
 
    if (wd->ani_lock)
       return;
@@ -405,25 +359,6 @@ _ev_imageslider_down_cb(void *data, Evas * e __UNUSED__, Evas_Object *obj, void
    wd->down_pos = ev->canvas;
    wd->timestamp = ev->timestamp;
    wd->move_cnt = MOVE_STEP;
-
-   /*wd->dx = ev->canvas.x;
-   wd->dy = ev->canvas.y;
-   wd->mx = ev->canvas.x;
-   wd->my = ev->canvas.y;
-
-   wd->dratio = 1;
-   wd->ratio = 1;
-
-   eo = (Evas_Object*)elm_layout_content_get((const Evas_Object*)obj, "swl.photo");
-   if (eo)
-      evas_object_geometry_get(eo, &ix, &iy, &iw, &ih);
-
-   if (iw != wd->w)
-     {
-        printf("Zooming\n");
-        wd->on_zoom = EINA_TRUE;
-        edje_object_signal_emit(elm_layout_edje_get(obj), "block.off", "block");
-     }*/
 }
 
 // Whenever MOUSE UP event occurs, Call this function.
@@ -439,87 +374,70 @@ _ev_imageslider_up_cb(void *data, Evas * e __UNUSED__, Evas_Object *obj __UNUSED
 
    int interval;
 
-   if (wd->ani_lock)
-      return;
+   if (wd->ani_lock) return;
 
-   if (wd->on_zoom)
+   step = wd->down_pos.x - ev->canvas.x;
+   interval = ev->timestamp - wd->timestamp;
+   if (step == 0 || interval == 0)
      {
+        DBG("case1: emit CLICK event\n");
+        evas_object_smart_callback_call(wd->obj, SIG_CLICKED, NULL);
+        return;
      }
-   else
+   if (interval < CLICK_TIME_MAX)
      {
-        step = wd->down_pos.x - ev->canvas.x;
-        interval = ev->timestamp - wd->timestamp;
-        if (step == 0 || interval == 0)
+        if (step < CLICK_WIDTH_MIN && step > CLICK_WIDTH_MIN)
           {
-             fprintf(stderr, "[[[ DEBUG ]]]: case1: emit CLICK event\n");
+             DBG("case2: emit CLICK event\n");
              evas_object_smart_callback_call(wd->obj, SIG_CLICKED, NULL);
              return;
           }
-        if (interval < CLICK_TIME_MAX)
+     }
+
+   if (interval < FLICK_TIME_MAX)
+     {
+        if (step < FLICK_WIDTH_MIN && step > FLICK_WIDTH_MIN)
           {
-             if (step < CLICK_WIDTH_MIN && step > CLICK_WIDTH_MIN)
-               {
-                  fprintf(stderr, "[[[ DEBUG ]]]: case2: emit CLICK event\n");
-                  evas_object_smart_callback_call(wd->obj, SIG_CLICKED, NULL);
-                  return;
-               }
-          }
+             DBG("ev_imageslider_up_cb-black zone (1)\n");
 
-        if (interval < FLICK_TIME_MAX)
+             _imageslider_obj_move(wd, 0);
+          }
+        else
           {
-             if (step < FLICK_WIDTH_MIN && step > FLICK_WIDTH_MIN)
-               {
-                  fprintf(stderr, "[[[ DEBUG ]]]:_ev_imageslider_up_cb-black zone (1)\n");
+             DBG("ev_imageslider_up_cb-black zone (2)\n");
 
-                   _imageslider_obj_move(wd, 0);
-               }
-             else
-               {
-                  fprintf(stderr, "[[[ DEBUG ]]]:_ev_imageslider_up_cb-black zone (2)\n");
+             _imageslider_obj_move(wd, step);
+          }
 
-                  _imageslider_obj_move(wd, step);
-               }
+     }
+   else
+     {
+        step = (wd->x - wd->move_x) << 1;
+        if (step <= wd->w && step >= -(wd->w))
+          {
+             DBG("ev_imageslider_up_cb-white zone (1)\n");
 
+             _imageslider_obj_move(wd, 0);
           }
         else
           {
-             step = (wd->x - wd->move_x) << 1;
-             if (step <= wd->w && step >= -(wd->w))
-               {
-                  fprintf(stderr, "[[[ DEBUG ]]]:_ev_imageslider_up_cb-white zone (1)\n");
-
-                  _imageslider_obj_move(wd, 0);
-               }
-             else
-               {
-                  fprintf(stderr, "[[[ DEBUG ]]]:_ev_imageslider_up_cb-white zone (2)\n");
+             DBG("ev_imageslider_up_cb-white zone (2)\n");
 
-                  _imageslider_obj_move(wd, step);
-               }
+             _imageslider_obj_move(wd, step);
           }
      }
-
 }
 
 // Whenever MOUSE MOVE event occurs, Call this
 static void
-_ev_imageslider_move_cb(void *data, Evas * e __UNUSED__, Evas_Object *obj, void *event_info)
+_ev_imageslider_move_cb(void *data, Evas * e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
 {
-   int idx;
-
-   Evas_Object *eo;
-
+   int idx = 0;
    Evas_Coord step;
-
    Widget_Data *wd = data;
-
    Evas_Event_Mouse_Move *ev = event_info;
 
-   Elm_Imageslider_Item *it;
-
-   if (wd->ani_lock)
-      return;
-
+   if (wd->ani_lock) return;
    if (wd->move_cnt == MOVE_STEP)
      {
         wd->move_cnt = 0;
@@ -531,35 +449,14 @@ _ev_imageslider_move_cb(void *data, Evas * e __UNUSED__, Evas_Object *obj, void
                idx = BLOCK_LEFT;
              else
                idx = BLOCK_RIGHT;
-
              wd->move_x = wd->x + ((ev->cur.canvas.x - wd->down_pos.x));
              wd->move_y = wd->y + ((ev->cur.canvas.y - wd->down_pos.y));
-
-             /*if (wd->on_zoom)
-               {
-                  _imageslider_update_center_pos(wd, wd->move_x, wd->move_y, wd->y, wd->w);
-               }
-             else
-               {*/
-                  _imageslider_update_pos(wd, wd->move_x, wd->y, wd->w);
-               //}
+             _imageslider_update_pos(wd, wd->move_x, wd->y, wd->w);
           }
      }
    wd->move_cnt++;
-
 }
 
-#if 0
-// Whenever CLICK event occurs, Call this API
-// But, DONOT emit CLICK event.
-// DO NOT use this callback function. Remove later.
-static void
-_signal_clicked(void *data, Evas_Object *obj, const char *emission, const char *source)
-{
-   fprintf(stderr, "[[[ DEBUG ]]]: Call the callback function about Click event!, But DONOT emit CLICK event in the callback function!\n");
-}
-#endif
-
 static inline double
 time_get(Evas_Coord x, Evas_Coord w)
 {
@@ -582,10 +479,7 @@ _icon_to_image(void *data)
    _imageslider_update(wd);
 
    if (wd->queue_idler)
-     {
-        ecore_idler_del(wd->queue_idler);
-        wd->queue_idler = NULL;
-     }
+     wd->queue_idler = NULL;
    return ECORE_CALLBACK_CANCEL;
 }
 
@@ -625,38 +519,6 @@ _check_drag(int state, void *data)
    return 0;
 }
 
-static void
-_check_zoom(void *data)
-{
-   Widget_Data *wd = data;
-
-   Elm_Imageslider_Item *it;
-
-   Evas_Coord ix = 0, iy = 0, iw = 0, ih = 0;
-
-   double dx = 0, dy = 0;
-
-   Evas_Object *eo = NULL;
-
-   it = eina_list_data_get(wd->cur);
-
-   eo = (Evas_Object*)elm_layout_content_get(wd->ly[BLOCK_CENTER], "swl.photo");
-   if (eo)
-      evas_object_geometry_get(eo, &ix, &iy, &iw, &ih);
-   edje_object_part_drag_value_get(elm_layout_edje_get(wd->ly[BLOCK_CENTER]), "swl.photo", &dx, &dy);
-
-   if ((iw != wd->w) || ((dx != 0) || (dy != 0)))
-     {
-        wd->on_zoom = EINA_TRUE;
-        //edje_object_signal_emit(elm_layout_edje_get(wd->ly[BLOCK_CENTER]), "block.off", "block");
-     }
-   else
-     {
-        wd->on_zoom = EINA_FALSE;
-        edje_object_signal_emit(elm_layout_edje_get(wd->ly[BLOCK_CENTER]), "block.on", "block");
-     }
-}
-
 static Eina_Bool
 _timer_cb(void *data)
 {
@@ -666,14 +528,16 @@ _timer_cb(void *data)
 
    struct timeval tv;
 
-   int t;
-
-   int ret;
+   int t = 0;
+   int ret = 0;
 
    wd = data;
-   if (wd->ani_lock == EINA_FALSE)
-      return EINA_FALSE;
-
+   if (!wd->ani_lock)
+     {
+        if (wd->anim_timer)
+          wd->anim_timer = NULL;
+        return ECORE_CALLBACK_CANCEL;
+     }
    gettimeofday(&tv, NULL);
 
    t = (tv.tv_sec - wd->tv.tv_sec) * 1000 + (tv.tv_usec - wd->tv.tv_usec) / 1000;
@@ -711,16 +575,12 @@ _timer_cb(void *data)
 
         ret = _check_drag(BLOCK_LEFT, wd);
         ret = _check_drag(BLOCK_RIGHT, wd);
-        //_check_zoom(wd);
 
         if (!wd->queue_idler)
           wd->queue_idler = ecore_idler_add(_icon_to_image, wd);
 
         if (wd->anim_timer)
-          {
-             ecore_timer_del(wd->anim_timer);
-             wd->anim_timer = NULL;
-          }
+          wd->anim_timer = NULL;
 
         return ECORE_CALLBACK_CANCEL;
      }
@@ -760,8 +620,7 @@ _imageslider_update(Widget_Data * wd)
 
    Evas_Object *eo;
 
-   if (!wd)
-     return;
+   if (!wd) return;
 
    if (!wd->cur) return;
 
@@ -788,26 +647,9 @@ _imageslider_update(Widget_Data * wd)
                   //elm_image_prescale_set(eo, wd->w);
                   elm_image_file_set(eo, it->photo_file, NULL);
                   elm_layout_content_set(wd->ly[i], "swl.photo", eo);
-                  //elm_image_object_size_get(eo, &it->w, &it->h);
-                  //evas_object_geometry_get(eo, &it->ox, &it->oy, &it->ow, &it->oh);
-                  //it->ow = it->w;
-                  //it->oh = it->h;
                }
-             /*if (wd->moving != it->moving)
-               {
-                  it->moving = wd->moving;
-                  if (wd->moving)
-                    {
-                       //elm_image_prescale_set(eo, MOVING_IMAGE_SIZE);
-                    }
-                  else
-                    {
-                       //elm_image_prescale_set(eo, it->w > it->h ? it->w : it->h);
-                    }
-               }*/
           }
      }
-
    _anim(wd);
 }
 
@@ -848,7 +690,6 @@ elm_imageslider_add(Evas_Object *parent)
         elm_widget_sub_object_add(obj, wd->ly[i]);
         evas_object_smart_member_add(wd->ly[i], obj);
 
-        //edje_object_signal_callback_add(elm_layout_edje_get(wd->ly[i]), "elm,photo,clicked", "", _signal_clicked, obj);
         evas_object_event_callback_add(wd->ly[i], EVAS_CALLBACK_MOUSE_DOWN, _ev_imageslider_down_cb, wd);
         evas_object_event_callback_add(wd->ly[i], EVAS_CALLBACK_MOUSE_UP, _ev_imageslider_up_cb, wd);
         evas_object_event_callback_add(wd->ly[i], EVAS_CALLBACK_MOUSE_MOVE, _ev_imageslider_move_cb, wd);
@@ -857,14 +698,12 @@ elm_imageslider_add(Evas_Object *parent)
      }
 
    wd->obj = obj;
-
    evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, _imageslider_resize, obj);
    evas_object_event_callback_add(obj, EVAS_CALLBACK_MOVE, _imageslider_move, obj);
    evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _imageslider_show, obj);
    evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE, _imageslider_hide, obj);
 
    _sizing_eval(obj);
-
    return obj;
 }
 
@@ -901,9 +740,7 @@ elm_imageslider_item_append(Evas_Object *obj, const char *photo_file, Elm_Images
 
    if (!wd->cur)
       wd->cur = wd->its;
-
    _imageslider_update(wd);
-
    return it;
 }
 
@@ -927,7 +764,7 @@ elm_imageslider_item_append_relative(Evas_Object *obj, const char *photo_file, E
 
    Elm_Imageslider_Item *it;
 
-   fprintf(stderr, "[[[ DEBUG ]]]:: New elm_imageslider_item_append_relative()\n");
+   DBG("New elm_imageslider_item_append_relative()\n");
 
    if (!obj || !(wd = elm_widget_data_get(obj)))
      return NULL;
@@ -941,14 +778,12 @@ elm_imageslider_item_append_relative(Evas_Object *obj, const char *photo_file, E
    it->func = func;
    it->data = data;
 
-   wd->its =
-      eina_list_append_relative(wd->its, it, eina_list_nth(wd->its, index - 2));
+   wd->its = eina_list_append_relative(wd->its, it, eina_list_nth(wd->its,
+                                                                  index - 2));
 
    if (!wd->cur)
       wd->cur = wd->its;
-
    _imageslider_update(wd);
-
    return it;
 }
 
@@ -980,12 +815,9 @@ elm_imageslider_item_prepend(Evas_Object *obj, const char *photo_file, Elm_Image
    it->data = data;
    it->obj = obj;
    wd->its = eina_list_prepend(wd->its, it);
-
    if (!wd->cur)
       wd->cur = wd->its;
-
    _imageslider_update(wd);
-
    return it;
 }
 
@@ -1020,9 +852,7 @@ elm_imageslider_item_del(Elm_Imageslider_Item * it)
              break;
           }
      }
-
    _imageslider_update(wd);
-
 }
 
 /**
@@ -1071,7 +901,6 @@ elm_imageslider_item_selected_get(Elm_Imageslider_Item * it)
       return EINA_TRUE;
    else
       return EINA_FALSE;
-
 }
 
 /**
@@ -1107,13 +936,9 @@ elm_imageslider_item_selected_set(Elm_Imageslider_Item * it)
      {
        eo = (Evas_Object*)elm_layout_content_get(wd->ly[i], "swl.photo");
        if (eo)
-          {
-             elm_layout_content_set(wd->ly[i], "swl.photo", NULL);
-          }
+         elm_layout_content_set(wd->ly[i], "swl.photo", NULL);
      }
-
    _imageslider_update(wd);
-
 }
 
 /**
@@ -1183,7 +1008,6 @@ elm_imageslider_item_prev(Elm_Imageslider_Item * it)
              return eina_list_data_get(l);
           }
      }
-
    return NULL;
 }
 
@@ -1217,7 +1041,6 @@ elm_imageslider_item_next(Elm_Imageslider_Item * it)
              return eina_list_data_get(l);
           }
      }
-
    return NULL;
 }
 
@@ -1236,10 +1059,8 @@ elm_imageslider_prev(Evas_Object *obj)
 
    if (!obj || (!(wd = elm_widget_data_get(obj))))
      return;
-
    if (wd->ani_lock)
      return;
-
    _imageslider_obj_move(wd, -1);
 }
 
@@ -1258,12 +1079,9 @@ elm_imageslider_next(Evas_Object * obj)
 
    if (!obj || (!(wd = elm_widget_data_get(obj))))
      return;
-
    if (wd->ani_lock)
      return;
-
    _imageslider_obj_move(wd, 1);
-
 }
 
 /**
@@ -1281,7 +1099,7 @@ elm_imageslider_item_update(Elm_Imageslider_Item *it)
    if (!it || (!(wd = elm_widget_data_get(it->obj)))) return;
    ELM_CHECK_WIDTYPE(it->obj, widtype);
 
-   if (wd->ani_lock == EINA_TRUE) return;
+   if (wd->ani_lock) return;
    if (it == eina_list_data_get(eina_list_prev(wd->cur)))
      elm_layout_content_set(wd->ly[BLOCK_LEFT], "swl.photo", NULL);
    else if (it == eina_list_data_get(wd->cur))
index 0c1b989..ebc2903 100644 (file)
@@ -168,7 +168,7 @@ _on_focus_hook(void *data __UNUSED__, Evas_Object *obj)
              ecore_imf_context_input_panel_show(imf_context);
              evas_object_focus_set(obj, EINA_TRUE);
           }
-        else if ((imf_context) && (!wd->current) || (!eina_list_count(wd->items)))
+        else if ((imf_context) && ((!wd->current) || (!eina_list_count(wd->items))))
           {
              _view_update(obj);
              ecore_imf_context_input_panel_show(imf_context);
@@ -1292,12 +1292,9 @@ elm_multibuttonentry_add(Evas_Object *parent)
    Evas_Object *obj;
    Evas *e;
    Widget_Data *wd;
-   if (!parent) return NULL;
 
-   wd = ELM_NEW(Widget_Data);
-   e = evas_object_evas_get(parent);
-   if (!e) return NULL;
-   obj = elm_widget_add(e);
+   ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
+
    ELM_SET_WIDTYPE(widtype, "multibuttonentry");
    elm_widget_type_set(obj, "multibuttonentry");
    elm_widget_sub_object_add(parent, obj);
index 4b1af5f..0ad6794 100644 (file)
@@ -110,9 +110,9 @@ _clipboard_menu(void *data, Evas_Object *obj, void *event_info)
    ext_mod->cnpinit(data,obj,event_info);
    elm_cbhm_helper_init(obj);
    if (ext_mod->textonly)
-      elm_cbhm_send_raw_data("show0");
+     elm_cbhm_send_raw_data("show0");
    else
-      elm_cbhm_send_raw_data("show1");
+     elm_cbhm_send_raw_data("show1");
    evas_object_hide(obj);
    // end for cbhm
 }
@@ -206,7 +206,7 @@ obj_longpress(Evas_Object *obj)
            (ext_mod->ent, "context_menu_orientation");
         if ((context_menu_orientation) &&
             (!strcmp(context_menu_orientation, "horizontal")))
-           elm_ctxpopup_horizontal_set(ext_mod->popup, EINA_TRUE);
+          elm_ctxpopup_horizontal_set(ext_mod->popup, EINA_TRUE);
 
         elm_widget_sub_object_add(obj, ext_mod->popup);
         if (!ext_mod->selmode)
@@ -222,7 +222,7 @@ obj_longpress(Evas_Object *obj)
              if (1) // need way to detect if someone has a selection
                {
                   if (ext_mod->editable)
-                     elm_ctxpopup_item_append(ext_mod->popup, "Paste", NULL, _paste, obj );
+                    elm_ctxpopup_item_append(ext_mod->popup, "Paste", NULL, _paste, obj );
                }
              //elm_ctxpopup_item_append(wd->ctxpopup, NULL, "Selectall",_select_all, obj );
              // start for cbhm
@@ -244,9 +244,9 @@ obj_longpress(Evas_Object *obj)
                     {
                        elm_ctxpopup_item_append(ext_mod->popup, "Copy", NULL, _copy, obj );
                        if (ext_mod->editable)
-                          elm_ctxpopup_item_append(ext_mod->popup, "Cut", NULL, _cut, obj );
+                         elm_ctxpopup_item_append(ext_mod->popup, "Cut", NULL, _cut, obj );
                        if (ext_mod->editable)
-                          elm_ctxpopup_item_append(ext_mod->popup, "Paste", NULL, _paste, obj );
+                         elm_ctxpopup_item_append(ext_mod->popup, "Paste", NULL, _paste, obj );
                     }
                   else
                     {
@@ -259,7 +259,7 @@ obj_longpress(Evas_Object *obj)
                        if (1) // need way to detect if someone has a selection
                          {
                             if (ext_mod->editable)
-                               elm_ctxpopup_item_append(ext_mod->popup, "Paste", NULL, _paste, obj );
+                              elm_ctxpopup_item_append(ext_mod->popup, "Paste", NULL, _paste, obj );
                          }
                     }
                   // start for cbhm
@@ -291,28 +291,16 @@ obj_longpress(Evas_Object *obj)
 EAPI void
 obj_mouseup(Evas_Object *obj)
 {
-   if (!obj || !ext_mod) {
-        return;
-   }
-
-   /*update*/
-   elm_entry_extension_module_data_get(obj,ext_mod);
-   if (ext_mod->longpress_timer)
-     {
-        if (ext_mod->have_selection )
-          {
-             _cancel(obj,ext_mod->popup,NULL);
-          }
-     }
+   if (!obj || !ext_mod)
+     return;
 }
 
 
 EAPI void
 obj_hidemenu(Evas_Object *obj)
 {
-   if (!obj || !ext_mod) {
-        return;
-   }
+   if (!obj || !ext_mod)
+     return;
 
    evas_object_hide(ext_mod->popup);
    // if (ext_mod->popup) evas_object_del(ext_mod->popup);