<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
               "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY % local.common.attrib "xmlns:xi  CDATA  #FIXED 'http://www.w3.org/2003/XInclude'">
<!ENTITY version SYSTEM "version.xml">
]>
<refentry id="gdk-Selections">
<refmeta>
<refentrytitle role="top_of_page" id="gdk-Selections.top_of_page">Selections</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GDK Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>Selections</refname>
<refpurpose>Functions for transfering data via the X selection mechanism</refpurpose>
</refnamediv>

<refsynopsisdiv id="gdk-Selections.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>

#include &lt;gdk/gdk.h&gt;

typedef             <link linkend="GdkSelection">GdkSelection</link>;
typedef             <link linkend="GdkSelectionType">GdkSelectionType</link>;
typedef             <link linkend="GdkTarget">GdkTarget</link>;
#define             <link linkend="GDK-SELECTION-PRIMARY--CAPS">GDK_SELECTION_PRIMARY</link>
#define             <link linkend="GDK-SELECTION-SECONDARY--CAPS">GDK_SELECTION_SECONDARY</link>
#define             <link linkend="GDK-SELECTION-CLIPBOARD--CAPS">GDK_SELECTION_CLIPBOARD</link>
#define             <link linkend="GDK-TARGET-BITMAP--CAPS">GDK_TARGET_BITMAP</link>
#define             <link linkend="GDK-TARGET-COLORMAP--CAPS">GDK_TARGET_COLORMAP</link>
#define             <link linkend="GDK-TARGET-DRAWABLE--CAPS">GDK_TARGET_DRAWABLE</link>
#define             <link linkend="GDK-TARGET-PIXMAP--CAPS">GDK_TARGET_PIXMAP</link>
#define             <link linkend="GDK-TARGET-STRING--CAPS">GDK_TARGET_STRING</link>
#define             <link linkend="GDK-SELECTION-TYPE-ATOM--CAPS">GDK_SELECTION_TYPE_ATOM</link>
#define             <link linkend="GDK-SELECTION-TYPE-BITMAP--CAPS">GDK_SELECTION_TYPE_BITMAP</link>
#define             <link linkend="GDK-SELECTION-TYPE-COLORMAP--CAPS">GDK_SELECTION_TYPE_COLORMAP</link>
#define             <link linkend="GDK-SELECTION-TYPE-DRAWABLE--CAPS">GDK_SELECTION_TYPE_DRAWABLE</link>
#define             <link linkend="GDK-SELECTION-TYPE-INTEGER--CAPS">GDK_SELECTION_TYPE_INTEGER</link>
#define             <link linkend="GDK-SELECTION-TYPE-PIXMAP--CAPS">GDK_SELECTION_TYPE_PIXMAP</link>
#define             <link linkend="GDK-SELECTION-TYPE-WINDOW--CAPS">GDK_SELECTION_TYPE_WINDOW</link>
#define             <link linkend="GDK-SELECTION-TYPE-STRING--CAPS">GDK_SELECTION_TYPE_STRING</link>
<link linkend="gboolean">gboolean</link>            <link linkend="gdk-selection-owner-set">gdk_selection_owner_set</link>             (<link linkend="GdkWindow">GdkWindow</link> *owner,
                                                         <link linkend="GdkAtom">GdkAtom</link> selection,
                                                         <link linkend="guint32">guint32</link> time_,
                                                         <link linkend="gboolean">gboolean</link> send_event);
<link linkend="gboolean">gboolean</link>            <link linkend="gdk-selection-owner-set-for-display">gdk_selection_owner_set_for_display</link> (<link linkend="GdkDisplay">GdkDisplay</link> *display,
                                                         <link linkend="GdkWindow">GdkWindow</link> *owner,
                                                         <link linkend="GdkAtom">GdkAtom</link> selection,
                                                         <link linkend="guint32">guint32</link> time_,
                                                         <link linkend="gboolean">gboolean</link> send_event);
<link linkend="GdkWindow">GdkWindow</link>*          <link linkend="gdk-selection-owner-get">gdk_selection_owner_get</link>             (<link linkend="GdkAtom">GdkAtom</link> selection);
<link linkend="GdkWindow">GdkWindow</link> *         <link linkend="gdk-selection-owner-get-for-display">gdk_selection_owner_get_for_display</link> (<link linkend="GdkDisplay">GdkDisplay</link> *display,
                                                         <link linkend="GdkAtom">GdkAtom</link> selection);
