~ubuntu-branches/ubuntu/precise/libbonoboui/precise

« back to all changes in this revision

Viewing changes to doc/api/xml/bonobo-socket.xml

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2010-03-30 13:42:51 UTC
  • mfrom: (1.1.24 upstream)
  • Revision ID: james.westby@ubuntu.com-20100330134251-9zf96pnsqm4qxb3t
Tags: 2.24.3-0ubuntu1
* New upstream version:
  - Skip unknown accelerators 
  - Don't pass NULL to G_OBJECT_GET_CLASS
  - Updated translations 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<refentry id="libbonoboui-bonobo-socket">
2
 
<refmeta>
3
 
<refentrytitle role="top_of_page" id="libbonoboui-bonobo-socket.top_of_page">BonoboSocket</refentrytitle>
4
 
<manvolnum>3</manvolnum>
5
 
<refmiscinfo>LIBBONOBOUI Library</refmiscinfo>
6
 
</refmeta>
7
 
 
8
 
<refnamediv>
9
 
<refname>BonoboSocket</refname>
10
 
<refpurpose>Container for widgets from other processes.</refpurpose>
11
 
</refnamediv>
12
 
 
13
 
<refsynopsisdiv id="libbonoboui-bonobo-socket.synopsis" role="synopsis">
14
 
<title role="synopsis.title">Synopsis</title>
15
 
<anchor id="BonoboSocket"/>
16
 
<synopsis>
17
 
                    <link linkend="BonoboSocket-struct">BonoboSocket</link>;
18
 
                    <link linkend="BonoboSocketClass">BonoboSocketClass</link>;
19
 
<link linkend="GtkWidget">GtkWidget</link>*          <link linkend="bonobo-socket-new">bonobo_socket_new</link>                   (void);
20
 
</synopsis>
21
 
</refsynopsisdiv>
22
 
 
23
 
<refsect1 id="libbonoboui-bonobo-socket.object-hierarchy" role="object_hierarchy">
24
 
<title role="object_hierarchy.title">Object Hierarchy</title>
25
 
<synopsis>
26
 
  <link linkend="GObject">GObject</link>
27
 
   +----<link linkend="GInitiallyUnowned">GInitiallyUnowned</link>
28
 
         +----<link linkend="GtkObject">GtkObject</link>
29
 
               +----<link linkend="GtkWidget">GtkWidget</link>
30
 
                     +----<link linkend="GtkContainer">GtkContainer</link>
31
 
                           +----<link linkend="GtkSocket">GtkSocket</link>
32
 
                                 +----BonoboSocket
33
 
</synopsis>
34
 
</refsect1>
35
 
 
36
 
 
37
 
 
38
 
<refsect1 id="libbonoboui-bonobo-socket.implemented-interfaces" role="impl_interfaces">
39
 
<title role="impl_interfaces.title">Implemented Interfaces</title>
40
 
<para>
41
 
BonoboSocket implements
42
 
 <link linkend="AtkImplementorIface">AtkImplementorIface</link> and  <link linkend="GtkBuildable">GtkBuildable</link>.</para>
43
 
</refsect1>
44
 
 
45
 
 
46
 
 
47
 
 
48
 
 
49
 
<refsect1 id="libbonoboui-bonobo-socket.description" role="desc">
50
 
<title role="desc.title">Description</title>
51
 
<para>
52
 
   This is an internal support routine of the X code in Bonobo.
53
 
</para>
54
 
<para>
55
 
Together with <link linkend="BonoboPlug"><type>BonoboPlug</type></link>, <link linkend="BonoboSocket"><type>BonoboSocket</type></link> provides the ability
56
 
to embed widgets from one process into another process
57
 
in a fashion that is transparent to the user. One
58
 
process creates a <link linkend="BonoboSocket"><type>BonoboSocket</type></link> widget and, passes the
59
 
XID of that widget's window to the other process,
60
 
which then creates a <link linkend="BonoboPlug"><type>BonoboPlug</type></link> window with that XID.
61
 
Any widgets contained in the <link linkend="BonoboPlug"><type>BonoboPlug</type></link> then will appear
62
 
inside the first applications window.
63
 
</para>
64
 
<para>
65
 
The XID of the socket's window is obtained by using
66
 
the <link linkend="GTK-WINDOW-XWINDOW--CAPS"><function>GTK_WINDOW_XWINDOW()</function></link> macro from the header
67
 
file &lt;gdk/gdkx.h&gt;. Before using this macro,
68
 
the socket must have been realized, and for hence,
69
 
have been added to its parent.
70
 
<example>
71
 
<title> Obtaining the XID of a socket </title>
72
 
<programlisting>
73
 
#include &lt;gdk/gdkx.h&gt;
74
 
GtkWidget *socket = bonobo_socket_new();
75
 
gtk_widget_show (socket);
76
 
gtk_container_add (GTK_CONTAINER (parent), socket);
77
 
/* The following call is only necessary if one of
78
 
 * the ancestors of the socket is not yet visible.
79
 
 */
