Selection

The X selection mechanism provides a way to transfer arbitrary chunks of data between programs. A selection is a essentially a named clipboard, identified by a string interned as a GdkAtom. By claiming ownership of a selection, an application indicates that it will be responsible for supplying its contents. The most common selections are PRIMARY and CLIPBOARD.

The contents of a selection can be represented in a number of formats, called targets. Each target is identified by an atom. A list of all possible targets supported by the selection owner can be retrieved by requesting the special target TARGETS. When a selection is retrieved, the data is accompanied by a type (an atom), and a format (an integer, representing the number of bits per item). See Properties and Atoms for more information.

The functions in this section only contain the lowlevel parts of the selection protocol. A considerably more complicated implementation is needed on top of this. GTK+ contains such an implementation in the functions in gtkselection.h and programmers should use those functions instead of the ones presented here. If you plan to implement selection handling directly on top of the functions here, you should refer to the X Inter-client Communication Conventions Manual (ICCCM).

Members

Static functions

convert
void convert(Window requestor, GdkAtom selection, GdkAtom target, uint time)

Retrieves the contents of a selection in a given form.

ownerGet
Window ownerGet(GdkAtom selection)

Determines the owner of the given selection.

ownerGetForDisplay
Window ownerGetForDisplay(Display display, GdkAtom selection)

Determine the owner of the given selection. Note that the return value may be owned by a different process if a foreign window was previously created for that window, but a new foreign window will never be created by this call. Since 2.2

ownerSet
int ownerSet(Window owner, GdkAtom selection, uint time, int sendEvent)

Sets the owner of the given selection.

ownerSetForDisplay
int ownerSetForDisplay(Display display, Window owner, GdkAtom selection, uint time, int sendEvent)

Sets the GdkWindow owner as the current owner of the selection selection. Since 2.2

propertyGet
int propertyGet(Window requestor, char* data, GdkAtom propType, int propFormat)

Retrieves selection data that was stored by the selection data in response to a call to gdk_selection_convert(). This function will not be used by applications, who should use the GtkClipboard API instead.

sendNotify
void sendNotify(Window requestor, GdkAtom selection, GdkAtom target, GdkAtom property, uint time)

Sends a response to SelectionRequest event.

sendNotifyForDisplay
void sendNotifyForDisplay(Display display, Window requestor, GdkAtom selection, GdkAtom target, GdkAtom property, uint time)

Send a response to SelectionRequest event. Since 2.2

Meta