Xlib provides functions that you can use to set, get, or request conversion of selections. This allows applications to implement the notion of current selection, which requires that notification be sent to applications when they no longer own the selection. Applications that support selection often highlight the current selection and so must be informed when another application has acquired the selection so that they can unhighlight the selection.
When a client asks for the contents of a selection, it specifies a selection target type. This target type can be used to control the transmitted representation of the contents. For example, if the selection is ``the last thing the user clicked on'' and that is currently an image, then the target type might specify whether the contents of the image should be sent in XY format or Z format.
The target type can also be used to control the class of contents transmitted, for example, asking for the ``looks'' (fonts, line spacing, indentation, and so forth) of a paragraph selection, not the text of the paragraph. The target type can also be used for other purposes. The protocol does not constrain the semantics.
To set the selection owner, use XSetSelectionOwner().
To return the selection owner, use XGetSelectionOwner().
To request conversion of a selection, use XConvertSelection().