Dear all.

I made a small patch about revise cnp apis.
It changed argument orders of apis to consistence and make elm widget centric.
now all cnp api's first argument is a elm widget.
It breaks api compatibility. so elementarychanges is needed to update.

thanks.
Index: elementary/src/lib/elm_entry.c
===================================================================
--- elementary/src/lib/elm_entry.c      (리비전 68489)
+++ elementary/src/lib/elm_entry.c      (작업 사본)
@@ -1182,7 +1182,7 @@
         formats = ELM_SEL_FORMAT_MARKUP;
         if (!wd->textonly)
           formats |= ELM_SEL_FORMAT_IMAGE;
-        elm_cnp_selection_get(ELM_SEL_TYPE_CLIPBOARD, formats, data, NULL, 
NULL);
+        elm_cnp_selection_get(data, ELM_SEL_TYPE_CLIPBOARD, formats, NULL, 
NULL);
 #endif
      }
 }
@@ -1196,7 +1196,7 @@
    if (!wd) return;
    sel = edje_object_part_text_selection_get(wd->ent, "elm.text");
    if ((!sel) || (!sel[0])) return; /* avoid deleting our own selection */
-   elm_cnp_selection_set(seltype, obj, ELM_SEL_FORMAT_MARKUP, sel, 
strlen(sel));
+   elm_cnp_selection_set(obj, seltype, ELM_SEL_FORMAT_MARKUP, sel, 
strlen(sel));
    if (seltype == ELM_SEL_TYPE_CLIPBOARD)
      eina_stringshare_replace(&wd->cut_sel, sel);
 }
@@ -1588,7 +1588,7 @@
 
         top = elm_widget_top_get(data);
         if (txt && top && (elm_win_xwindow_get(top)))
-          elm_cnp_selection_set(ELM_SEL_TYPE_PRIMARY, data,
+          elm_cnp_selection_set(data, ELM_SEL_TYPE_PRIMARY,
                                 ELM_SEL_FORMAT_MARKUP, txt, strlen(txt));
      }
 #endif
@@ -1637,7 +1637,7 @@
 
              top = elm_widget_top_get(data);
              if ((top) && (elm_win_xwindow_get(top)))
