Dear all.

As i said earlier, elm_cnp's document is revised.
I add information about x11 and make some comment clear.

Thanks
Index: elementary/src/lib/elm_cnp.h
===================================================================
--- elementary/src/lib/elm_cnp.h        (리비전 68487)
+++ elementary/src/lib/elm_cnp.h        (작업 사본)
@@ -2,14 +2,41 @@
  * @defgroup CopyPaste CopyPaste
  *
  * Implements the following functionality
- *    a. select, copy/cut and paste 
+ *    a. select, copy/cut and paste
  *    b. clipboard
- *    c. drag and drop 
+ *    c. drag and drop
  * in order to share data across application windows.
  *
- * Contains functions to select a portion of text, send it to a buffer,
- * and paste the selection into a target.
+ * Contains functions to select text or a portion of data,
+ * send it to a buffer, and paste the data into a target.
  *
+ * elm_cnp provides generic copy and paste facility on its based window system.
+ * It's not need to know details of each based window system,
+ * But some terms and behavior are originated.
+ * Currently X11 window system is widely used.
+ *
+ * In X11R6 window sytem, CopyPaste works like peer-to-peer communication.
+ * Copying is a operation that owns an object in X server.
+ * X11 calls that objects as 'selections' which are have names.
+ * Generally, two selections are needed to know for copy and paste.
+ * The Primary selection and the Clipboard selection.
+ * Primary selection for selecting text (that means highlighted text).
+ * Clipboard selection for explicit copying behavior
+ * (such as ctrl+c, or copy menu in popup).
+ * Thus in applications, most of cases are only using clipboard selection.
+ * As stated before, taking ownership of a selection dosen't move any actual 
data.
+ * Copying and Pasting goes like below
+ *  1. Copy text in Program A : Program A is trying to own the selection
+ *  2. Paste text in Program B : Program B notes that Program A owns the 
selection
+ *  3. Program B asks A for the text
+ *  4. program A responds, and sends the text to program B
+ *  5. program B pastes the response
+ * More information is on
+ *  - http://www.jwz.org/doc/x-cut-and-paste.html
+ *  - X11R6 Inter-Client Communication Conventions Manual, section 2
+ *
+ * TODO: add for other window system.
+ *
  * @{
  */
 
@@ -20,7 +47,7 @@
  */
 typedef enum
 {
-   ELM_SEL_TYPE_PRIMARY, /**< Primary text selection (middle mouse) */
+   ELM_SEL_TYPE_PRIMARY, /**< Primary text selection (highlighted or selected 
text) */
    ELM_SEL_TYPE_SECONDARY, /**< Used when primary selection is in use */
    ELM_SEL_TYPE_XDND, /**< Drag 'n' Drop */
    ELM_SEL_TYPE_CLIPBOARD, /**< Clipboard selection (ctrl+C) */
@@ -32,19 +59,19 @@
 typedef enum
 {
    /** For matching every possible atom */
-   ELM_SEL_FORMAT_TARGETS = -1,
+   ELM_SEL_FORMAT_TARGETS =   -1,
    /** Content is from outside of Elementary */
-   ELM_SEL_FORMAT_NONE = 0x0,
+   ELM_SEL_FORMAT_NONE    =  0x0,
    /** Plain unformatted text: Used for things that don't want rich markup */
-   ELM_SEL_FORMAT_TEXT = 0x01,
+   ELM_SEL_FORMAT_TEXT    = 0x01,
    /** Edje textblock markup, including inline images */
-   ELM_SEL_FORMAT_MARKUP = 0x02,
+   ELM_SEL_FORMAT_MARKUP  = 0x02,
    /** Images */
-   ELM_SEL_FORMAT_IMAGE = 0x04,
+   ELM_SEL_FORMAT_IMAGE   = 0x04,
    /** Vcards */
-   ELM_SEL_FORMAT_VCARD = 0x08,
+   ELM_SEL_FORMAT_VCARD   = 0x08,
    /** Raw HTML-like data (eg. webkit) */
-   ELM_SEL_FORMAT_HTML = 0x10,
+   ELM_SEL_FORMAT_HTML    = 0x10,
 } Elm_Sel_Format;
 
 /**
@@ -71,10 +98,10 @@
 
 
 /**
- * @brief Set copy and paste data for a widget.
+ * @brief Set copy data for a widget.
  *
- * XXX: need to be rewritten.
- * Append the given callback to the list.
+ * Set a copy data and own a selection. Format is used for specified its type.
+ * buf is saved for later to paste.
  *
  * @param selection Selection type for copying and pasting
  * @param obj The source widget pointer
@@ -94,7 +121,7 @@
                                      size_t buflen);
 
 /**
- * @brief Retrieve selection data from a widget.
+ * @brief Retrieve data from a widget that has a selection.
  *
  * Gets the current selection data from a widget.
  * The widget input here will usually be elm_entry,
@@ -129,6 +156,8 @@
 /**
  * @brief Clear the selection data of a widget.
  *
+ * Clear all informations of the selection which is owned by a widget.
+ *
  * @see also elm_cnp_selection_set()
  *
  * @param obj The source widget
------------------------------------------------------------------------------
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