<link linkend="void">void</link>                <link linkend="gdk-selection-convert">gdk_selection_convert</link>               (<link linkend="GdkWindow">GdkWindow</link> *requestor,
                                                         <link linkend="GdkAtom">GdkAtom</link> selection,
                                                         <link linkend="GdkAtom">GdkAtom</link> target,
                                                         <link linkend="guint32">guint32</link> time_);
<link linkend="gboolean">gboolean</link>            <link linkend="gdk-selection-property-get">gdk_selection_property_get</link>          (<link linkend="GdkWindow">GdkWindow</link> *requestor,
                                                         <link linkend="guchar">guchar</link> **data,
                                                         <link linkend="GdkAtom">GdkAtom</link> *prop_type,
                                                         <link linkend="gint">gint</link> *prop_format);
<link linkend="void">void</link>                <link linkend="gdk-selection-send-notify">gdk_selection_send_notify</link>           (<link linkend="GdkNativeWindow">GdkNativeWindow</link> requestor,
                                                         <link linkend="GdkAtom">GdkAtom</link> selection,
                                                         <link linkend="GdkAtom">GdkAtom</link> target,
                                                         <link linkend="GdkAtom">GdkAtom</link> property,
                                                         <link linkend="guint32">guint32</link> time_);
<link linkend="void">void</link>                <link linkend="gdk-selection-send-notify-for-display">gdk_selection_send_notify_for_display</link>
                                                        (<link linkend="GdkDisplay">GdkDisplay</link> *display,
                                                         <link linkend="GdkNativeWindow">GdkNativeWindow</link> requestor,
                                                         <link linkend="GdkAtom">GdkAtom</link> selection,
                                                         <link linkend="GdkAtom">GdkAtom</link> target,
                                                         <link linkend="GdkAtom">GdkAtom</link> property,
                                                         <link linkend="guint32">guint32</link> time_);
</synopsis>
</refsynopsisdiv>









<refsect1 id="gdk-Selections.description" role="desc">
<title role="desc.title">Description</title>
<para>
The X selection mechanism provides a way to transfer
arbitrary chunks of data between programs.
A <firstterm>selection</firstterm> is a essentially
a named clipboard, identified by a string interned
as a <link linkend="GdkAtom"><type>GdkAtom</type></link>. By claiming ownership of a selection,
an application indicates that it will be responsible
for supplying its contents. The most common
selections are <literal>PRIMARY</literal> and
<literal>CLIPBOARD</literal>.
</para>
<para>
The contents of a selection can be represented in
a number of formats, called <firstterm>targets</firstterm>.
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
<literal>TARGETS</literal>. 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 <link linkend="gdk-Properties-and-Atoms">Properties and Atoms</link>
for more information.
</para>
<para>
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 <literal>gtkselection.h</literal> 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).
</para>
</refsect1>

