<?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">
]>
<!--ENTITY index-Objects-Grouped SYSTEM "objects_grouped.sgml"-->
<refentry id="GtkPlug">
<refmeta>
<refentrytitle role="top_of_page" id="GtkPlug.top_of_page">GtkPlug</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>GtkPlug</refname>
<refpurpose>Toplevel for embedding into other processes</refpurpose>
</refnamediv>

<refsynopsisdiv id="GtkPlug.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>

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

                    <link linkend="GtkPlug-struct">GtkPlug</link>;
<link linkend="void">void</link>                <link linkend="gtk-plug-construct">gtk_plug_construct</link>                  (<link linkend="GtkPlug">GtkPlug</link> *plug,
                                                         <link linkend="GdkNativeWindow">GdkNativeWindow</link> socket_id);
<link linkend="void">void</link>                <link linkend="gtk-plug-construct-for-display">gtk_plug_construct_for_display</link>      (<link linkend="GtkPlug">GtkPlug</link> *plug,
                                                         <link linkend="GdkDisplay">GdkDisplay</link> *display,
                                                         <link linkend="GdkNativeWindow">GdkNativeWindow</link> socket_id);
<link linkend="GtkWidget">GtkWidget</link>*          <link linkend="gtk-plug-new">gtk_plug_new</link>                        (<link linkend="GdkNativeWindow">GdkNativeWindow</link> socket_id);
<link linkend="GtkWidget">GtkWidget</link>*          <link linkend="gtk-plug-new-for-display">gtk_plug_new_for_display</link>            (<link linkend="GdkDisplay">GdkDisplay</link> *display,
                                                         <link linkend="GdkNativeWindow">GdkNativeWindow</link> socket_id);
<link linkend="GdkNativeWindow">GdkNativeWindow</link>     <link linkend="gtk-plug-get-id">gtk_plug_get_id</link>                     (<link linkend="GtkPlug">GtkPlug</link> *plug);
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-plug-get-embedded">gtk_plug_get_embedded</link>               (<link linkend="GtkPlug">GtkPlug</link> *plug);
<link linkend="GdkWindow">GdkWindow</link> *         <link linkend="gtk-plug-get-socket-window">gtk_plug_get_socket_window</link>          (<link linkend="GtkPlug">GtkPlug</link> *plug);
</synopsis>
</refsynopsisdiv>

<refsect1 id="GtkPlug.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<synopsis>
  <link linkend="GObject">GObject</link>
   +----<link linkend="GInitiallyUnowned">GInitiallyUnowned</link>
         +----<link linkend="GtkObject">GtkObject</link>
               +----<link linkend="GtkWidget">GtkWidget</link>
                     +----<link linkend="GtkContainer">GtkContainer</link>
                           +----<link linkend="GtkBin">GtkBin</link>
                                 +----<link linkend="GtkWindow">GtkWindow</link>
                                       +----GtkPlug
</synopsis>
</refsect1>



<refsect1 id="GtkPlug.implemented-interfaces" role="impl_interfaces">
<title role="impl_interfaces.title">Implemented Interfaces</title>
<para>
GtkPlug implements
 <link linkend="AtkImplementorIface">AtkImplementorIface</link> and  <link linkend="GtkBuildable">GtkBuildable</link>.</para>
</refsect1>


<refsect1 id="GtkPlug.properties" role="properties">
<title role="properties.title">Properties</title>
<synopsis>
  &quot;<link linkend="GtkPlug--embedded">embedded</link>&quot;                 <link linkend="gboolean">gboolean</link>              : Read
  &quot;<link linkend="GtkPlug--socket-window">socket-window</link>&quot;            <link linkend="GdkWindow">GdkWindow</link>*            : Read
</synopsis>
</refsect1>

<refsect1 id="GtkPlug.signals" role="signal_proto">
<title role="signal_proto.title">Signals</title>
<synopsis>
  &quot;<link linkend="GtkPlug-embedded">embedded</link>&quot;                                       : Run Last
</synopsis>
</refsect1>


<refsect1 id="GtkPlug.description" role="desc">
<title role="desc.title">Description</title>
<para>
Together with <link linkend="GtkSocket"><type>GtkSocket</type></link>, <link linkend="GtkPlug"><type>GtkPlug</type></link> provides the ability
to embed widgets from one process into another process
in a fashion that is transparent to the user. One
process creates a <link linkend="GtkSocket"><type>GtkSocket</type></link> widget and, passes the
ID of that widgets window to the other process,
which then creates a <link linkend="GtkPlug"><type>GtkPlug</type></link> with that window ID.
Any widgets contained in the <link linkend="GtkPlug"><type>GtkPlug</type></link> then will appear
inside the first applications window.
</para>
<note>
<para>
The <link linkend="GtkPlug"><type>GtkPlug</type></link> and <link linkend="GtkSocket"><type>GtkSocket</type></link> widgets are currently not available
on all platforms supported by GTK+.
</para>
</note>
</refsect1>

