|
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17 System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64 User : nobody ( 99) PHP Version : 5.2.17 Disable Function : NONE Directory : /usr/share/gtk-doc/html/libbonoboui/ |
Upload File : |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>BonoboSocket</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
<link rel="start" href="index.html" title="LibBonoboUI API Reference Manual">
<link rel="up" href="bonobo-support-utilities.html" title="Supporting Classes">
<link rel="prev" href="libbonoboui-bonobo-plug.html" title="BonoboPlug">
<link rel="next" href="libbonoboui-bonobo-wrapper.html" title="bonobo-wrapper">
<meta name="generator" content="GTK-Doc V1.7 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="chapter" href="ch01.html" title="Object Hierarchy">
<link rel="chapter" href="bonobo-controls.html" title="Controls">
<link rel="chapter" href="bonobo-ui.html" title="Bonobo UI">
<link rel="chapter" href="bonobo-support-utilities.html" title="Supporting Classes">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="libbonoboui-bonobo-plug.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="bonobo-support-utilities.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">LibBonoboUI API Reference Manual</th>
<td><a accesskey="n" href="libbonoboui-bonobo-wrapper.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id2828284" class="shortcut">Top</a>
 | 
<a href="#id2828417" class="shortcut">Description</a>
 | 
<a href="#id2828332" class="shortcut">Object Hierarchy</a>
 | 