-               elm_cnp_selection_set(ELM_SEL_TYPE_PRIMARY, data,
+               elm_cnp_selection_set(data, ELM_SEL_TYPE_PRIMARY,
                                      ELM_SEL_FORMAT_MARKUP, wd->cut_sel,
                                      strlen(wd->cut_sel));
 #endif
@@ -1674,7 +1674,7 @@
         if ((top) && (elm_win_xwindow_get(top)))
           {
              wd->selection_asked = EINA_TRUE;
-             elm_cnp_selection_get(type, ELM_SEL_FORMAT_MARKUP, data,
+             elm_cnp_selection_get(data, type, ELM_SEL_FORMAT_MARKUP,
                                NULL, NULL);
           }
 #endif
Index: elementary/src/lib/elm_cnp.c
===================================================================
--- elementary/src/lib/elm_cnp.c        (리비전 68489)
+++ elementary/src/lib/elm_cnp.c        (작업 사본)
@@ -390,7 +390,7 @@
 }
 
 EAPI Eina_Bool
-elm_cnp_selection_set(Elm_Sel_Type selection, Evas_Object *obj,
+elm_cnp_selection_set(Evas_Object *obj, Elm_Sel_Type selection,
                       Elm_Sel_Format format, const void *selbuf, size_t buflen)
 {
 #ifdef HAVE_ELEMENTARY_X
@@ -463,8 +463,8 @@
 }
 
 EAPI Eina_Bool
-elm_cnp_selection_get(Elm_Sel_Type selection, Elm_Sel_Format format,
-                      Evas_Object *obj, Elm_Drop_Cb datacb, void *udata)
+elm_cnp_selection_get(Evas_Object *obj, Elm_Sel_Type selection,
+                      Elm_Sel_Format format, Elm_Drop_Cb datacb, void *udata)
 {
 #ifdef HAVE_ELEMENTARY_X
    Evas_Object *top;
Index: elementary/src/lib/elm_cnp.h
===================================================================
--- elementary/src/lib/elm_cnp.h        (리비전 68489)
+++ elementary/src/lib/elm_cnp.h        (작업 사본)
@@ -100,7 +100,7 @@
 /**
  * @brief Set copy data for a widget.
  *
- * Set copy data and take ownership of selection. Format is used for 
specifying the selection type,
+ * Set copy data and take ownership of selection. Format is used to specifying 
the selection type,
  * and this is used during pasting.
  *
  * @param selection Selection type for copying and pasting
@@ -113,12 +113,9 @@
  * @ingroup CopyPaste
  *
  */
-// XXX: EAPI void elm_object_cnp_selection_set(Evas_Object *obj, Elm_Sel_Type 
selection,
-//                                             Elm_Sel_Format format, const 
void *buf,
-//                                             size_t buflen);
-EAPI Eina_Bool elm_cnp_selection_set(Elm_Sel_Type selection, Evas_Object *obj,
-                                     Elm_Sel_Format format, const void *buf,
-                                     size_t buflen);
+EAPI Eina_Bool elm_cnp_selection_set(Evas_Object *obj, Elm_Sel_Type selection,
+                                     Elm_Sel_Format format,
+                                     const void *buf, size_t buflen);
 
 /**
  * @brief Retrieve data from a widget that has a selection.
@@ -142,15 +139,10 @@
  */
 // XXX: This api needs to be refined by cnp experts.
 //      I suggest:
-//         1. return copy and paste data.
-//         2. call cnp callback regardless of widget type.
-//         3. apps insert text data into entry manually.
-// XXX: EAPI void *elm_object_cnp_selection_get(Evas_Object *obj,
-//                                              Elm_Sel_Type selection,
-//                                              Elm_Sel_Format format,
-//                                              Elm_Cnp_Cb datacb);
-EAPI Eina_Bool elm_cnp_selection_get(Elm_Sel_Type selection,
-                                     Elm_Sel_Format format, Evas_Object *obj,
+//         1. call cnp callback regardless of widget type.
+//         2. apps insert text data into entry manually.
+EAPI Eina_Bool elm_cnp_selection_get(Evas_Object *obj, Elm_Sel_Type selection,
+                                     Elm_Sel_Format format,
                                      Elm_Drop_Cb datacb, void *udata);
 
 /**
@@ -167,8 +159,8 @@
  * @ingroup CopyPaste
  *
  */
-EAPI Eina_Bool elm_object_cnp_selection_clear(Evas_Object *obj, 
-                                               Elm_Sel_Type selection);
+EAPI Eina_Bool elm_object_cnp_selection_clear(Evas_Object *obj,
+                                              Elm_Sel_Type selection);
 
 /**
  * @}
Index: elementary/src/bin/test_cnp.c
===================================================================
--- elementary/src/bin/test_cnp.c       (리비전 68489)
+++ elementary/src/bin/test_cnp.c       (작업 사본)
@@ -13,7 +13,7 @@
    const char *txt = elm_object_text_get(en);
 
    elm_object_text_set(glb, txt);
-   elm_cnp_selection_set(ELM_SEL_TYPE_CLIPBOARD, 
elm_object_parent_widget_get(en),
+   elm_cnp_selection_set(elm_object_parent_widget_get(en), 
ELM_SEL_TYPE_CLIPBOARD,
                          ELM_SEL_FORMAT_TEXT, txt, strlen(txt));
 }
 
@@ -22,8 +22,8 @@
 {
    Evas_Object *en = (Evas_Object*)(data);
 
-   elm_cnp_selection_get(ELM_SEL_TYPE_CLIPBOARD, ELM_SEL_FORMAT_TEXT,
-                         en, NULL, NULL);
+   elm_cnp_selection_get(en, ELM_SEL_TYPE_CLIPBOARD, ELM_SEL_FORMAT_TEXT,
+                         NULL, NULL);
 }
 
 static void
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to