<refsect1 id="GtkPlug.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="GtkPlug-struct" role="struct">
<title>GtkPlug</title>
<indexterm zone="GtkPlug-struct"><primary sortas="Plug">GtkPlug</primary></indexterm><programlisting>typedef struct _GtkPlug GtkPlug;</programlisting>
<para>
</para></refsect2>
<refsect2 id="gtk-plug-construct" role="function">
<title>gtk_plug_construct ()</title>
<indexterm zone="gtk-plug-construct"><primary sortas="plug_construct">gtk_plug_construct</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_plug_construct                  (<link linkend="GtkPlug">GtkPlug</link> *plug,
                                                         <link linkend="GdkNativeWindow">GdkNativeWindow</link> socket_id);</programlisting>
<para>
Finish the initialization of <parameter>plug</parameter> for a given <link linkend="GtkSocket"><type>GtkSocket</type></link> identified by
<parameter>socket_id</parameter>. This function will generally only be used by classes deriving from <link linkend="GtkPlug"><type>GtkPlug</type></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>plug</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkPlug"><type>GtkPlug</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>socket_id</parameter>&#160;:</term>
<listitem><simpara> the XID of the socket's window.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-plug-construct-for-display" role="function" condition="since:2.2">
<title>gtk_plug_construct_for_display ()</title>
<indexterm zone="gtk-plug-construct-for-display" role="2.2"><primary sortas="plug_construct_for_display">gtk_plug_construct_for_display</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_plug_construct_for_display      (<link linkend="GtkPlug">GtkPlug</link> *plug,
                                                         <link linkend="GdkDisplay">GdkDisplay</link> *display,
                                                         <link linkend="GdkNativeWindow">GdkNativeWindow</link> socket_id);</programlisting>
<para>
Finish the initialization of <parameter>plug</parameter> for a given <link linkend="GtkSocket"><type>GtkSocket</type></link> identified by
<parameter>socket_id</parameter> which is currently displayed on <parameter>display</parameter>.
This function will generally only be used by classes deriving from <link linkend="GtkPlug"><type>GtkPlug</type></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>plug</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkPlug"><type>GtkPlug</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>display</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GdkDisplay"><type>GdkDisplay</type></link> associated with <parameter>socket_id</parameter>'s 
     <link linkend="GtkSocket"><type>GtkSocket</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>socket_id</parameter>&#160;:</term>
<listitem><simpara> the XID of the socket's window.
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gtk-plug-new" role="function">
<title>gtk_plug_new ()</title>
<indexterm zone="gtk-plug-new"><primary sortas="plug_new">gtk_plug_new</primary></indexterm><programlisting><link linkend="GtkWidget">GtkWidget</link>*          gtk_plug_new                        (<link linkend="GdkNativeWindow">GdkNativeWindow</link> socket_id);</programlisting>
<para>
Creates a new plug widget inside the <link linkend="GtkSocket"><type>GtkSocket</type></link> identified
by <parameter>socket_id</parameter>. If <parameter>socket_id</parameter> is 0, the plug is left "unplugged" and
can later be plugged into a <link linkend="GtkSocket"><type>GtkSocket</type></link> by  <link linkend="gtk-socket-add-id"><function>gtk_socket_add_id()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>socket_id</parameter>&#160;:</term>
<listitem><simpara>  the window ID of the socket, or 0.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the new <link linkend="GtkPlug"><type>GtkPlug</type></link> widget.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-plug-new-for-display" role="function" condition="since:2.2">
<title>gtk_plug_new_for_display ()</title>
<indexterm zone="gtk-plug-new-for-display" role="2.2"><primary sortas="plug_new_for_display">gtk_plug_new_for_display</primary></indexterm><programlisting><link linkend="GtkWidget">GtkWidget</link>*          gtk_plug_new_for_display            (<link linkend="GdkDisplay">GdkDisplay</link> *display,
                                                         <link linkend="GdkNativeWindow">GdkNativeWindow</link> socket_id);</programlisting>
