<Type Name="Socket" FullName="Gtk.Socket">
  <TypeSignature Language="C#" Value="public class Socket : Gtk.Container, Implementor, IWrapper, IWrapper, IDisposable" Maintainer="John Luke" />
  <AssemblyInfo>
    <AssemblyName>gtk-sharp</AssemblyName>
    <AssemblyPublicKey>
    </AssemblyPublicKey>
    <AssemblyVersion>0.0.0.0</AssemblyVersion>
    <AssemblyCulture>neutral</AssemblyCulture>
    <Attributes />
  </AssemblyInfo>
  <ThreadSafetyStatement>Gtk# is thread aware, but not thread safe; See the <link location="node:gtk-sharp/programming/threads">Gtk# Thread Programming</link> for details.</ThreadSafetyStatement>
  <Docs>
    <summary>Container for widgets from other processes.</summary>
    <remarks>
      <para>Together with <see cref="T:Gtk.Plug" />, <see cref="T:Gtk.Socket" /> 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 <see cref="T:Gtk.Socket" /> widget and, passes the window ID of that widget to the other process, which then creates a <see cref="T:Gtk.Plug" /> with that window ID. Any widgets contained in the <see cref="T:Gtk.Plug" /> then will appear inside the first applications window.</para>
      <para>The window ID of the <see cref="T:Gtk.Socket" /> is obtained by using <see cref="M:Gtk.Socket.GetId()" />. Before using this function, the socket must have been realized, and therefore, have been added to its parent.</para>
      <example>
        <code language="C#">