<refsect1 id="gdk-Selections.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="GdkSelection" role="typedef" condition="deprecated:">
<title>GdkSelection</title>
<indexterm zone="GdkSelection" role="deprecated"><primary sortas="Selection">GdkSelection</primary></indexterm><programlisting>typedef GdkAtom GdkSelection;
</programlisting>
<warning><para><literal>GdkSelection</literal> is deprecated and should not be used in newly-written code.</para></warning>
<para>
The <link linkend="GdkSelection"><type>GdkSelection</type></link> enumeration contains predefined
atom values for several common selections.
</para></refsect2>
<refsect2 id="GdkSelectionType" role="typedef" condition="deprecated:">
<title>GdkSelectionType</title>
<indexterm zone="GdkSelectionType" role="deprecated"><primary sortas="SelectionType">GdkSelectionType</primary></indexterm><programlisting>typedef GdkAtom GdkSelectionType;
</programlisting>
<warning><para><literal>GdkSelectionType</literal> is deprecated and should not be used in newly-written code.</para></warning>
<para>
The <link linkend="GdkSelectionType"><type>GdkSelectionType</type></link> enumeration contains predefined
atom values used to represent the types of data transferred
in response to a request for a target. See the
ICCCM for details about what data should be transferred
for each of these types. Other atoms can be used,
and the recommended practice for GTK+ is to to use mime
types for this purpose. However, supporting these types
may be useful for compatibility with older programs.
</para></refsect2>
<refsect2 id="GdkTarget" role="typedef" condition="deprecated:">
<title>GdkTarget</title>
<indexterm zone="GdkTarget" role="deprecated"><primary sortas="Target">GdkTarget</primary></indexterm><programlisting>typedef GdkAtom GdkTarget;
</programlisting>
<warning><para><literal>GdkTarget</literal> is deprecated and should not be used in newly-written code.</para></warning>
<para>
The <link linkend="GdkTarget"><type>GdkTarget</type></link> enumeration contains predefined atom values which are
used to describe possible targets for a selection. Other atoms can be
used, and the recommended practice for GTK+ is to to use mime types
for this purpose. However, supporting these types may be useful for
compatibility with older programs.
</para></refsect2>
<refsect2 id="GDK-SELECTION-PRIMARY--CAPS" role="macro">
<title>GDK_SELECTION_PRIMARY</title>
<indexterm zone="GDK-SELECTION-PRIMARY--CAPS"><primary sortas="SELECTION_PRIMARY">GDK_SELECTION_PRIMARY</primary></indexterm><programlisting>#define GDK_SELECTION_PRIMARY 		_GDK_MAKE_ATOM (1)
</programlisting>
<para>
A <link linkend="GdkAtom"><type>GdkAtom</type></link> representing the <literal>PRIMARY</literal> selection.
</para></refsect2>
<refsect2 id="GDK-SELECTION-SECONDARY--CAPS" role="macro">
<title>GDK_SELECTION_SECONDARY</title>
<indexterm zone="GDK-SELECTION-SECONDARY--CAPS"><primary sortas="SELECTION_SECONDARY">GDK_SELECTION_SECONDARY</primary></indexterm><programlisting>#define GDK_SELECTION_SECONDARY 	_GDK_MAKE_ATOM (2)
</programlisting>
<para>
A <link linkend="GdkAtom"><type>GdkAtom</type></link> representing the <literal>SECONDARY</literal> selection.
</para></refsect2>
<refsect2 id="GDK-SELECTION-CLIPBOARD--CAPS" role="macro">
<title>GDK_SELECTION_CLIPBOARD</title>
<indexterm zone="GDK-SELECTION-CLIPBOARD--CAPS"><primary sortas="SELECTION_CLIPBOARD">GDK_SELECTION_CLIPBOARD</primary></indexterm><programlisting>#define GDK_SELECTION_CLIPBOARD 	_GDK_MAKE_ATOM (69)
</programlisting>
<para>
A <link linkend="GdkAtom"><type>GdkAtom</type></link> representing the <literal>CLIPBOARD</literal> selection.
</para></refsect2>
<refsect2 id="GDK-TARGET-BITMAP--CAPS" role="macro">
<title>GDK_TARGET_BITMAP</title>
<indexterm zone="GDK-TARGET-BITMAP--CAPS"><primary sortas="TARGET_BITMAP">GDK_TARGET_BITMAP</primary></indexterm><programlisting>#define GDK_TARGET_BITMAP 		_GDK_MAKE_ATOM (5)
</programlisting>
<para>
A <link linkend="GdkAtom"><type>GdkAtom</type></link> representing the <literal>BITMAP</literal> selection target.
</para></refsect2>
<refsect2 id="GDK-TARGET-COLORMAP--CAPS" role="macro">
<title>GDK_TARGET_COLORMAP</title>
<indexterm zone="GDK-TARGET-COLORMAP--CAPS"><primary sortas="TARGET_COLORMAP">GDK_TARGET_COLORMAP</primary></indexterm><programlisting>#define GDK_TARGET_COLORMAP 		_GDK_MAKE_ATOM (7)
</programlisting>
<para>
A <link linkend="GdkAtom"><type>GdkAtom</type></link> representing the <literal>COLORMAP</literal> selection target.
</para></refsect2>
<refsect2 id="GDK-TARGET-DRAWABLE--CAPS" role="macro">
<title>GDK_TARGET_DRAWABLE</title>
<indexterm zone="GDK-TARGET-DRAWABLE--CAPS"><primary sortas="TARGET_DRAWABLE">GDK_TARGET_DRAWABLE</primary></indexterm><programlisting>#define GDK_TARGET_DRAWABLE 		_GDK_MAKE_ATOM (17)
</programlisting>
<para>
A <link linkend="GdkAtom"><type>GdkAtom</type></link> representing the <literal>DRAWABLE</literal> selection target.
</para></refsect2>
<refsect2 id="GDK-TARGET-PIXMAP--CAPS" role="macro">
<title>GDK_TARGET_PIXMAP</title>
<indexterm zone="GDK-TARGET-PIXMAP--CAPS"><primary sortas="TARGET_PIXMAP">GDK_TARGET_PIXMAP</primary></indexterm><programlisting>#define GDK_TARGET_PIXMAP 		_GDK_MAKE_ATOM (20)
</programlisting>
<para>
A <link linkend="GdkAtom"><type>GdkAtom</type></link> representing the <literal>PIXMAP</literal> selection target.
</para></refsect2>
<refsect2 id="GDK-TARGET-STRING--CAPS" role="macro">
<title>GDK_TARGET_STRING</title>
<indexterm zone="GDK-TARGET-STRING--CAPS"><primary sortas="TARGET_STRING">GDK_TARGET_STRING</primary></indexterm><programlisting>#define GDK_TARGET_STRING 		_GDK_MAKE_ATOM (31)
</programlisting>
<para>
A <link linkend="GdkAtom"><type>GdkAtom</type></link> representing the <literal>STRING</literal> selection target.
</para></refsect2>
<refsect2 id="GDK-SELECTION-TYPE-ATOM--CAPS" role="macro">
<title>GDK_SELECTION_TYPE_ATOM</title>
<indexterm zone="GDK-SELECTION-TYPE-ATOM--CAPS"><primary sortas="SELECTION_TYPE_ATOM">GDK_SELECTION_TYPE_ATOM</primary></indexterm><programlisting>#define GDK_SELECTION_TYPE_ATOM 	_GDK_MAKE_ATOM (4)
</programlisting>
<para>
A <link linkend="GdkAtom"><type>GdkAtom</type></link> representing the <literal>ATOM</literal> selection type.
</para></refsect2>
<refsect2 id="GDK-SELECTION-TYPE-BITMAP--CAPS" role="macro">
<title>GDK_SELECTION_TYPE_BITMAP</title>
<indexterm zone="GDK-SELECTION-TYPE-BITMAP--CAPS"><primary sortas="SELECTION_TYPE_BITMAP">GDK_SELECTION_TYPE_BITMAP</primary></indexterm><programlisting>#define GDK_SELECTION_TYPE_BITMAP 	_GDK_MAKE_ATOM (5)
</programlisting>
<para>
A <link linkend="GdkAtom"><type>GdkAtom</type></link> representing the <literal>BITMAP</literal> selection type.
</para></refsect2>
<refsect2 id="GDK-SELECTION-TYPE-COLORMAP--CAPS" role="macro">
<title>GDK_SELECTION_TYPE_COLORMAP</title>
<indexterm zone="GDK-SELECTION-TYPE-COLORMAP--CAPS"><primary sortas="SELECTION_TYPE_COLORMAP">GDK_SELECTION_TYPE_COLORMAP</primary></indexterm><programlisting>#define GDK_SELECTION_TYPE_COLORMAP 	_GDK_MAKE_ATOM (7)
</programlisting>
<para>
A <link linkend="GdkAtom"><type>GdkAtom</type></link> representing the <literal>COLORMAP</literal> selection type.
</para></refsect2>
<refsect2 id="GDK-SELECTION-TYPE-DRAWABLE--CAPS" role="macro">
<title>GDK_SELECTION_TYPE_DRAWABLE</title>
<indexterm zone="GDK-SELECTION-TYPE-DRAWABLE--CAPS"><primary sortas="SELECTION_TYPE_DRAWABLE">GDK_SELECTION_TYPE_DRAWABLE</primary></indexterm><programlisting>#define GDK_SELECTION_TYPE_DRAWABLE 	_GDK_MAKE_ATOM (17)
</programlisting>
<para>
A <link linkend="GdkAtom"><type>GdkAtom</type></link> representing the <literal>DRAWABLE</literal> selection type.
</para></refsect2>
<refsect2 id="GDK-SELECTION-TYPE-INTEGER--CAPS" role="macro">
<title>GDK_SELECTION_TYPE_INTEGER</title>
<indexterm zone="GDK-SELECTION-TYPE-INTEGER--CAPS"><primary sortas="SELECTION_TYPE_INTEGER">GDK_SELECTION_TYPE_INTEGER</primary></indexterm><programlisting>#define GDK_SELECTION_TYPE_INTEGER 	_GDK_MAKE_ATOM (19)
</programlisting>
<para>
A <link linkend="GdkAtom"><type>GdkAtom</type></link> representing the <literal>INTEGER</literal> selection type.
</para></refsect2>
<refsect2 id="GDK-SELECTION-TYPE-PIXMAP--CAPS" role="macro">
<title>GDK_SELECTION_TYPE_PIXMAP</title>
<indexterm zone="GDK-SELECTION-TYPE-PIXMAP--CAPS"><primary sortas="SELECTION_TYPE_PIXMAP">GDK_SELECTION_TYPE_PIXMAP</primary></indexterm><programlisting>#define GDK_SELECTION_TYPE_PIXMAP 	_GDK_MAKE_ATOM (20)
</programlisting>
<para>
A <link linkend="GdkAtom"><type>GdkAtom</type></link> representing the <literal>PIXMAP</literal> selection type.
</para></refsect2>
<refsect2 id="GDK-SELECTION-TYPE-WINDOW--CAPS" role="macro">
<title>GDK_SELECTION_TYPE_WINDOW</title>
<indexterm zone="GDK-SELECTION-TYPE-WINDOW--CAPS"><primary sortas="SELECTION_TYPE_WINDOW">GDK_SELECTION_TYPE_WINDOW</primary></indexterm><programlisting>#define GDK_SELECTION_TYPE_WINDOW 	_GDK_MAKE_ATOM (33)
</programlisting>
<para>
A <link linkend="GdkAtom"><type>GdkAtom</type></link> representing the <literal>WINDOW</literal> selection type.
</para></refsect2>
<refsect2 id="GDK-SELECTION-TYPE-STRING--CAPS" role="macro">
<title>GDK_SELECTION_TYPE_STRING</title>
<indexterm zone="GDK-SELECTION-TYPE-STRING--CAPS"><primary sortas="SELECTION_TYPE_STRING">GDK_SELECTION_TYPE_STRING</primary></indexterm><programlisting>#define GDK_SELECTION_TYPE_STRING 	_GDK_MAKE_ATOM (31)
</programlisting>
<para>
A <link linkend="GdkAtom"><type>GdkAtom</type></link> representing the <literal>STRING</literal> selection type.
</para></refsect2>
<refsect2 id="gdk-selection-owner-set" role="function">
<title>gdk_selection_owner_set ()</title>
<indexterm zone="gdk-selection-owner-set"><primary sortas="selection_owner_set">gdk_selection_owner_set</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gdk_selection_owner_set             (<link linkend="GdkWindow">GdkWindow</link> *owner,
                                                         <link linkend="GdkAtom">GdkAtom</link> selection,
                                                         <link linkend="guint32">guint32</link> time_,
                                                         <link linkend="gboolean">gboolean</link> send_event);</programlisting>