<a href="#id2828394" class="shortcut">Implemented Interfaces</a></nobr></td></tr>
</table>
<div class="refentry" lang="en">
<a name="libbonoboui-bonobo-socket"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2>
<a name="id2828284"></a><span class="refentrytitle">BonoboSocket</span>
</h2>
<p>BonoboSocket — Container for widgets from other processes.</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<a name="BonoboSocket"></a><pre class="synopsis">
<a href="libbonoboui-bonobo-socket.html#BonoboSocket-struct">BonoboSocket</a>;
<a href="libbonoboui-bonobo-socket.html#BonoboSocketClass">BonoboSocketClass</a>;
<a
href="/usr/share/gtk-doc/html/gtk/GtkWidget.html"
>GtkWidget</a>* <a href="libbonoboui-bonobo-socket.html#bonobo-socket-new">bonobo_socket_new</a> (void);
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id2828332"></a><h2>Object Hierarchy</h2>
<pre class="synopsis">
<a
href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject"
>GObject</a>
+----<a
href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GInitiallyUnowned"
>GInitiallyUnowned</a>
+----<a
href="/usr/share/gtk-doc/html/gtk/GtkObject.html"
>GtkObject</a>
+----<a
href="/usr/share/gtk-doc/html/gtk/GtkWidget.html"
>GtkWidget</a>
+----<a
href="/usr/share/gtk-doc/html/gtk/GtkContainer.html"
>GtkContainer</a>
+----<a
href="/usr/share/gtk-doc/html/gtk/GtkSocket.html"
>GtkSocket</a>
+----BonoboSocket
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id2828394"></a><h2>Implemented Interfaces</h2>
<p>
BonoboSocket implements
AtkImplementorIface.</p>
</div>
<div class="refsect1" lang="en">
<a name="id2828417"></a><h2>Description</h2>
<p>
This is an internal support routine of the X code in Bonobo.
</p>
<p>
Together with <a href="libbonoboui-bonobo-plug.html#BonoboPlug"><span class="type">BonoboPlug</span></a>, <a href="libbonoboui-bonobo-socket.html#BonoboSocket"><span class="type">BonoboSocket</span></a> 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 <a href="libbonoboui-bonobo-socket.html#BonoboSocket"><span class="type">BonoboSocket</span></a> widget and, passes the
XID of that widget's window to the other process,
which then creates a <a href="libbonoboui-bonobo-plug.html#BonoboPlug"><span class="type">BonoboPlug</span></a> window with that XID.
Any widgets contained in the <a href="libbonoboui-bonobo-plug.html#BonoboPlug"><span class="type">BonoboPlug</span></a> then will appear
inside the first applications window.
</p>
<p>
The XID of the socket's window is obtained by using
the <code class="function">GTK_WINDOW_XWINDOW()</code> macro from the header
file <gdk/gdkx.h>. Before using this macro,
the socket must have been realized, and for hence,
have been added to its parent.
</p>
<div class="example">
<a name="id2828502"></a><p class="title"><b>Example 1.  Obtaining the XID of a socket </b></p>
<pre class="programlisting">
<span class="type">include</span> <gdk/gdkx.h>
GtkWidget *socket = <a href="libbonoboui-bonobo-socket.html#bonobo-socket-new"><code class="function">bonobo_socket_new()</code></a>;
gtk_widget_show (socket);
gtk_container_add (GTK_CONTAINER (parent), socket);
/* The following call is only necessary if one of
* the ancestors of the socket is not yet visible.
*/
gtk_widget_realize (socket);
g_print ("The XID of the sockets window is %<span class="type">x</span>\n",
GDK_WINDOW_XWINDOW (socket->window));
</pre>
</div>
<p>
</p>
<p>
Note that if you pass the XID 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
<em class="structfield"><code>plug_window</code></em> field of the
<a href="libbonoboui-bonobo-socket.html#BonoboSocket"><span class="type">BonoboSocket</span></a> structure. If this field is non-NULL,
then the plug has been succesfully created inside
of the socket.
</p>
<p>
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.
</p>
<p>
A socket can also be used to swallow arbitrary
pre-existing top-level windows using <a
href="/usr/share/gtk-doc/html/gtk/GtkSocket.html#gtk-socket-steal"
><code class="function">gtk_socket_steal()</code></a>,
though the integration when this is done will not be as close
as between a <a href="libbonoboui-bonobo-plug.html#BonoboPlug"><span class="type">BonoboPlug</span></a> and a <a href="libbonoboui-bonobo-socket.html#BonoboSocket"><span class="type">BonoboSocket</span></a>.
</p>
</div>
<div class="refsect1" lang="en">
<a name="id2828617"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="id2828627"></a><h3>
<a name="BonoboSocket-struct"></a>BonoboSocket</h3>
<a class="indexterm" name="id2828640"></a><pre class="programlisting">typedef struct _BonoboSocket BonoboSocket;</pre>
<p>
The <a
href="/usr/share/gtk-doc/html/gtk/GtkEditable.html"
><span class="type">GtkEditable</span></a> structure contains the following field.
(This field should be considered read-only. It should
never be set by an application.)
</p>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col>
<col>
</colgroup>
<tbody><tr>
<td>
<a
href="/usr/share/gtk-doc/html/gdk/gdk-Windows.html#GdkWindow"
><span class="type">GdkWindow</span></a> *plug_window;</td>
<td>the window embedded inside this <a
href="/usr/share/gtk-doc/html/gtk/GtkSocket.html"
><span class="type">GtkSocket</span></a>.</td>
</tr></tbody>
</table></div>
<p>
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2828723"></a><h3>
<a name="BonoboSocketClass"></a>BonoboSocketClass</h3>
<a class="indexterm" name="id2828736"></a><pre class="programlisting">typedef struct {
GtkSocketClass parent_class;
gpointer dummy[4];
} BonoboSocketClass;
</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2828753"></a><h3>
<a name="bonobo-socket-new"></a>bonobo_socket_new ()</h3>
<a class="indexterm" name="id2828766"></a><pre class="programlisting"><a
href="/usr/share/gtk-doc/html/gtk/GtkWidget.html"
>GtkWidget</a>* bonobo_socket_new (void);</pre>
<p>
Create a new empty <a href="libbonoboui-bonobo-socket.html#BonoboSocket"><span class="type">BonoboSocket</span></a>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> A new <a href="libbonoboui-bonobo-socket.html#BonoboSocket"><span class="type">BonoboSocket</span></a>.
</td>
</tr></tbody>
</table></div>
</div>
</div>
<div class="refsect1" lang="en">
<a name="id2828821"></a><h2>See Also</h2>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><a href="libbonoboui-bonobo-plug.html#BonoboPlug"><span class="type">BonoboPlug</span></a></span></td>
<td><p>the widget that plugs into a <a href="libbonoboui-bonobo-socket.html#BonoboSocket"><span class="type">BonoboSocket</span></a>.</p></td>
</tr></tbody>
</table></div>
<p>
</p>
</div>
</div>
</body>
</html>