Gtk.Socket socket = new Gtk.Socket;
socket.Show ();
parent.Add (socket);
Console.WriteLine ("The ID of the sockets window is {0}", socket.Id);
        </code>
      </example>
      <para>Note that if you pass the window ID of the socket to another process that will create a plug in the socket, you must make sure that the socket widget is not destroyed until that plug is created. Violating this rule will cause unpredictable consequences, the most likely consequence being that the plug will appear as a separate toplevel window. You can check if the plug has been created by examining the plug_window field of the <see cref="T:Gtk.Socket" /> structure. If this field is non-<see langword="null" />, then the plug has been successfully created inside of the socket.</para>
      <para>When Gtk# is notified that the embedded window has been destroyed, then it will destroy the socket as well. You should always, therefore, be prepared for your sockets to be destroyed at any time when the main event loop is running.</para>
      <para>The communication between a <see cref="T:Gtk.Socket" /> and a <see cref="T:Gtk.Plug" /> follows the XEmbed protocol. This protocol has also been implemented in other toolkits, e.g. Qt, allowing the same level of integration when embedding a Qt widget in GTK or vice versa.</para>
      <para>A socket can also be used to swallow arbitrary pre-existing top-level windows using <see cref="M:Gtk.Socket.Steal()" />, though the integration when this is done will not be as close as between a <see cref="T:Gtk.Plug" /> and a <see cref="T:Gtk.Socket" />.</para>
    </remarks>
  </Docs>
  <Base>
    <BaseTypeName>Gtk.Container</BaseTypeName>
  </Base>
  <Interfaces>
    <Interface>
      <InterfaceName>Atk.Implementor</InterfaceName>
    </Interface>
    <Interface>
      <InterfaceName>GLib.IWrapper</InterfaceName>
    </Interface>
    <Interface>
      <InterfaceName>GLib.IWrapper</InterfaceName>
    </Interface>
    <Interface>
      <InterfaceName>System.IDisposable</InterfaceName>
    </Interface>
  </Interfaces>
  <Attributes />
  <Members>
    <Member MemberName="AddId">
      <MemberSignature Language="C#" Value="public void AddId (uint window_id);" />
      <MemberType>Method</MemberType>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="window_id" Type="System.UInt32" />
      </Parameters>
      <Docs>
        <summary>Adds an XEMBED client, such as a <see cref="T:Gtk.Plug" />, to the <see cref="T:Gtk.Socket" />.</summary>
        <param name="window_id">an object of type <see cref="T:System.UInt32" /></param>
        <remarks>
          <para>The client may be in the same process or in a different process.</para>
          <para>To embed a <see cref="T:Gtk.Plug" /> in a <see cref="T:Gtk.Socket" />, you can either create the <see cref="T:Gtk.Plug" /> with <see cref="C:Gtk.Plug()" />, call <see cref="M:Gtk.Plug.GetId()" /> to get the window ID of the plug, and then pass that to the <see cref="M:Gtk.Socket.AddId()" />, or you can call <see cref="M:Gtk.Socket.GetId()" /> to get the window ID for the socket, and call <see cref="C:Gtk.Plug()" /> passing in that ID.</para>
          <para>The <see cref="T:Gtk.Socket" /> must have already be added into a toplevel window before you can make this call.</para>
        </remarks>
      </Docs>
    </Member>
    <Member MemberName="Finalize">
      <MemberSignature Language="C#" Value="protected override void Finalize ();" />
      <MemberType>Method</MemberType>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters />
      <Docs>
        <summary>Disposes the resources associated with the object.</summary>
        <remarks />
      </Docs>
    </Member>
    <Member MemberName=".ctor">
      <MemberSignature Language="C#" Value="public Socket (IntPtr raw);" />
      <MemberType>Constructor</MemberType>
      <ReturnValue />
      <Parameters>
        <Parameter Name="raw" Type="System.IntPtr" />
      </Parameters>
      <Docs>
        <summary>Internal constructor</summary>
        <param name="raw">Pointer to the C object.</param>
        <returns>An instance of Socket, wrapping the C object.</returns>
        <remarks>
          <para>This is an internal constructor, and should not be used by user code.</para>
        </remarks>
      </Docs>
    </Member>
    <Member MemberName=".ctor">
      <MemberSignature Language="C#" Value="public Socket ();" />
      <MemberType>Constructor</MemberType>
      <ReturnValue />
      <Parameters />
      <Docs>
        <summary>Default constructor</summary>
        <returns>an object of type <see cref="T:Gtk.Socket" /></returns>
        <remarks>
        </remarks>
      </Docs>
    </Member>
    <Member MemberName="Id">
      <MemberSignature Language="C#" Value="public uint Id { get; };" />
      <MemberType>Property</MemberType>
      <ReturnValue>
        <ReturnType>System.UInt32</ReturnType>
      </ReturnValue>
      <Docs>
        <summary>The window ID of a <see cref="T:Gtk.Socket" /> widget.</summary>
        <returns>an object of type <see cref="T:System.UInt32" /></returns>
        <remarks>This can be used to create a client embedded inside the socket, for instance with <see cref="C:Gtk.Plug()" />. The <see cref="T:Gtk.Socket" /> must have already be added into a toplevel window before you can make this call.</remarks>
      </Docs>
    </Member>
    <Member MemberName="PlugAdded">
      <MemberSignature Language="C#" Value="public event EventHandler PlugAdded;" />
      <MemberType>Event</MemberType>
      <ReturnValue>
        <ReturnType>System.EventHandler</ReturnType>
      </ReturnValue>
      <Parameters />
      <Docs>
        <summary>This event is emitted when a client is successfully added to the socket.</summary>
        <remarks>
        </remarks>
      </Docs>
    </Member>
    <Member MemberName="PlugRemoved">
      <MemberSignature Language="C#" Value="public event Gtk.PlugRemovedHandler PlugRemoved;" />
      <MemberType>Event</MemberType>
      <ReturnValue>
        <ReturnType>Gtk.PlugRemovedHandler</ReturnType>
      </ReturnValue>
      <Parameters />
      <Docs>
        <summary>This event is emitted when a client is removed from the socket.</summary>
        <remarks>The default action is to destroy the <see cref="T:Gtk.Socket" /> widget, so if you want to reuse it you must add a signal handler that returns <see langword="true" />.</remarks>
      </Docs>
    </Member>
    <Member MemberName="GType">
      <MemberSignature Language="C#" Value="public static GLib.GType GType { get; };" />
      <MemberType>Property</MemberType>
      <ReturnValue>
        <ReturnType>GLib.GType</ReturnType>
      </ReturnValue>
      <Parameters />
      <Docs>
        <summary>GType Property.</summary>
        <returns>a <see cref="T:GLib.GType" /></returns>
        <remarks>Returns the native <see cref="T:GLib.GType" /> value for <see cref="T:Gtk.Socket" />.</remarks>
      </Docs>
    </Member>
    <Member MemberName="OnPlugRemoved">
      <MemberSignature Language="C#" Value="protected virtual bool OnPlugRemoved ();" />
      <MemberType>Method</MemberType>
      <ReturnValue>
        <ReturnType>System.Boolean</ReturnType>
      </ReturnValue>
      <Parameters />
      <Docs>
        <summary>Default handler for the <see cref="M:Gtk.Socket.PlugRemoved" /> event.</summary>
        <returns>a <see cref="T:System.Boolean" /></returns>
        <remarks>Override this method in a subclass to provide a default handler for the <see cref="M:Gtk.Socket.PlugRemoved" /> event.</remarks>
      </Docs>
    </Member>
    <Member MemberName="OnPlugAdded">
      <MemberSignature Language="C#" Value="protected virtual void OnPlugAdded ();" />
      <MemberType>Method</MemberType>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters />
      <Docs>
        <summary>Default handler for the <see cref="M:Gtk.Socket.PlugAdded" /> event.</summary>
        <remarks>Override this method in a subclass to provide a default handler for the <see cref="M:Gtk.Socket.PlugAdded" /> event.</remarks>
      </Docs>
    </Member>
    <Member MemberName=".ctor">
      <MemberSignature Language="C#" Value="protected Socket (GLib.GType gtype);" />
      <MemberType>Constructor</MemberType>
      <ReturnValue />
      <Parameters>
        <Parameter Name="gtype" Type="GLib.GType" />
      </Parameters>
      <Docs>
        <summary>Protected Constructor.</summary>
        <param name="gtype">a <see cref="T:GLib.GType" /></param>
        <returns>a <see cref="T:Gtk.Socket" /></returns>
        <remarks>Chain to this constructor if you have manually registered a native <see cref="T:GLib.GType" /> value for your subclass.</remarks>
      </Docs>
    </Member>
    <Member MemberName="Steal">
      <MemberSignature Language="C#" Value="public void Steal (uint wid);" />
      <MemberType>Method</MemberType>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="wid" Type="System.UInt32" />
      </Parameters>
      <Docs>
        <summary>
	  Reparents a pre-existing toplevel window into a <see cref="T:Gtk.Socket" />. 
	</summary>
        <param name="wid">a <see cref="T:System.UInt32" />, the window
          ID of an existing toplevel window.</param>
        <remarks>
	  This is meant to embed clients that do not know about
	  embedding into a <see cref="T:Gtk.Socket" />, however doing
	  so is inherently unreliable, and using this function is not
	  recommended.
 
	  The <see cref="T:Gtk.Socket" /> must have already been added
	  into a toplevel window before you can make this call.
	</remarks>
      </Docs>
    </Member>
  </Members>
</Type>