<para>
Sets the owner of the given selection.
</para><variablelist role="params">
<varlistentry><term><parameter>owner</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GdkWindow"><type>GdkWindow</type></link> or <link linkend="NULL--CAPS"><literal>NULL</literal></link> to indicate that the
        the owner for the given should be unset.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>selection</parameter>&#160;:</term>
<listitem><simpara>an atom identifying a selection.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>time_</parameter>&#160;:</term>
<listitem><simpara>timestamp to use when setting the selection.
       If this is older than the timestamp given last
       time the owner was set for the given selection, the
       request will be ignored.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>send_event</parameter>&#160;:</term>
<listitem><simpara>if <link linkend="TRUE--CAPS"><literal>TRUE</literal></link>, and the new owner is different
             from the current owner, the current owner
             will be sent a SelectionClear event.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>%TRUE if the selection owner was successfully
          changed to <parameter>owner</parameter>, otherwise <link linkend="FALSE--CAPS"><literal>FALSE</literal></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-selection-owner-set-for-display" role="function" condition="since:2.2">
<title>gdk_selection_owner_set_for_display ()</title>
<indexterm zone="gdk-selection-owner-set-for-display" role="2.2"><primary sortas="selection_owner_set_for_display">gdk_selection_owner_set_for_display</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gdk_selection_owner_set_for_display (<link linkend="GdkDisplay">GdkDisplay</link> *display,
                                                         <link linkend="GdkWindow">GdkWindow</link> *owner,
                                                         <link linkend="GdkAtom">GdkAtom</link> selection,
                                                         <link linkend="guint32">guint32</link> time_,
                                                         <link linkend="gboolean">gboolean</link> send_event);</programlisting>
