Dear all

When ecore selection set apis(such as ecore_x_selection_clipboard_set)
used in elementary,
Some data is not pasted to elementary widgets.
It's due to mix ecore selection with elementary selection apis.

Data which by ecore doesn't have TARGETS information,
so elementary make it up with TARGETS Information for copying & pasting.

Thank you.
Index: elementary/src/lib/elm_widget.h
===================================================================
--- elementary/src/lib/elm_widget.h     (리비전 66367)
+++ elementary/src/lib/elm_widget.h     (작업 사본)
@@ -741,6 +741,8 @@
    ELM_SEL_FORMAT_VCARD  = 0x08,
    /** Raw HTMLish things for widgets that want that stuff (hello webkit!) */
    ELM_SEL_FORMAT_HTML   = 0x10,
+
+   ELM_SEL_FORMAT_MAX
 } Elm_Sel_Format;
 
 struct _Elm_Selection_Data
Index: elementary/src/lib/elm_cnp_helper.c
===================================================================
--- elementary/src/lib/elm_cnp_helper.c (리비전 66367)
+++ elementary/src/lib/elm_cnp_helper.c (작업 사본)
@@ -594,7 +594,8 @@
      {
         Cnp_Selection *sel;
         sel = selections + *((int *)data);
-        if (sel->active)
+        if (sel->active &&
+            (sel->format >= ELM_SEL_TARGETS) && (sel->format < 
ELM_SEL_FORMAT_MAX))
           return sel->format;
      }
    return ELM_SEL_FORMAT_NONE;
@@ -606,32 +607,30 @@
    int i,count;
    Ecore_X_Atom *aret;
    Cnp_Selection *sel;
+   Elm_Sel_Format seltype;
 
    if (!data_ret) return EINA_FALSE;
 
    if (_get_selection_type(data, size) == ELM_SEL_FORMAT_NONE)
      {
-        if (data_ret)
-          {
-             *data_ret = malloc(size * sizeof(char) + 1);
-             memcpy(*data_ret, data, size);
-             ((char**)(data_ret))[0][size] = 0;
-          }
-        if (size_ret) *size_ret = size;
-        return EINA_TRUE;
+        /* TODO : fallback into precise type */
+        seltype = ELM_SEL_FORMAT_TEXT;
      }
+   else
+     {
+        sel = selections + *((int *)data);
+        seltype = sel->format;
+     }
 
-   sel = selections + *((int *)data);
-
    for (i = 0, count = 0; i < CNP_N_ATOMS ; i++)
      {
-        if (sel->format & atoms[i].formats) count++;
+        if (seltype & 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 (seltype & atoms[i].formats) aret[count ++] = atoms[i].atom;
      }
 
    *data_ret = aret;
------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to