80
 
gtk_widget_realize (socket);
81
 
g_print ("The XID of the sockets window is %<link linkend="x">x</link>\n",
82
 
         GDK_WINDOW_XWINDOW (socket->window));
83
 
</programlisting>
84
 
</example>
85
 
</para>
86
 
<para>
87
 
Note that if you pass the XID of the socket to another
88
 
process that will create a plug in the socket, you
89
 
must make sure that the socket widget is not destroyed
90
 
until that plug is created. Violating this rule will
91
 
cause unpredictable consequences, the most likely
92
 
consequence being that the plug will appear as a
93
 
separate toplevel window. You can check if the plug
94
 
has been created by examining the
95
 
<structfield>plug_window</structfield> field of the
96
 
<link linkend="BonoboSocket"><type>BonoboSocket</type></link> structure. If this field is non-NULL,
97
 
then the plug has been succesfully created inside
98
 
of the socket.
99
 
</para>
100
 
<para>
101
 
When GTK+ is notified that the embedded window has been
102
 
destroyed, then it will destroy the socket as well. You
103
 
should always, therefore, be prepared for your sockets
104
 
to be destroyed at any time when the main event loop
105
 
is running.
106
 
</para>
107
 
<para>
108
 
A socket can also be used to swallow arbitrary
109
 
pre-existing top-level windows using <link linkend="gtk-socket-steal"><function>gtk_socket_steal()</function></link>,
110
 
though the integration when this is done will not be as close
111
 
as between a <link linkend="BonoboPlug"><type>BonoboPlug</type></link> and a <link linkend="BonoboSocket"><type>BonoboSocket</type></link>.
112
 
</para>
113
 
</refsect1>
114
 
 
115
 
<refsect1 id="libbonoboui-bonobo-socket.details" role="details">
116
 
<title role="details.title">Details</title>
117
 
<refsect2 id="BonoboSocket-struct" role="struct">
118
 
<title>BonoboSocket</title>
119
 
<indexterm zone="BonoboSocket-struct"><primary sortas="BonoboSocket">BonoboSocket</primary></indexterm><programlisting>typedef struct _BonoboSocket BonoboSocket;</programlisting>
120
 
<para>
121
 
    The <link linkend="GtkEditable"><type>GtkEditable</type></link> structure contains the following field.
122
 
    (This field should be considered read-only. It should
123
 
    never be set by an application.)
124
 
    <informaltable pgwide="1" frame="none" role="struct">
125
 
        <tgroup cols="2">
126
 
            <colspec colwidth="2*"/> <colspec colwidth="8*"/>
127
 
            <tbody>
128
 
                <row>
129
 
                    <entry><link linkend="GdkWindow"><type>GdkWindow</type></link> *plug_window;</entry>
130
 
                    <entry>the window embedded inside this <link linkend="GtkSocket"><type>GtkSocket</type></link>.</entry>
131
 
                </row>
132
 
            </tbody>
133
 
        </tgroup>
134
 
    </informaltable>
135
 
</para></refsect2>
136
 
<refsect2 id="BonoboSocketClass" role="struct">
137
 
<title>BonoboSocketClass</title>
138
 
<indexterm zone="BonoboSocketClass"><primary sortas="BonoboSocketClass">BonoboSocketClass</primary></indexterm><programlisting>typedef struct {
139
 
        GtkSocketClass parent_class;
140
 
 
141
 
        gpointer dummy[4];
142
 
} BonoboSocketClass;
143
 
</programlisting>
144
 
<para>
145
 
</para></refsect2>
146
 
<refsect2 id="bonobo-socket-new" role="function">
147
 
<title>bonobo_socket_new ()</title>
148
 
<indexterm zone="bonobo-socket-new"><primary sortas="bonobo_socket_new">bonobo_socket_new</primary></indexterm><programlisting><link linkend="GtkWidget">GtkWidget</link>*          bonobo_socket_new                   (void);</programlisting>
149
 
<para>
150
 
Create a new empty <link linkend="BonoboSocket"><type>BonoboSocket</type></link>.</para>
151
 
<para>
152
 
</para><variablelist role="params">
153
 
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> A new <link linkend="BonoboSocket"><type>BonoboSocket</type></link>.
154
 
</simpara></listitem></varlistentry>
155
 
</variablelist></refsect2>
156
 
 
157
 
</refsect1>
158
 
 
159
 
 
160
 
 
161
 
<refsect1 id="libbonoboui-bonobo-socket.see-also">
162
 
<title>See Also</title>
163
 
<para>
164
 
<variablelist>
165
 
<varlistentry>
166
 
<term><link linkend="BonoboPlug"><type>BonoboPlug</type></link></term>
167
 
<listitem><para>the widget that plugs into a <link linkend="BonoboSocket"><type>BonoboSocket</type></link>.</para></listitem>
168
 
</varlistentry>
169
 
</variablelist>
170
 
</para>
171
 
</refsect1>
172
 
 
173
 
</refentry>