<para>
Sets the <link linkend="GdkWindow"><type>GdkWindow</type></link> <parameter>owner</parameter> as the current owner of the selection <parameter>selection</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>display</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GdkDisplay"><type>GdkDisplay</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>owner</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkWindow"><type>GdkWindow</type></link> or <link linkend="NULL--CAPS"><literal>NULL</literal></link> to indicate that the owner for
        the given should be unset.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>selection</parameter>&#160;:</term>
<listitem><simpara> an atom identifying a selection.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>time_</parameter>&#160;:</term>
<listitem><simpara> timestamp to use when setting the selection. 
        If this is older than the timestamp given last time the owner was 
        set for the given selection, the request will be ignored.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>send_event</parameter>&#160;:</term>
<listitem><simpara> if <link linkend="TRUE--CAPS"><literal>TRUE</literal></link>, and the new owner is different from the current
             owner, the current owner will be sent a SelectionClear event.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the selection owner was successfully changed to owner,
    otherwise <link linkend="FALSE--CAPS"><literal>FALSE</literal></link>. 

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gdk-selection-owner-get" role="function">
<title>gdk_selection_owner_get ()</title>
<indexterm zone="gdk-selection-owner-get"><primary sortas="selection_owner_get">gdk_selection_owner_get</primary></indexterm><programlisting><link linkend="GdkWindow">GdkWindow</link>*          gdk_selection_owner_get             (<link linkend="GdkAtom">GdkAtom</link> selection);</programlisting>
<para>
Determines the owner of the given selection.
</para><variablelist role="params">
<varlistentry><term><parameter>selection</parameter>&#160;:</term>
<listitem><simpara>an atom indentifying a selection.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>if there is a selection owner for this window,
          and it is a window known to the current process,
          the <link linkend="GdkWindow"><type>GdkWindow</type></link> that owns the selection, otherwise
          <link linkend="NULL--CAPS"><literal>NULL</literal></link>. 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.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-selection-owner-get-for-display" role="function" condition="since:2.2">
