1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
<title>Selections</title>
6
<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
7
<link rel="home" href="index.html" title="GDK 2 Reference Manual">
8
<link rel="up" href="reference.html" title="API Reference">
9
<link rel="prev" href="gdk-Keyboard-Handling.html" title="Key Values">
10
<link rel="next" href="gdk-Drag-and-Drop.html" title="Drag and Drop">
11
<meta name="generator" content="GTK-Doc V1.18.1 (XML mode)">
12
<link rel="stylesheet" href="style.css" type="text/css">
14
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
17
<td><a accesskey="p" href="gdk-Keyboard-Handling.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18
<td><a accesskey="u" href="reference.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
19
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
20
<th width="100%" align="center">GDK 2 Reference Manual</th>
21
<td><a accesskey="n" href="gdk-Drag-and-Drop.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
23
<tr><td colspan="5" class="shortcuts">
24
<a href="#gdk-Selections.synopsis" class="shortcut">Top</a>
26
<a href="#gdk-Selections.description" class="shortcut">Description</a>
29
<div class="refentry">
30
<a name="gdk-Selections"></a><div class="titlepage"></div>
31
<div class="refnamediv"><table width="100%"><tr>
33
<h2><span class="refentrytitle"><a name="gdk-Selections.top_of_page"></a>Selections</span></h2>
34
<p>Selections — Functions for transfering data via the X selection mechanism</p>
36
<td valign="top" align="right"></td>
38
<div class="refsynopsisdiv">
39
<a name="gdk-Selections.synopsis"></a><h2>Synopsis</h2>
40
<pre class="synopsis">
41
#include <gdk/gdk.h>
43
typedef <a class="link" href="gdk-Selections.html#GdkSelection" title="GdkSelection">GdkSelection</a>;
44
typedef <a class="link" href="gdk-Selections.html#GdkSelectionType" title="GdkSelectionType">GdkSelectionType</a>;
45
typedef <a class="link" href="gdk-Selections.html#GdkTarget" title="GdkTarget">GdkTarget</a>;
46
#define <a class="link" href="gdk-Selections.html#GDK-SELECTION-PRIMARY:CAPS" title="GDK_SELECTION_PRIMARY">GDK_SELECTION_PRIMARY</a>
47
#define <a class="link" href="gdk-Selections.html#GDK-SELECTION-SECONDARY:CAPS" title="GDK_SELECTION_SECONDARY">GDK_SELECTION_SECONDARY</a>
48
#define <a class="link" href="gdk-Selections.html#GDK-SELECTION-CLIPBOARD:CAPS" title="GDK_SELECTION_CLIPBOARD">GDK_SELECTION_CLIPBOARD</a>
49
#define <a class="link" href="gdk-Selections.html#GDK-TARGET-BITMAP:CAPS" title="GDK_TARGET_BITMAP">GDK_TARGET_BITMAP</a>
50
#define <a class="link" href="gdk-Selections.html#GDK-TARGET-COLORMAP:CAPS" title="GDK_TARGET_COLORMAP">GDK_TARGET_COLORMAP</a>
51
#define <a class="link" href="gdk-Selections.html#GDK-TARGET-DRAWABLE:CAPS" title="GDK_TARGET_DRAWABLE">GDK_TARGET_DRAWABLE</a>
52
#define <a class="link" href="gdk-Selections.html#GDK-TARGET-PIXMAP:CAPS" title="GDK_TARGET_PIXMAP">GDK_TARGET_PIXMAP</a>
53
#define <a class="link" href="gdk-Selections.html#GDK-TARGET-STRING:CAPS" title="GDK_TARGET_STRING">GDK_TARGET_STRING</a>
54
#define <a class="link" href="gdk-Selections.html#GDK-SELECTION-TYPE-ATOM:CAPS" title="GDK_SELECTION_TYPE_ATOM">GDK_SELECTION_TYPE_ATOM</a>
55
#define <a class="link" href="gdk-Selections.html#GDK-SELECTION-TYPE-BITMAP:CAPS" title="GDK_SELECTION_TYPE_BITMAP">GDK_SELECTION_TYPE_BITMAP</a>
56
#define <a class="link" href="gdk-Selections.html#GDK-SELECTION-TYPE-COLORMAP:CAPS" title="GDK_SELECTION_TYPE_COLORMAP">GDK_SELECTION_TYPE_COLORMAP</a>
57
#define <a class="link" href="gdk-Selections.html#GDK-SELECTION-TYPE-DRAWABLE:CAPS" title="GDK_SELECTION_TYPE_DRAWABLE">GDK_SELECTION_TYPE_DRAWABLE</a>
58
#define <a class="link" href="gdk-Selections.html#GDK-SELECTION-TYPE-INTEGER:CAPS" title="GDK_SELECTION_TYPE_INTEGER">GDK_SELECTION_TYPE_INTEGER</a>
59
#define <a class="link" href="gdk-Selections.html#GDK-SELECTION-TYPE-PIXMAP:CAPS" title="GDK_SELECTION_TYPE_PIXMAP">GDK_SELECTION_TYPE_PIXMAP</a>
60
#define <a class="link" href="gdk-Selections.html#GDK-SELECTION-TYPE-WINDOW:CAPS" title="GDK_SELECTION_TYPE_WINDOW">GDK_SELECTION_TYPE_WINDOW</a>
61
#define <a class="link" href="gdk-Selections.html#GDK-SELECTION-TYPE-STRING:CAPS" title="GDK_SELECTION_TYPE_STRING">GDK_SELECTION_TYPE_STRING</a>
62
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="gdk-Selections.html#gdk-selection-owner-set" title="gdk_selection_owner_set ()">gdk_selection_owner_set</a> (<em class="parameter"><code><a class="link" href="gdk-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a> *owner</code></em>,
63
<em class="parameter"><code><a class="link" href="gdk-Properties-and-Atoms.html#GdkAtom" title="GdkAtom"><span class="type">GdkAtom</span></a> selection</code></em>,
64
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> time_</code></em>,
65
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> send_event</code></em>);
66
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="gdk-Selections.html#gdk-selection-owner-set-for-display" title="gdk_selection_owner_set_for_display ()">gdk_selection_owner_set_for_display</a> (<em class="parameter"><code><a class="link" href="GdkDisplay.html" title="GdkDisplay"><span class="type">GdkDisplay</span></a> *display</code></em>,
67
<em class="parameter"><code><a class="link" href="gdk-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a> *owner</code></em>,
68
<em class="parameter"><code><a class="link" href="gdk-Properties-and-Atoms.html#GdkAtom" title="GdkAtom"><span class="type">GdkAtom</span></a> selection</code></em>,
69
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> time_</code></em>,
70
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> send_event</code></em>);
71
<a class="link" href="gdk-Windows.html#GdkWindow"><span class="returnvalue">GdkWindow</span></a> * <a class="link" href="gdk-Selections.html#gdk-selection-owner-get" title="gdk_selection_owner_get ()">gdk_selection_owner_get</a> (<em class="parameter"><code><a class="link" href="gdk-Properties-and-Atoms.html#GdkAtom" title="GdkAtom"><span class="type">GdkAtom</span></a> selection</code></em>);
72
<a class="link" href="gdk-Windows.html#GdkWindow"><span class="returnvalue">GdkWindow</span></a> * <a class="link" href="gdk-Selections.html#gdk-selection-owner-get-for-display" title="gdk_selection_owner_get_for_display ()">gdk_selection_owner_get_for_display</a> (<em class="parameter"><code><a class="link" href="GdkDisplay.html" title="GdkDisplay"><span class="type">GdkDisplay</span></a> *display</code></em>,
73
<em class="parameter"><code><a class="link" href="gdk-Properties-and-Atoms.html#GdkAtom" title="GdkAtom"><span class="type">GdkAtom</span></a> selection</code></em>);
74
<span class="returnvalue">void</span> <a class="link" href="gdk-Selections.html#gdk-selection-convert" title="gdk_selection_convert ()">gdk_selection_convert</a> (<em class="parameter"><code><a class="link" href="gdk-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a> *requestor</code></em>,
75
<em class="parameter"><code><a class="link" href="gdk-Properties-and-Atoms.html#GdkAtom" title="GdkAtom"><span class="type">GdkAtom</span></a> selection</code></em>,
76
<em class="parameter"><code><a class="link" href="gdk-Properties-and-Atoms.html#GdkAtom" title="GdkAtom"><span class="type">GdkAtom</span></a> target</code></em>,
77
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> time_</code></em>);
78
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a> <a class="link" href="gdk-Selections.html#gdk-selection-property-get" title="gdk_selection_property_get ()">gdk_selection_property_get</a> (<em class="parameter"><code><a class="link" href="gdk-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a> *requestor</code></em>,
79
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guchar"><span class="type">guchar</span></a> **data</code></em>,
80
<em class="parameter"><code><a class="link" href="gdk-Properties-and-Atoms.html#GdkAtom" title="GdkAtom"><span class="type">GdkAtom</span></a> *prop_type</code></em>,
81
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *prop_format</code></em>);
82
<span class="returnvalue">void</span> <a class="link" href="gdk-Selections.html#gdk-selection-send-notify" title="gdk_selection_send_notify ()">gdk_selection_send_notify</a> (<em class="parameter"><code><a class="link" href="gdk-Event-Structures.html#GdkNativeWindow" title="GdkNativeWindow"><span class="type">GdkNativeWindow</span></a> requestor</code></em>,
83
<em class="parameter"><code><a class="link" href="gdk-Properties-and-Atoms.html#GdkAtom" title="GdkAtom"><span class="type">GdkAtom</span></a> selection</code></em>,
84
<em class="parameter"><code><a class="link" href="gdk-Properties-and-Atoms.html#GdkAtom" title="GdkAtom"><span class="type">GdkAtom</span></a> target</code></em>,
85
<em class="parameter"><code><a class="link" href="gdk-Properties-and-Atoms.html#GdkAtom" title="GdkAtom"><span class="type">GdkAtom</span></a> property</code></em>,
86
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> time_</code></em>);
87
<span class="returnvalue">void</span> <a class="link" href="gdk-Selections.html#gdk-selection-send-notify-for-display" title="gdk_selection_send_notify_for_display ()">gdk_selection_send_notify_for_display</a>
88
(<em class="parameter"><code><a class="link" href="GdkDisplay.html" title="GdkDisplay"><span class="type">GdkDisplay</span></a> *display</code></em>,
89
<em class="parameter"><code><a class="link" href="gdk-Event-Structures.html#GdkNativeWindow" title="GdkNativeWindow"><span class="type">GdkNativeWindow</span></a> requestor</code></em>,
90
<em class="parameter"><code><a class="link" href="gdk-Properties-and-Atoms.html#GdkAtom" title="GdkAtom"><span class="type">GdkAtom</span></a> selection</code></em>,
91
<em class="parameter"><code><a class="link" href="gdk-Properties-and-Atoms.html#GdkAtom" title="GdkAtom"><span class="type">GdkAtom</span></a> target</code></em>,
92
<em class="parameter"><code><a class="link" href="gdk-Properties-and-Atoms.html#GdkAtom" title="GdkAtom"><span class="type">GdkAtom</span></a> property</code></em>,
93
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> time_</code></em>);
96
<div class="refsect1">
97
<a name="gdk-Selections.description"></a><h2>Description</h2>
99
The X selection mechanism provides a way to transfer
100
arbitrary chunks of data between programs.
101
A <em class="firstterm">selection</em> is a essentially
102
a named clipboard, identified by a string interned
103
as a <a class="link" href="gdk-Properties-and-Atoms.html#GdkAtom" title="GdkAtom"><span class="type">GdkAtom</span></a>. By claiming ownership of a selection,
104
an application indicates that it will be responsible
105
for supplying its contents. The most common
106
selections are <code class="literal">PRIMARY</code> and
107
<code class="literal">CLIPBOARD</code>.
110
The contents of a selection can be represented in
111
a number of formats, called <em class="firstterm">targets</em>.
112
Each target is identified by an atom. A list of
113
all possible targets supported by the selection owner
114
can be retrieved by requesting the special target
115
<code class="literal">TARGETS</code>. When a selection is
116
retrieved, the data is accompanied by a type
117
(an atom), and a format (an integer, representing
118
the number of bits per item).
119
See <a class="link" href="gdk-Properties-and-Atoms.html" title="Properties and Atoms">Properties and Atoms</a>
120
for more information.
123
The functions in this section only contain the lowlevel
124
parts of the selection protocol. A considerably more
125
complicated implementation is needed on top of this.
126
GTK+ contains such an implementation in the functions
127
in <code class="literal">gtkselection.h</code> and programmers
128
should use those functions instead of the ones presented
129
here. If you plan to implement selection handling
130
directly on top of the functions here, you should refer
131
to the X Inter-client Communication Conventions Manual
135
<div class="refsect1">
136
<a name="gdk-Selections.details"></a><h2>Details</h2>
137
<div class="refsect2">
138
<a name="GdkSelection"></a><h3>GdkSelection</h3>
139
<pre class="programlisting">typedef GdkAtom GdkSelection;
141
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
142
<h3 class="title">Warning</h3>
143
<p><code class="literal">GdkSelection</code> is deprecated and should not be used in newly-written code.</p>
146
The <a class="link" href="gdk-Selections.html#GdkSelection" title="GdkSelection"><span class="type">GdkSelection</span></a> enumeration contains predefined
147
atom values for several common selections.
151
<div class="refsect2">
152
<a name="GdkSelectionType"></a><h3>GdkSelectionType</h3>
153
<pre class="programlisting">typedef GdkAtom GdkSelectionType;
155
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
156
<h3 class="title">Warning</h3>
157
<p><code class="literal">GdkSelectionType</code> is deprecated and should not be used in newly-written code.</p>
160
The <a class="link" href="gdk-Selections.html#GdkSelectionType" title="GdkSelectionType"><span class="type">GdkSelectionType</span></a> enumeration contains predefined
161
atom values used to represent the types of data transferred
162
in response to a request for a target. See the
163
ICCCM for details about what data should be transferred
164
for each of these types. Other atoms can be used,
165
and the recommended practice for GTK+ is to to use mime
166
types for this purpose. However, supporting these types
167
may be useful for compatibility with older programs.
171
<div class="refsect2">
172
<a name="GdkTarget"></a><h3>GdkTarget</h3>
173
<pre class="programlisting">typedef GdkAtom GdkTarget;
175
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
176
<h3 class="title">Warning</h3>
177
<p><code class="literal">GdkTarget</code> is deprecated and should not be used in newly-written code.</p>
180
The <a class="link" href="gdk-Selections.html#GdkTarget" title="GdkTarget"><span class="type">GdkTarget</span></a> enumeration contains predefined atom values which are
181
used to describe possible targets for a selection. Other atoms can be
182
used, and the recommended practice for GTK+ is to to use mime types
183
for this purpose. However, supporting these types may be useful for
184
compatibility with older programs.
188
<div class="refsect2">
189
<a name="GDK-SELECTION-PRIMARY:CAPS"></a><h3>GDK_SELECTION_PRIMARY</h3>
190
<pre class="programlisting">#define GDK_SELECTION_PRIMARY _GDK_MAKE_ATOM (1)
193
A <a class="link" href="gdk-Properties-and-Atoms.html#GdkAtom" title="GdkAtom"><span class="type">GdkAtom</span></a> representing the <code class="literal">PRIMARY</code> selection.
197
<div class="refsect2">
198
<a name="GDK-SELECTION-SECONDARY:CAPS"></a><h3>GDK_SELECTION_SECONDARY</h3>
199
<pre class="programlisting">#define GDK_SELECTION_SECONDARY _GDK_MAKE_ATOM (2)
202
A <a class="link" href="gdk-Properties-and-Atoms.html#GdkAtom" title="GdkAtom"><span class="type">GdkAtom</span></a> representing the <code class="literal">SECONDARY</code> selection.
206
<div class="refsect2">
207
<a name="GDK-SELECTION-CLIPBOARD:CAPS"></a><h3>GDK_SELECTION_CLIPBOARD</h3>
208
<pre class="programlisting">#define GDK_SELECTION_CLIPBOARD _GDK_MAKE_ATOM (69)
211
A <a class="link" href="gdk-Properties-and-Atoms.html#GdkAtom" title="GdkAtom"><span class="type">GdkAtom</span></a> representing the <code class="literal">CLIPBOARD</code> selection.
215
<div class="refsect2">
216
<a name="GDK-TARGET-BITMAP:CAPS"></a><h3>GDK_TARGET_BITMAP</h3>
217
<pre class="programlisting">#define GDK_TARGET_BITMAP _GDK_MAKE_ATOM (5)
220
A <a class="link" href="gdk-Properties-and-Atoms.html#GdkAtom" title="GdkAtom"><span class="type">GdkAtom</span></a> representing the <code class="literal">BITMAP</code> selection target.
224
<div class="refsect2">
225
<a name="GDK-TARGET-COLORMAP:CAPS"></a><h3>GDK_TARGET_COLORMAP</h3>
226
<pre class="programlisting">#define GDK_TARGET_COLORMAP _GDK_MAKE_ATOM (7)
229
A <a class="link" href="gdk-Properties-and-Atoms.html#GdkAtom" title="GdkAtom"><span class="type">GdkAtom</span></a> representing the <code class="literal">COLORMAP</code> selection target.
233
<div class="refsect2">
234
<a name="GDK-TARGET-DRAWABLE:CAPS"></a><h3>GDK_TARGET_DRAWABLE</h3>
235
<pre class="programlisting">#define GDK_TARGET_DRAWABLE _GDK_MAKE_ATOM (17)
238
A <a class="link" href="gdk-Properties-and-Atoms.html#GdkAtom" title="GdkAtom"><span class="type">GdkAtom</span></a> representing the <code class="literal">DRAWABLE</code> selection target.
242
<div class="refsect2">
243
<a name="GDK-TARGET-PIXMAP:CAPS"></a><h3>GDK_TARGET_PIXMAP</h3>
244
<pre class="programlisting">#define GDK_TARGET_PIXMAP _GDK_MAKE_ATOM (20)
247
A <a class="link" href="gdk-Properties-and-Atoms.html#GdkAtom" title="GdkAtom"><span class="type">GdkAtom</span></a> representing the <code class="literal">PIXMAP</code> selection target.
251
<div class="refsect2">
252
<a name="GDK-TARGET-STRING:CAPS"></a><h3>GDK_TARGET_STRING</h3>
253
<pre class="programlisting">#define GDK_TARGET_STRING _GDK_MAKE_ATOM (31)
256
A <a class="link" href="gdk-Properties-and-Atoms.html#GdkAtom" title="GdkAtom"><span class="type">GdkAtom</span></a> representing the <code class="literal">STRING</code> selection target.
260
<div class="refsect2">
261
<a name="GDK-SELECTION-TYPE-ATOM:CAPS"></a><h3>GDK_SELECTION_TYPE_ATOM</h3>
262
<pre class="programlisting">#define GDK_SELECTION_TYPE_ATOM _GDK_MAKE_ATOM (4)
265
A <a class="link" href="gdk-Properties-and-Atoms.html#GdkAtom" title="GdkAtom"><span class="type">GdkAtom</span></a> representing the <code class="literal">ATOM</code> selection type.
269
<div class="refsect2">
270
<a name="GDK-SELECTION-TYPE-BITMAP:CAPS"></a><h3>GDK_SELECTION_TYPE_BITMAP</h3>
271
<pre class="programlisting">#define GDK_SELECTION_TYPE_BITMAP _GDK_MAKE_ATOM (5)
274
A <a class="link" href="gdk-Properties-and-Atoms.html#GdkAtom" title="GdkAtom"><span class="type">GdkAtom</span></a> representing the <code class="literal">BITMAP</code> selection type.
278
<div class="refsect2">
279
<a name="GDK-SELECTION-TYPE-COLORMAP:CAPS"></a><h3>GDK_SELECTION_TYPE_COLORMAP</h3>
280
<pre class="programlisting">#define GDK_SELECTION_TYPE_COLORMAP _GDK_MAKE_ATOM (7)
283
A <a class="link" href="gdk-Properties-and-Atoms.html#GdkAtom" title="GdkAtom"><span class="type">GdkAtom</span></a> representing the <code class="literal">COLORMAP</code> selection type.
287
<div class="refsect2">
288
<a name="GDK-SELECTION-TYPE-DRAWABLE:CAPS"></a><h3>GDK_SELECTION_TYPE_DRAWABLE</h3>
289
<pre class="programlisting">#define GDK_SELECTION_TYPE_DRAWABLE _GDK_MAKE_ATOM (17)
292
A <a class="link" href="gdk-Properties-and-Atoms.html#GdkAtom" title="GdkAtom"><span class="type">GdkAtom</span></a> representing the <code class="literal">DRAWABLE</code> selection type.
296
<div class="refsect2">
297
<a name="GDK-SELECTION-TYPE-INTEGER:CAPS"></a><h3>GDK_SELECTION_TYPE_INTEGER</h3>
298
<pre class="programlisting">#define GDK_SELECTION_TYPE_INTEGER _GDK_MAKE_ATOM (19)
301
A <a class="link" href="gdk-Properties-and-Atoms.html#GdkAtom" title="GdkAtom"><span class="type">GdkAtom</span></a> representing the <code class="literal">INTEGER</code> selection type.
305
<div class="refsect2">
306
<a name="GDK-SELECTION-TYPE-PIXMAP:CAPS"></a><h3>GDK_SELECTION_TYPE_PIXMAP</h3>
307
<pre class="programlisting">#define GDK_SELECTION_TYPE_PIXMAP _GDK_MAKE_ATOM (20)
310
A <a class="link" href="gdk-Properties-and-Atoms.html#GdkAtom" title="GdkAtom"><span class="type">GdkAtom</span></a> representing the <code class="literal">PIXMAP</code> selection type.
314
<div class="refsect2">
315
<a name="GDK-SELECTION-TYPE-WINDOW:CAPS"></a><h3>GDK_SELECTION_TYPE_WINDOW</h3>
316
<pre class="programlisting">#define GDK_SELECTION_TYPE_WINDOW _GDK_MAKE_ATOM (33)
319
A <a class="link" href="gdk-Properties-and-Atoms.html#GdkAtom" title="GdkAtom"><span class="type">GdkAtom</span></a> representing the <code class="literal">WINDOW</code> selection type.
323
<div class="refsect2">
324
<a name="GDK-SELECTION-TYPE-STRING:CAPS"></a><h3>GDK_SELECTION_TYPE_STRING</h3>
325
<pre class="programlisting">#define GDK_SELECTION_TYPE_STRING _GDK_MAKE_ATOM (31)
328
A <a class="link" href="gdk-Properties-and-Atoms.html#GdkAtom" title="GdkAtom"><span class="type">GdkAtom</span></a> representing the <code class="literal">STRING</code> selection type.
332
<div class="refsect2">
333
<a name="gdk-selection-owner-set"></a><h3>gdk_selection_owner_set ()</h3>
334
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gdk_selection_owner_set (<em class="parameter"><code><a class="link" href="gdk-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a> *owner</code></em>,
335
<em class="parameter"><code><a class="link" href="gdk-Properties-and-Atoms.html#GdkAtom" title="GdkAtom"><span class="type">GdkAtom</span></a> selection</code></em>,
336
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> time_</code></em>,
337
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> send_event</code></em>);</pre>
339
Sets the owner of the given selection.
341
<div class="variablelist"><table border="0" class="variablelist">
343
<col align="left" valign="top">
348
<td><p><span class="term"><em class="parameter"><code>owner</code></em> :</span></p></td>
349
<td>a <a class="link" href="gdk-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a> or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to indicate that the
350
the owner for the given should be unset.</td>
353
<td><p><span class="term"><em class="parameter"><code>selection</code></em> :</span></p></td>
354
<td>an atom identifying a selection.</td>
357
<td><p><span class="term"><em class="parameter"><code>time_</code></em> :</span></p></td>
358
<td>timestamp to use when setting the selection.
359
If this is older than the timestamp given last
360
time the owner was set for the given selection, the
361
request will be ignored.</td>
364
<td><p><span class="term"><em class="parameter"><code>send_event</code></em> :</span></p></td>
365
<td>if <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>, and the new owner is different
366
from the current owner, the current owner
367
will be sent a SelectionClear event.</td>
370
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
372
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the selection owner was successfully
373
changed to <em class="parameter"><code>owner</code></em>, otherwise <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>.</td>
379
<div class="refsect2">
380
<a name="gdk-selection-owner-set-for-display"></a><h3>gdk_selection_owner_set_for_display ()</h3>
381
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gdk_selection_owner_set_for_display (<em class="parameter"><code><a class="link" href="GdkDisplay.html" title="GdkDisplay"><span class="type">GdkDisplay</span></a> *display</code></em>,
382
<em class="parameter"><code><a class="link" href="gdk-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a> *owner</code></em>,
383
<em class="parameter"><code><a class="link" href="gdk-Properties-and-Atoms.html#GdkAtom" title="GdkAtom"><span class="type">GdkAtom</span></a> selection</code></em>,
384
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> time_</code></em>,
385
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> send_event</code></em>);</pre>
387
Sets the <a class="link" href="gdk-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a> <em class="parameter"><code>owner</code></em> as the current owner of the selection <em class="parameter"><code>selection</code></em>.
389
<div class="variablelist"><table border="0" class="variablelist">
391
<col align="left" valign="top">
396
<td><p><span class="term"><em class="parameter"><code>display</code></em> :</span></p></td>
397
<td>the <a class="link" href="GdkDisplay.html" title="GdkDisplay"><span class="type">GdkDisplay</span></a>.</td>
400
<td><p><span class="term"><em class="parameter"><code>owner</code></em> :</span></p></td>
401
<td>a <a class="link" href="gdk-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a> or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to indicate that the owner for
402
the given should be unset.</td>
405
<td><p><span class="term"><em class="parameter"><code>selection</code></em> :</span></p></td>
406
<td>an atom identifying a selection.</td>
409
<td><p><span class="term"><em class="parameter"><code>time_</code></em> :</span></p></td>
410
<td>timestamp to use when setting the selection.
411
If this is older than the timestamp given last time the owner was
412
set for the given selection, the request will be ignored.</td>
415
<td><p><span class="term"><em class="parameter"><code>send_event</code></em> :</span></p></td>
416
<td>if <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>, and the new owner is different from the current
417
owner, the current owner will be sent a SelectionClear event.</td>
420
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
422
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the selection owner was successfully changed to owner,
423
otherwise <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>.</td>
427
<p class="since">Since 2.2</p>
430
<div class="refsect2">
431
<a name="gdk-selection-owner-get"></a><h3>gdk_selection_owner_get ()</h3>
432
<pre class="programlisting"><a class="link" href="gdk-Windows.html#GdkWindow"><span class="returnvalue">GdkWindow</span></a> * gdk_selection_owner_get (<em class="parameter"><code><a class="link" href="gdk-Properties-and-Atoms.html#GdkAtom" title="GdkAtom"><span class="type">GdkAtom</span></a> selection</code></em>);</pre>
434
Determines the owner of the given selection.
436
<div class="variablelist"><table border="0" class="variablelist">
438
<col align="left" valign="top">
443
<td><p><span class="term"><em class="parameter"><code>selection</code></em> :</span></p></td>
444
<td>an atom indentifying a selection.</td>
447
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
448
<td>if there is a selection owner for this window,
449
and it is a window known to the current process,
450
the <a class="link" href="gdk-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a> that owns the selection, otherwise
451
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. Note that the return value may be owned
452
by a different process if a foreign window
453
was previously created for that window, but
454
a new foreign window will never be created by
461
<div class="refsect2">
462
<a name="gdk-selection-owner-get-for-display"></a><h3>gdk_selection_owner_get_for_display ()</h3>
463
<pre class="programlisting"><a class="link" href="gdk-Windows.html#GdkWindow"><span class="returnvalue">GdkWindow</span></a> * gdk_selection_owner_get_for_display (<em class="parameter"><code><a class="link" href="GdkDisplay.html" title="GdkDisplay"><span class="type">GdkDisplay</span></a> *display</code></em>,
464
<em class="parameter"><code><a class="link" href="gdk-Properties-and-Atoms.html#GdkAtom" title="GdkAtom"><span class="type">GdkAtom</span></a> selection</code></em>);</pre>
466
Determine the owner of the given selection.
469
Note that the return value may be owned by a different
470
process if a foreign window was previously created for that
471
window, but a new foreign window will never be created by this call.
473
<div class="variablelist"><table border="0" class="variablelist">
475
<col align="left" valign="top">
480
<td><p><span class="term"><em class="parameter"><code>display</code></em> :</span></p></td>
481
<td>a <a class="link" href="GdkDisplay.html" title="GdkDisplay"><span class="type">GdkDisplay</span></a>.</td>
484
<td><p><span class="term"><em class="parameter"><code>selection</code></em> :</span></p></td>
485
<td>an atom indentifying a selection.</td>
488
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
489
<td>if there is a selection owner for this window, and it is a
490
window known to the current process, the <a class="link" href="gdk-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a> that owns the
491
selection, otherwise <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</td>
495
<p class="since">Since 2.2</p>
498
<div class="refsect2">
499
<a name="gdk-selection-convert"></a><h3>gdk_selection_convert ()</h3>
500
<pre class="programlisting"><span class="returnvalue">void</span> gdk_selection_convert (<em class="parameter"><code><a class="link" href="gdk-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a> *requestor</code></em>,
501
<em class="parameter"><code><a class="link" href="gdk-Properties-and-Atoms.html#GdkAtom" title="GdkAtom"><span class="type">GdkAtom</span></a> selection</code></em>,
502
<em class="parameter"><code><a class="link" href="gdk-Properties-and-Atoms.html#GdkAtom" title="GdkAtom"><span class="type">GdkAtom</span></a> target</code></em>,
503
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> time_</code></em>);</pre>
505
Retrieves the contents of a selection in a given
508
<div class="variablelist"><table border="0" class="variablelist">
510
<col align="left" valign="top">
515
<td><p><span class="term"><em class="parameter"><code>requestor</code></em> :</span></p></td>
516
<td>a <a class="link" href="gdk-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a>.</td>
519
<td><p><span class="term"><em class="parameter"><code>selection</code></em> :</span></p></td>
520
<td>an atom identifying the selection to get the
524
<td><p><span class="term"><em class="parameter"><code>target</code></em> :</span></p></td>
525
<td>the form in which to retrieve the selection.</td>
528
<td><p><span class="term"><em class="parameter"><code>time_</code></em> :</span></p></td>
529
<td>the timestamp to use when retrieving the
530
selection. The selection owner may refuse the
531
request if it did not own the selection at
532
the time indicated by the timestamp.</td>
538
<div class="refsect2">
539
<a name="gdk-selection-property-get"></a><h3>gdk_selection_property_get ()</h3>
540
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a> gdk_selection_property_get (<em class="parameter"><code><a class="link" href="gdk-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a> *requestor</code></em>,
541
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guchar"><span class="type">guchar</span></a> **data</code></em>,
542
<em class="parameter"><code><a class="link" href="gdk-Properties-and-Atoms.html#GdkAtom" title="GdkAtom"><span class="type">GdkAtom</span></a> *prop_type</code></em>,
543
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *prop_format</code></em>);</pre>
545
Retrieves selection data that was stored by the selection
546
data in response to a call to <a class="link" href="gdk-Selections.html#gdk-selection-convert" title="gdk_selection_convert ()"><code class="function">gdk_selection_convert()</code></a>. This function
547
will not be used by applications, who should use the <a href="http://library.gnome.org/devel/gtk3/gtk-Clipboards.html#GtkClipboard"><span class="type">GtkClipboard</span></a>
550
<div class="variablelist"><table border="0" class="variablelist">
552
<col align="left" valign="top">
557
<td><p><span class="term"><em class="parameter"><code>requestor</code></em> :</span></p></td>
558
<td>the window on which the data is stored</td>
561
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
562
<td>location to store a pointer to the retrieved data.
563
If the retrieval failed, <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> we be stored here, otherwise, it
564
will be non-<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> and the returned data should be freed with <a href="http://library.gnome.org/devel/glib/unstable/glib-Memory-Allocation.html#g-free"><code class="function">g_free()</code></a>
565
when you are finished using it. The length of the
566
allocated memory is one more than the length
567
of the returned data, and the final byte will always
568
be zero, to ensure nul-termination of strings.</td>
571
<td><p><span class="term"><em class="parameter"><code>prop_type</code></em> :</span></p></td>
572
<td>location to store the type of the property.</td>
575
<td><p><span class="term"><em class="parameter"><code>prop_format</code></em> :</span></p></td>
576
<td>location to store the format of the property.</td>
579
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
580
<td>the length of the retrieved data.</td>
586
<div class="refsect2">
587
<a name="gdk-selection-send-notify"></a><h3>gdk_selection_send_notify ()</h3>
588
<pre class="programlisting"><span class="returnvalue">void</span> gdk_selection_send_notify (<em class="parameter"><code><a class="link" href="gdk-Event-Structures.html#GdkNativeWindow" title="GdkNativeWindow"><span class="type">GdkNativeWindow</span></a> requestor</code></em>,
589
<em class="parameter"><code><a class="link" href="gdk-Properties-and-Atoms.html#GdkAtom" title="GdkAtom"><span class="type">GdkAtom</span></a> selection</code></em>,
590
<em class="parameter"><code><a class="link" href="gdk-Properties-and-Atoms.html#GdkAtom" title="GdkAtom"><span class="type">GdkAtom</span></a> target</code></em>,
591
<em class="parameter"><code><a class="link" href="gdk-Properties-and-Atoms.html#GdkAtom" title="GdkAtom"><span class="type">GdkAtom</span></a> property</code></em>,
592
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> time_</code></em>);</pre>
594
Sends a response to SelectionRequest event.
596
<div class="variablelist"><table border="0" class="variablelist">
598
<col align="left" valign="top">
603
<td><p><span class="term"><em class="parameter"><code>requestor</code></em> :</span></p></td>
604
<td>window to which to deliver response.</td>
607
<td><p><span class="term"><em class="parameter"><code>selection</code></em> :</span></p></td>
608
<td>selection that was requested.</td>
611
<td><p><span class="term"><em class="parameter"><code>target</code></em> :</span></p></td>
612
<td>target that was selected.</td>
615
<td><p><span class="term"><em class="parameter"><code>property</code></em> :</span></p></td>
616
<td>property in which the selection owner stored the
617
data, or <a class="link" href="gdk-Properties-and-Atoms.html#GDK-NONE:CAPS" title="GDK_NONE"><code class="literal">GDK_NONE</code></a> to indicate that the request
621
<td><p><span class="term"><em class="parameter"><code>time_</code></em> :</span></p></td>
628
<div class="refsect2">
629
<a name="gdk-selection-send-notify-for-display"></a><h3>gdk_selection_send_notify_for_display ()</h3>
630
<pre class="programlisting"><span class="returnvalue">void</span> gdk_selection_send_notify_for_display
631
(<em class="parameter"><code><a class="link" href="GdkDisplay.html" title="GdkDisplay"><span class="type">GdkDisplay</span></a> *display</code></em>,
632
<em class="parameter"><code><a class="link" href="gdk-Event-Structures.html#GdkNativeWindow" title="GdkNativeWindow"><span class="type">GdkNativeWindow</span></a> requestor</code></em>,
633
<em class="parameter"><code><a class="link" href="gdk-Properties-and-Atoms.html#GdkAtom" title="GdkAtom"><span class="type">GdkAtom</span></a> selection</code></em>,
634
<em class="parameter"><code><a class="link" href="gdk-Properties-and-Atoms.html#GdkAtom" title="GdkAtom"><span class="type">GdkAtom</span></a> target</code></em>,
635
<em class="parameter"><code><a class="link" href="gdk-Properties-and-Atoms.html#GdkAtom" title="GdkAtom"><span class="type">GdkAtom</span></a> property</code></em>,
636
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> time_</code></em>);</pre>
638
Send a response to SelectionRequest event.
640
<div class="variablelist"><table border="0" class="variablelist">
642
<col align="left" valign="top">
647
<td><p><span class="term"><em class="parameter"><code>display</code></em> :</span></p></td>
648
<td>the <a class="link" href="GdkDisplay.html" title="GdkDisplay"><span class="type">GdkDisplay</span></a> where <em class="parameter"><code>requestor</code></em> is realized</td>
651
<td><p><span class="term"><em class="parameter"><code>requestor</code></em> :</span></p></td>
652
<td>window to which to deliver response.</td>
655
<td><p><span class="term"><em class="parameter"><code>selection</code></em> :</span></p></td>
656
<td>selection that was requested.</td>
659
<td><p><span class="term"><em class="parameter"><code>target</code></em> :</span></p></td>
660
<td>target that was selected.</td>
663
<td><p><span class="term"><em class="parameter"><code>property</code></em> :</span></p></td>
664
<td>property in which the selection owner stored the data,
665
or <a class="link" href="gdk-Properties-and-Atoms.html#GDK-NONE:CAPS" title="GDK_NONE"><code class="literal">GDK_NONE</code></a> to indicate that the request was rejected.</td>
668
<td><p><span class="term"><em class="parameter"><code>time_</code></em> :</span></p></td>
673
<p class="since">Since 2.2</p>
679
Generated by GTK-Doc V1.18.1</div>
b'\\ No newline at end of file'