1 <!-- ##### SECTION Title ##### -->
4 <!-- ##### SECTION Short_Description ##### -->
5 Functions for transfering data via the X selection mechanism
7 <!-- ##### SECTION Long_Description ##### -->
9 The X selection mechanism provides a way to transfer
10 arbitrary chunks of data between programs.
11 A <firstterm>selection</firstterm> is a essentially
12 a named clipboard, identified by a string interned
13 as a #GdkAtom. By claiming ownership of a selection,
14 an application indicates that it will be responsible
15 for supplying its contents. The most common
16 selections are <literal>PRIMARY</literal> and
17 <literal>CLIPBOARD</literal>.
20 The contents of a selection can be represented in
21 a number of formats, called <firstterm>targets</firstterm>.
22 Each target is identified by an atom. A list of
23 all possible targets supported by the selection owner
24 can be retrieved by requesting the special target
25 <literal>TARGETS</literal>. When a selection is
26 retrieved, the data is accompanied by a type
27 (an atom), and a format (an integer, representing
28 the number of bits per item).
29 See <link linkend="gdk-Properties-and-Atoms">Properties and Atoms</link>
33 The functions in this section only contain the lowlevel
34 parts of the selection protocol. A considerably more
35 complicated implementation is needed on top of this.
36 GTK+ contains such an implementation in the functions
37 in <literal>gtkselection.h</literal> and programmers
38 should use those functions instead of the ones presented
39 here. If you plan to implement selection handling
40 directly on top of the functions here, you should refer
41 to the X Inter-client Communication Conventions Manual
45 <!-- ##### SECTION See_Also ##### -->
50 <!-- ##### SECTION Stability_Level ##### -->
53 <!-- ##### SECTION Image ##### -->
56 <!-- ##### MACRO GDK_SELECTION_PRIMARY ##### -->
58 A #GdkAtom representing the <literal>PRIMARY</literal> selection.
63 <!-- ##### MACRO GDK_SELECTION_SECONDARY ##### -->
65 A #GdkAtom representing the <literal>SECONDARY</literal> selection.
70 <!-- ##### MACRO GDK_SELECTION_CLIPBOARD ##### -->
72 A #GdkAtom representing the <literal>CLIPBOARD</literal> selection.
77 <!-- ##### MACRO GDK_TARGET_BITMAP ##### -->
79 A #GdkAtom representing the <literal>BITMAP</literal> selection target.
84 <!-- ##### MACRO GDK_TARGET_COLORMAP ##### -->
86 A #GdkAtom representing the <literal>COLORMAP</literal> selection target.
91 <!-- ##### MACRO GDK_TARGET_DRAWABLE ##### -->
93 A #GdkAtom representing the <literal>DRAWABLE</literal> selection target.
98 <!-- ##### MACRO GDK_TARGET_PIXMAP ##### -->
100 A #GdkAtom representing the <literal>PIXMAP</literal> selection target.
105 <!-- ##### MACRO GDK_TARGET_STRING ##### -->
107 A #GdkAtom representing the <literal>STRING</literal> selection target.
112 <!-- ##### MACRO GDK_SELECTION_TYPE_ATOM ##### -->
114 A #GdkAtom representing the <literal>ATOM</literal> selection type.
119 <!-- ##### MACRO GDK_SELECTION_TYPE_BITMAP ##### -->
121 A #GdkAtom representing the <literal>BITMAP</literal> selection type.
126 <!-- ##### MACRO GDK_SELECTION_TYPE_COLORMAP ##### -->
128 A #GdkAtom representing the <literal>COLORMAP</literal> selection type.
133 <!-- ##### MACRO GDK_SELECTION_TYPE_DRAWABLE ##### -->
135 A #GdkAtom representing the <literal>DRAWABLE</literal> selection type.
140 <!-- ##### MACRO GDK_SELECTION_TYPE_INTEGER ##### -->
142 A #GdkAtom representing the <literal>INTEGER</literal> selection type.
147 <!-- ##### MACRO GDK_SELECTION_TYPE_PIXMAP ##### -->
149 A #GdkAtom representing the <literal>PIXMAP</literal> selection type.
154 <!-- ##### MACRO GDK_SELECTION_TYPE_WINDOW ##### -->
156 A #GdkAtom representing the <literal>WINDOW</literal> selection type.
161 <!-- ##### MACRO GDK_SELECTION_TYPE_STRING ##### -->
163 A #GdkAtom representing the <literal>STRING</literal> selection type.
168 <!-- ##### FUNCTION gdk_selection_owner_set ##### -->
170 Sets the owner of the given selection.
173 @owner: a #GdkWindow or %NULL to indicate that the
174 the owner for the given should be unset.
175 @selection: an atom identifying a selection.
176 @time_: timestamp to use when setting the selection.
177 If this is older than the timestamp given last
178 time the owner was set for the given selection, the
179 request will be ignored.
180 @send_event: if %TRUE, and the new owner is different
181 from the current owner, the current owner
182 will be sent a SelectionClear event.
183 @Returns: %TRUE if the selection owner was successfully
184 changed to @owner, otherwise %FALSE.
187 <!-- ##### FUNCTION gdk_selection_owner_set_for_display ##### -->
200 <!-- ##### FUNCTION gdk_selection_owner_get ##### -->
202 Determines the owner of the given selection.
205 @selection: an atom indentifying a selection.
206 @Returns: if there is a selection owner for this window,
207 and it is a window known to the current process,
208 the #GdkWindow that owns the selection, otherwise
209 %NULL. Note that the return value may be owned
210 by a different process if a foreign window
211 was previously created for that window, but
212 a new foreign window will never be created by
216 <!-- ##### FUNCTION gdk_selection_owner_get_for_display ##### -->
226 <!-- ##### FUNCTION gdk_selection_convert ##### -->
228 Retrieves the contents of a selection in a given
232 @requestor: a #GdkWindow.
233 @selection: an atom identifying the selection to get the
235 @target: the form in which to retrieve the selection.
236 @time_: the timestamp to use when retrieving the
237 selection. The selection owner may refuse the
238 request if it did not own the selection at
239 the time indicated by the timestamp.
242 <!-- ##### FUNCTION gdk_selection_property_get ##### -->
253 <!-- ##### FUNCTION gdk_selection_send_notify ##### -->
255 Sends a response to SelectionRequest event.
258 @requestor: window to which to deliver response.
259 @selection: selection that was requested.
260 @target: target that was selected.
261 @property: property in which the selection owner stored the
262 data, or %GDK_NONE to indicate that the request
267 <!-- ##### FUNCTION gdk_selection_send_notify_for_display ##### -->