<refentry id="GtkPlug">
<refmeta>
<refentrytitle>GtkPlug</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK Library</refmiscinfo>
</refmeta>

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

<refsynopsisdiv><title>Synopsis</title>
<synopsis>

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


struct      <link linkend="GtkPlug-struct">GtkPlug</link>;
void        <link linkend="gtk-plug-construct">gtk_plug_construct</link>              (<link linkend="GtkPlug">GtkPlug</link> *plug,
                                             <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="GdkNativeWindow">GdkNativeWindow</link> <link linkend="gtk-plug-get-id">gtk_plug_get_id</link>             (<link linkend="GtkPlug">GtkPlug</link> *plug);


</synopsis>
</refsynopsisdiv>

<refsect1>
<title>Object Hierarchy</title>
<synopsis>

  <link linkend="GObject">GObject</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>
<title>Signal Prototypes</title>
<synopsis>

&quot;<link linkend="GtkPlug-embedded">embedded</link>&quot;  void        user_function      (<link linkend="GtkPlug">GtkPlug</link> *plug,
                                            <link linkend="gpointer">gpointer</link> user_data);
</synopsis>
</refsect1>


<refsect1>
<title>Description</title>
<para>
Together with <link linkend="GtkSocket">GtkSocket</link>, <link linkend="GtkPlug">GtkPlug</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">GtkSocket</link> widget and, passes the
ID of that widgets window to the other process, 
which then creates a <link linkend="GtkPlug">GtkPlug</link> with that window ID.
Any widgets contained in the <link linkend="GtkPlug">GtkPlug</link> then will appear
inside the first applications window.
</para>
</refsect1>

<refsect1>
<title>Details</title>
<refsect2>
<title><anchor id="GtkPlug-struct">struct GtkPlug</title>
<programlisting>struct GtkPlug;</programlisting>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="gtk-plug-construct">gtk_plug_construct ()</title>
<programlisting>void        gtk_plug_construct              (<link linkend="GtkPlug">GtkPlug</link> *plug,
                                             <link linkend="GdkNativeWindow">GdkNativeWindow</link> socket_id);</programlisting>
<para>
Finishes the creation of a <link linkend="GtkPlug">GtkPlug</link> widget. This function
will generally only be used by classes deriving
from <link linkend="GtkPlug">GtkPlug</link>.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>plug</parameter>&nbsp;:</entry>
<entry>a <link linkend="GtkPlug">GtkPlug</link> widget.
</entry></row>
<row><entry align="right"><parameter>socket_id</parameter>&nbsp;:</entry>
<entry>the window ID of the socket.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-plug-new">gtk_plug_new ()</title>
<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">GtkSocket</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">GtkSocket</link> by  <link linkend="gtk-socket-add-id">gtk_socket_add_id</link>().
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>socket_id</parameter>&nbsp;:</entry>
<entry>the window ID of the socket, or 0.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>the new <link linkend="GtkPlug">GtkPlug</link> widget.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-plug-get-id">gtk_plug_get_id ()</title>
<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">GtkPlug</link> widget, which can then
be used to embed this window inside another window, for
instance with <link linkend="gtk-socket-add-id">gtk_socket_add_id</link>().</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>plug</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkPlug">GtkPlug</link>.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> the window ID for the plug
</entry></row>
</tbody></tgroup></informaltable></refsect2>

</refsect1>

<refsect1>
<title>Signals</title>
<refsect2><title><anchor id="GtkPlug-embedded">The &quot;embedded&quot; signal</title>
<programlisting>void        user_function                  (<link linkend="GtkPlug">GtkPlug</link> *plug,
                                            <link linkend="gpointer">gpointer</link> user_data);</programlisting>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>plug</parameter>&nbsp;:</entry>
<entry>the object which received the signal.

</entry></row>
<row><entry align="right"><parameter>user_data</parameter>&nbsp;:</entry>
<entry>user data set when the signal handler was connected.</entry></row>
</tbody></tgroup></informaltable></refsect2>
</refsect1>


<refsect1>
<title>See Also</title>
<para>
<variablelist>

<varlistentry>
<term><link linkend="GtkSocket">GtkSocket</link></term>
<listitem><para>the widget that a <link linkend="GtkPlug">GtkPlug</link> plugs into.</para></listitem>
</varlistentry>

</variablelist>
</para>
</refsect1>

</refentry>
