10.13.5 SelectionNotify Events

This event is generated by the X server in response to a ConvertSelection protocol request when there is no owner for the selection. When there is an owner, it should be generated by the owner of the selection by using XSendEvent(). The owner of a selection should send this event to a requestor when a selection has been converted and stored as a property or when a selection conversion could not be performed (which is indicated by setting the property member to None).
ConvertSelection このイベントは、セレクション(selection)の所有者ではないクライアントの ConvertSelectionプロトコルリクエストへに答えて X サーバーによって発生される。 所有者(owner)がいるならば、 XSendEventを使ってセレクション(selection)の所有者(owner)によって発生される。 セレクション(selection)の所有者(owner)は、 セレクション(selection)が変換され、プロパティー(property)として保存された時、 あるいはセレクション(selection)の変換ができなかった (property メンバーに Noneを設定する事で示される)時に、 リクエストを起こしたクライアントにこのイベントを送るべきだ。

If None is specified as the property in the ConvertSelection protocol request, the owner should choose a property name, store the result as that property on the requestor window, and then send a SelectionNotify giving that actual property name.
ConvertSelectionプロトコルリクエストでプロパティー(property)として Noneが指定されたなら、所有者(owner)がプロパティー(property)名を選び、 リクエスター(requestor)のウインドウで結果をプロパティー(property)として保存し、 実際のプロパティー(property)名を与える SelectionNotifyを送るべきだ。

The structure for this event type contains:
このイベント型(type)のための構造体を以下に示す:


typedef struct {
	int type;		/* SelectionNotify */
	unsigned long serial;	/* # of last request processed by server */
	Bool send_event;	/* true if this came from a SendEvent request */
	Display *display;	/* Display the event was read from */
	Window requestor;
	Atom selection;
	Atom target;
	Atom property;		/* atom or None */
	Time time;
} XSelectionEvent;

The requestor member is set to the window associated with the requestor of the selection. The selection member is set to the atom that indicates the selection. For example, PRIMARY is used for the primary selection. The target member is set to the atom that indicates the converted type. For example, PIXMAP is used for a pixmap. The property member is set to the atom that indicates which property the result was stored on. If the conversion failed, the property member is set to None. The time member is set to the time the conversion took place and can be a timestamp or CurrentTime.
requestor メンバーは、セレクション(selection)を要求したクライアントに 関連づけられたウィンドウが設定される。 The selection member is set to the atom that indicates the selection. selection メンバーは、セレクション(selection)を示すアトム(atom)が設定される。 例えば、PRIMARY はプライマリ(primary)セレクション(selection)のために使われる。 target メンバーは、変換される型を示すアトム(atom)が設定される。 例えば、PIXMAP はピックスマップのために使われる。 property メンバーは、結果がどのプロパティに保存されるのかを示すアトム(atom) が設定される。 変換に失敗したならば、property メンバーは Noneが設定される。 time メンバーは、変換が起こった時間が設定され、タイムスタンプか CurrentTimeだ。

Next Chapter: Event Handling Functions

Christophe Tronche, ch.tronche@computer.org