<para>
Create a new plug widget inside the <link linkend="GtkSocket"><type>GtkSocket</type></link> identified by socket_id.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>display</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GdkDisplay"><type>GdkDisplay</type></link> on which <parameter>socket_id</parameter> is displayed
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>socket_id</parameter>&#160;:</term>
<listitem><simpara> the XID of the socket's window.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the new <link linkend="GtkPlug"><type>GtkPlug</type></link> widget.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gtk-plug-get-id" role="function">
<title>gtk_plug_get_id ()</title>
<indexterm zone="gtk-plug-get-id"><primary sortas="plug_get_id">gtk_plug_get_id</primary></indexterm><programlisting><link linkend="GdkNativeWindow">GdkNativeWindow</link>     gtk_plug_get_id                     (<link linkend="GtkPlug">GtkPlug</link> *plug);</programlisting>
<para>
Gets the window ID of a <link linkend="GtkPlug"><type>GtkPlug</type></link> widget, which can then
be used to embed this window inside another window, for
instance with <link linkend="gtk-socket-add-id"><function>gtk_socket_add_id()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>plug</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkPlug"><type>GtkPlug</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the window ID for the plug
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-plug-get-embedded" role="function" condition="since:2.14">
<title>gtk_plug_get_embedded ()</title>
<indexterm zone="gtk-plug-get-embedded" role="2.14"><primary sortas="plug_get_embedded">gtk_plug_get_embedded</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_plug_get_embedded               (<link linkend="GtkPlug">GtkPlug</link> *plug);</programlisting>
<para>
Determines whether the plug is embedded in a socket.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>plug</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkPlug"><type>GtkPlug</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the plug is embedded in a socket

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.14</para></refsect2>
<refsect2 id="gtk-plug-get-socket-window" role="function" condition="since:2.14">
<title>gtk_plug_get_socket_window ()</title>
<indexterm zone="gtk-plug-get-socket-window" role="2.14"><primary sortas="plug_get_socket_window">gtk_plug_get_socket_window</primary></indexterm><programlisting><link linkend="GdkWindow">GdkWindow</link> *         gtk_plug_get_socket_window          (<link linkend="GtkPlug">GtkPlug</link> *plug);</programlisting>
<para>
Retrieves the socket the plug is embedded in.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>plug</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkPlug"><type>GtkPlug</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the window of the socket, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.14</para></refsect2>

</refsect1>
<refsect1 id="GtkPlug.property-details" role="property_details">
<title role="property_details.title">Property Details</title>
<refsect2 id="GtkPlug--embedded" role="property"><title>The <literal>&quot;embedded&quot;</literal> property</title>
<indexterm zone="GtkPlug--embedded" role="2.12"><primary sortas="Plug:embedded">GtkPlug:embedded</primary></indexterm><programlisting>  &quot;embedded&quot;                 <link linkend="gboolean">gboolean</link>              : Read</programlisting>
<para>
<link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the plug is embedded in a socket.</para>
<para>
</para><para>Default value: FALSE</para>
<para>Since 2.12</para>
</refsect2>
<refsect2 id="GtkPlug--socket-window" role="property"><title>The <literal>&quot;socket-window&quot;</literal> property</title>
<indexterm zone="GtkPlug--socket-window" role="2.14"><primary sortas="Plug:socket-window">GtkPlug:socket-window</primary></indexterm><programlisting>  &quot;socket-window&quot;            <link linkend="GdkWindow">GdkWindow</link>*            : Read</programlisting>
<para>
The window of the socket the plug is embedded in.</para>
<para>
</para><para>Since 2.14</para>
</refsect2>
</refsect1>

<refsect1 id="GtkPlug.signal-details" role="signals">
<title role="signals.title">Signal Details</title>
<refsect2 id="GtkPlug-embedded" role="signal"><title>The <literal>&quot;embedded&quot;</literal> signal</title>
<indexterm zone="GtkPlug-embedded"><primary sortas="Plug::embedded">GtkPlug::embedded</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GtkPlug">GtkPlug</link> *plug,
                                                        <link linkend="gpointer">gpointer</link> user_data)      : Run Last</programlisting>
<para>
Gets emitted when the plug becomes embedded in a socket
and when the embedding ends.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>plug</parameter>&#160;:</term>
<listitem><simpara> the object on which the signal was emitted
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2>
</refsect1>


<refsect1 id="GtkPlug.see-also">
<title>See Also</title>
<para>
<variablelist>
<varlistentry>
<term><link linkend="GtkSocket"><type>GtkSocket</type></link></term>
<listitem><para>the widget that a <link linkend="GtkPlug"><type>GtkPlug</type></link> plugs into.</para></listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>

</refentry>
