Dear developers.

This patch is about elm_cnp_helper.
When using elm_entry, sometimes newline isn't copied.
That's because <ps> tag. It's represent 'paragraph separator'.
I just adding <ps> handling.

After url entry bug (isn't copied in some browsers.),
I'll clean up internal char handling.

Thank you.
Index: src/lib/elm_genlist.c
===================================================================
--- src/lib/elm_genlist.c       (리비전 62079)
+++ src/lib/elm_genlist.c       (작업 사본)
@@ -540,12 +540,6 @@
    if (wd->multi_timer) ecore_timer_del(wd->multi_timer);
    if (wd->mode_type) eina_stringshare_del(wd->mode_type);
    if (wd->scr_hold_timer) ecore_timer_del(wd->scr_hold_timer);
-   if (wd->walking > 0)
-     {
-        wd->walking = 0;
-        elm_genlist_clear(obj);
-     }
-
    free(wd);
 }
 
@@ -833,16 +827,10 @@
    it->selected = EINA_TRUE;
    it->wd->selected = eina_list_append(it->wd->selected, it);
 call:
+   evas_object_ref(it->base.widget);
    it->walking++;
    it->wd->walking++;
-   if (it->func.func)
-     {
-        Evas_Object *baseobj = it->base.widget;
-        const char *objtype = NULL;
-        it->func.func((void *)it->func.data, it->base.widget, it);
-        objtype = evas_object_type_get(baseobj);
-        if ((!objtype) || (!strcmp(objtype,""))) return;
-     }
+   if (it->func.func) it->func.func((void *)it->func.data, it->base.widget, 
it);
    if (!it->delete_me)
      evas_object_smart_callback_call(it->base.widget, SIG_SELECTED, it);
    it->walking--;
@@ -857,6 +845,7 @@
           }
      }
    it->wd->last_selected_item = it;
+   evas_object_unref(it->base.widget);
 }
 
 static void
Index: src/lib/elm_widget.c
===================================================================
--- src/lib/elm_widget.c        (리비전 62079)
+++ src/lib/elm_widget.c        (작업 사본)
@@ -411,6 +411,18 @@
    widtypes = eina_list_append(widtypes, (void *)ptr);
 }
 
+/**
+ * @defgroup Widget Widget
+ *
+ * @internal
+ * Disposed api for making widgets
+ */
+EAPI void
+elm_widget_type_unregister(const char **ptr)
+{
+   widtypes = eina_list_remove(widtypes, (void *)ptr);
+}
+
 EAPI Eina_Bool
 elm_widget_api_check(int ver)
 {
Index: src/lib/elm_widget.h
===================================================================
--- src/lib/elm_widget.h        (리비전 62079)
+++ src/lib/elm_widget.h        (작업 사본)
@@ -329,6 +329,7 @@
 EAPI int              elm_widget_drag_child_locked_y_get(const Evas_Object 
*obj);
 EAPI Eina_Bool        elm_widget_theme_object_set(Evas_Object *obj, 
Evas_Object *edj, const char *wname, const char *welement, const char *wstyle);
 EAPI void             elm_widget_type_register(const char **ptr);
+EAPI void             elm_widget_type_unregister(const char **ptr);
 EAPI Eina_Bool        elm_widget_type_check(const Evas_Object *obj, const char 
*type);
 EAPI Eina_List       *elm_widget_stringlist_get(const char *str);
 EAPI void             elm_widget_stringlist_free(Eina_List *list);
Index: src/lib/elm_cnp_helper.c
===================================================================
--- src/lib/elm_cnp_helper.c    (리비전 62079)
+++ src/lib/elm_cnp_helper.c    (작업 사본)
@@ -78,7 +78,7 @@
 struct _Escape
 {
    const char *escape;
-   const char  value;
+   const char  *value;
 };
 
 struct _Tmp_Info
@@ -147,16 +147,19 @@
 
 static Eina_Bool pasteimage_append(char *file, Evas_Object *entry);
 
+#define _PARAGRAPH_SEPARATOR "\xE2\x80\xA9"
+
 /* 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;", '"'  }
+  { "<ps>",  _PARAGRAPH_SEPARATOR },
+  { "<br>",  "\n" },
+  { "<\t>",  "\t" },
+  { "gt;",   ">" },
+  { "lt;",    "<" },
+  { "amp;",   "&" },
+  { "quot;",  "\'" },
+  { "dquot;", "\"" }
 };
 #define N_ESCAPES ((int)(sizeof(escapes) / sizeof(escapes[0])))
 
@@ -1047,6 +1050,11 @@
              if ((p[1] == 'b') && (p[2] == 'r') &&
                  ((p[3] == ' ') || (p[3] == '/') || (p[3] == '>')))
                *q++ = '\n';
+             else if ((p[1] == 'p') && (p[2] == 's') && (p[3] == '>'))
+               {
+                  strcpy(q, _PARAGRAPH_SEPARATOR);
+                  q += strlen(_PARAGRAPH_SEPARATOR);
+               }
              while ((*p) && (*p != '>')) p++;
              p++;
           }
@@ -1058,8 +1066,8 @@
                   if (!strncmp(p,escapes[i].escape, strlen(escapes[i].escape)))
                     {
                        p += strlen(escapes[i].escape);
-                       *q = escapes[i].value;
-                       q++;
+                       strcpy(q, escapes[i].value);
+                       q += strlen(escapes[i].value);
                        break;
                     }
                }
@@ -1087,9 +1095,12 @@
      {
         for (i = 0 ; i < N_ESCAPES ; i ++)
           {
-             if (*p == escapes[i].value)
+             if (*p == escapes[i].value[0])
                {
-                  l += strlen(escapes[i].escape);
+                  if (strlen(escapes[i].value) == 1)
+                    l += strlen(escapes[i].escape);
+                  else if (!strncmp(p, escapes[i].value, 
strlen(escapes[i].value)))
+                    l += strlen(escapes[i].escape);
                   break;
                }
           }
@@ -1103,11 +1114,20 @@
      {
         for (i = 0; i < N_ESCAPES; i++)
           {
-             if (*p == escapes[i].value)
+             if (*p == escapes[i].value[0])
                {
-                  strcpy(q, escapes[i].escape);
-                  q += strlen(escapes[i].escape);
-                  p ++;
+                  if (strlen(escapes[i].value) == 1)
+                    {
+                       strcpy(q, escapes[i].escape);
+                       q += strlen(escapes[i].escape);
+                       p ++;
+                    }
+                  else if (!strncmp(p, escapes[i].value, 
strlen(escapes[i].value)))
+                    {
+                       strcpy(q, escapes[i].escape);
+                       q += strlen(escapes[i].escape);
+                       p += strlen(escapes[i].value);
+                    }
                   break;
                }
           }
------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to