<title>gdk_selection_owner_get_for_display ()</title>
<indexterm zone="gdk-selection-owner-get-for-display" role="2.2"><primary sortas="selection_owner_get_for_display">gdk_selection_owner_get_for_display</primary></indexterm><programlisting><link linkend="GdkWindow">GdkWindow</link> *         gdk_selection_owner_get_for_display (<link linkend="GdkDisplay">GdkDisplay</link> *display,
                                                         <link linkend="GdkAtom">GdkAtom</link> selection);</programlisting>
<para>
Determine the owner of the given selection.
</para>
<para>
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.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>display</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkDisplay"><type>GdkDisplay</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>selection</parameter>&#160;:</term>
<listitem><simpara> an atom indentifying a selection.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> if there is a selection owner for this window, and it is a 
   window known to the current process, the <link linkend="GdkWindow"><type>GdkWindow</type></link> that owns the 
   selection, otherwise <link linkend="NULL--CAPS"><literal>NULL</literal></link>.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gdk-selection-convert" role="function">
<title>gdk_selection_convert ()</title>
<indexterm zone="gdk-selection-convert"><primary sortas="selection_convert">gdk_selection_convert</primary></indexterm><programlisting><link linkend="void">void</link>                gdk_selection_convert               (<link linkend="GdkWindow">GdkWindow</link> *requestor,
                                                         <link linkend="GdkAtom">GdkAtom</link> selection,
                                                         <link linkend="GdkAtom">GdkAtom</link> target,
                                                         <link linkend="guint32">guint32</link> time_);</programlisting>
<para>
Retrieves the contents of a selection in a given
form.
</para><variablelist role="params">
<varlistentry><term><parameter>requestor</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GdkWindow"><type>GdkWindow</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>selection</parameter>&#160;:</term>
<listitem><simpara>an atom identifying the selection to get the
            contents of.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>target</parameter>&#160;:</term>
<listitem><simpara>the form in which to retrieve the selection.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>time_</parameter>&#160;:</term>
<listitem><simpara>the timestamp to use when retrieving the
       selection. The selection owner may refuse the
       request if it did not own the selection at
       the time indicated by the timestamp.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-selection-property-get" role="function">
