6. (Owner side.) When there is a match between a selection-item object’s target type, and a
requested target, the selection package converts and sends the selection data to the
selection requestor. XView internally handles the data conversion by calling the pack-
age’s default conversion procedure sel_convert_proc().
7. (Requestor side.) Once the data conversion has completed (either successfully or unsuc-
cessfully), the application-deﬁned reply procedure is invoked. The data may displayed in
application B (if the conversion routine was successful) or the user may simply be given
some indication that data was received. Other possibilities include: the kind of data
selected in application A cannot be pasted in application B, or that the kind of data
requested by B cannot be supplied by A.
8. (Owner side.) Once the selection transfer is complete, an application-deﬁned “done” pro-
cedure may be called by the selection owner. The done procedure may be used to free the
memory associated with the selection, or to perform other cleanup that is required.
9. (Owner side.) If another application acquires the selection, application A’s “lose” proce-
dure is called. This procedure is used to handle notiﬁcation of loosing selection owner-
ship. It tells the selection owner (application A) that it has lost ownership of the
selection. For example, the lose procedure might unhighlight text that was previously
selected and highlighted.
18.3.1 The Selection Item
The ﬁrst task for the application that is to become the selection owner, using a selection-item
object, is to pre-register a conversion or several conversions. Below, we describe this step in
detail. Also, the selection needs to be marked. For example, when the pointer is placed over
text in a canvas, an
ACTION_SELECT should highlight the selection. While LOC_DRAG occurs,
the highlight would be extended over the selection.
After the user makes a selection and it is marked, the application waits to receive an event of
interest. For example, in a text subwindow, the act of selecting an item causes the primary
rank to be acquired. For the text subwindow example, an ACTION_COPY event causes the
CLIPBOARD selection to be acquired (note that in this case two selections are acquired since
COPY operation in OPEN LOOK uses the clipboard).
With a selection item, applications perform three steps to become the selection owner:
1. A Selection_owner object must be created using xv_create() (assuming a previ-
ously created selection-owner object is not being re-used.) A selection-item object is
created and its attributes are set.
2. The selection must be acquired.
3. The selection data is associated with the selection item.
412 XView Programming Manual