<title>gdk_selection_property_get ()</title>
<indexterm zone="gdk-selection-property-get"><primary sortas="selection_property_get">gdk_selection_property_get</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gdk_selection_property_get          (<link linkend="GdkWindow">GdkWindow</link> *requestor,
                                                         <link linkend="guchar">guchar</link> **data,
                                                         <link linkend="GdkAtom">GdkAtom</link> *prop_type,
                                                         <link linkend="gint">gint</link> *prop_format);</programlisting>
<para>
Retrieves selection data that was stored by the selection
data in response to a call to <link linkend="gdk-selection-convert"><function>gdk_selection_convert()</function></link>. This function
will not be used by applications, who should use the <link linkend="GtkClipboard"><type>GtkClipboard</type></link>
API instead.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>requestor</parameter>&#160;:</term>
<listitem><simpara> the window on which the data is stored
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara> location to store a pointer to the retrieved data.
       If the retrieval failed, <link linkend="NULL--CAPS"><literal>NULL</literal></link> we be stored here, otherwise, it
       will be non-<link linkend="NULL--CAPS"><literal>NULL</literal></link> and the returned data should be freed with <link linkend="g-free"><function>g_free()</function></link>
       when you are finished using it. The length of the
       allocated memory is one more than the length
       of the returned data, and the final byte will always
       be zero, to ensure nul-termination of strings.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>prop_type</parameter>&#160;:</term>
<listitem><simpara> location to store the type of the property.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>prop_format</parameter>&#160;:</term>
<listitem><simpara> location to store the format of the property.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the length of the retrieved data.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-selection-send-notify" role="function">
<title>gdk_selection_send_notify ()</title>
<indexterm zone="gdk-selection-send-notify"><primary sortas="selection_send_notify">gdk_selection_send_notify</primary></indexterm><programlisting><link linkend="void">void</link>                gdk_selection_send_notify           (<link linkend="GdkNativeWindow">GdkNativeWindow</link> requestor,
                                                         <link linkend="GdkAtom">GdkAtom</link> selection,
                                                         <link linkend="GdkAtom">GdkAtom</link> target,
                                                         <link linkend="GdkAtom">GdkAtom</link> property,
                                                         <link linkend="guint32">guint32</link> time_);</programlisting>
<para>
Sends a response to SelectionRequest event.
</para><variablelist role="params">
<varlistentry><term><parameter>requestor</parameter>&#160;:</term>
<listitem><simpara>window to which to deliver response.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>selection</parameter>&#160;:</term>
<listitem><simpara>selection that was requested.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>target</parameter>&#160;:</term>
<listitem><simpara>target that was selected.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>property</parameter>&#160;:</term>
<listitem><simpara>property in which the selection owner stored the
           data, or <link linkend="GDK-NONE--CAPS"><literal>GDK_NONE</literal></link> to indicate that the request
           was rejected.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>time_</parameter>&#160;:</term>
<listitem><simpara>timestamp.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-selection-send-notify-for-display" role="function" condition="since:2.2">
<title>gdk_selection_send_notify_for_display ()</title>
<indexterm zone="gdk-selection-send-notify-for-display" role="2.2"><primary sortas="selection_send_notify_for_display">gdk_selection_send_notify_for_display</primary></indexterm><programlisting><link linkend="void">void</link>                gdk_selection_send_notify_for_display
                                                        (<link linkend="GdkDisplay">GdkDisplay</link> *display,
                                                         <link linkend="GdkNativeWindow">GdkNativeWindow</link> requestor,
                                                         <link linkend="GdkAtom">GdkAtom</link> selection,
                                                         <link linkend="GdkAtom">GdkAtom</link> target,
                                                         <link linkend="GdkAtom">GdkAtom</link> property,
                                                         <link linkend="guint32">guint32</link> time_);</programlisting>
<para>
Send a response to SelectionRequest event.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>display</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GdkDisplay"><type>GdkDisplay</type></link> where <parameter>requestor</parameter> is realized
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>requestor</parameter>&#160;:</term>
<listitem><simpara> window to which to deliver response.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>selection</parameter>&#160;:</term>
<listitem><simpara> selection that was requested.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>target</parameter>&#160;:</term>
<listitem><simpara> target that was selected.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>property</parameter>&#160;:</term>
<listitem><simpara> property in which the selection owner stored the data,
           or <link linkend="GDK-NONE--CAPS"><literal>GDK_NONE</literal></link> to indicate that the request was rejected.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>time_</parameter>&#160;:</term>
<listitem><simpara> timestamp. 
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>

</refsect1>




</refentry>
