1
<refentry id="libbonobo-bonobo-object">
3
<refentrytitle>BonoboObject</refentrytitle>
4
<manvolnum>3</manvolnum>
5
<refmiscinfo>LIBBONOBO Library</refmiscinfo>
9
<refname>BonoboObject</refname><refpurpose>Base object for wrapping Bonobo::Unknown derived objects.</refpurpose>
12
<refsynopsisdiv><title>Synopsis</title>
17
#define <link linkend="BONOBO-OBJECT-TYPE-CAPS">BONOBO_OBJECT_TYPE</link>
18
#define <link linkend="BONOBO-OBJREF-CAPS">BONOBO_OBJREF</link> (o)
19
void (<link linkend="BonoboObjectPOAFn">*BonoboObjectPOAFn</link>) (<link linkend="PortableServer-Servant">PortableServer_Servant</link> servant,
20
<link linkend="CORBA-Environment">CORBA_Environment</link> *ev);
21
struct <link linkend="BonoboObjectPrivate">BonoboObjectPrivate</link>;
22
typedef <link linkend="BonoboObjectHeader">BonoboObjectHeader</link>;
23
#define <link linkend="BONOBO-OBJECT-HEADER-SIZE-CAPS">BONOBO_OBJECT_HEADER_SIZE</link>
24
#define <link linkend="BONOBO-OBJECT-SIGNATURE-CAPS">BONOBO_OBJECT_SIGNATURE</link>
25
#define <link linkend="BONOBO-SERVANT-SIGNATURE-CAPS">BONOBO_SERVANT_SIGNATURE</link>
26
typedef <link linkend="BonoboObject">BonoboObject</link>;
27
typedef <link linkend="BonoboObjectClass">BonoboObjectClass</link>;
28
void <link linkend="bonobo-object-add-interface">bonobo_object_add_interface</link> (<link linkend="BonoboObject">BonoboObject</link> *object,
29
<link linkend="BonoboObject">BonoboObject</link> *newobj);
30
<link linkend="BonoboObject">BonoboObject</link>* <link linkend="bonobo-object-query-local-interface">bonobo_object_query_local_interface</link>
31
(<link linkend="BonoboObject">BonoboObject</link> *object,
33
<link linkend="Bonobo-Unknown">Bonobo_Unknown</link> <link linkend="bonobo-object-query-interface">bonobo_object_query_interface</link>
34
(<link linkend="BonoboObject">BonoboObject</link> *object,
36
<link linkend="CORBA-Environment">CORBA_Environment</link> *opt_ev);
37
<link linkend="Bonobo-Unknown">Bonobo_Unknown</link> <link linkend="bonobo-object-corba-objref">bonobo_object_corba_objref</link> (<link linkend="BonoboObject">BonoboObject</link> *object);
38
<link linkend="Bonobo-Unknown">Bonobo_Unknown</link> <link linkend="bonobo-object-dup-ref">bonobo_object_dup_ref</link> (<link linkend="Bonobo-Unknown">Bonobo_Unknown</link> object,
39
<link linkend="CORBA-Environment">CORBA_Environment</link> *opt_ev);
40
<link linkend="Bonobo-Unknown">Bonobo_Unknown</link> <link linkend="bonobo-object-release-unref">bonobo_object_release_unref</link> (<link linkend="Bonobo-Unknown">Bonobo_Unknown</link> object,
41
<link linkend="CORBA-Environment">CORBA_Environment</link> *opt_ev);
42
<link linkend="gpointer">gpointer</link> <link linkend="bonobo-object-ref">bonobo_object_ref</link> (<link linkend="gpointer">gpointer</link> obj);
43
void <link linkend="bonobo-object-idle-unref">bonobo_object_idle_unref</link> (<link linkend="gpointer">gpointer</link> obj);
44
<link linkend="gpointer">gpointer</link> <link linkend="bonobo-object-unref">bonobo_object_unref</link> (<link linkend="gpointer">gpointer</link> obj);
45
void <link linkend="bonobo-object-set-immortal">bonobo_object_set_immortal</link> (<link linkend="BonoboObject">BonoboObject</link> *object,
46
<link linkend="gboolean">gboolean</link> immortal);
47
<link linkend="gpointer">gpointer</link> <link linkend="bonobo-object-trace-refs">bonobo_object_trace_refs</link> (<link linkend="gpointer">gpointer</link> obj,
50
<link linkend="gboolean">gboolean</link> ref);
51
void <link linkend="bonobo-object-dump-interfaces">bonobo_object_dump_interfaces</link> (<link linkend="BonoboObject">BonoboObject</link> *object);
52
void <link linkend="bonobo-object-check-env">bonobo_object_check_env</link> (<link linkend="BonoboObject">BonoboObject</link> *object,
53
<link linkend="CORBA-Object">CORBA_Object</link> corba_object,
54
<link linkend="CORBA-Environment">CORBA_Environment</link> *ev);
55
#define <link linkend="BONOBO-OBJECT-CHECK-CAPS">BONOBO_OBJECT_CHECK</link> (o,c,e)
56
<link linkend="gboolean">gboolean</link> <link linkend="bonobo-unknown-ping">bonobo_unknown_ping</link> (<link linkend="Bonobo-Unknown">Bonobo_Unknown</link> object,
57
<link linkend="CORBA-Environment">CORBA_Environment</link> *opt_ev);
58
void <link linkend="bonobo-object-list-unref-all">bonobo_object_list_unref_all</link> (<link linkend="GList">GList</link> **list);
59
void <link linkend="bonobo-object-slist-unref-all">bonobo_object_slist_unref_all</link> (<link linkend="GSList">GSList</link> **list);
60
<link linkend="BonoboObject">BonoboObject</link>* <link linkend="bonobo-object">bonobo_object</link> (<link linkend="gpointer">gpointer</link> p);
61
#define <link linkend="bonobo-object-fast">bonobo_object_fast</link> (o)
62
#define <link linkend="bonobo-object-from-servant">bonobo_object_from_servant</link> (s)
63
#define <link linkend="bonobo-object-get-servant">bonobo_object_get_servant</link> (o)
64
<link linkend="GType">GType</link> <link linkend="bonobo-type-unique">bonobo_type_unique</link> (<link linkend="GType">GType</link> parent_type,
65
<link linkend="BonoboObjectPOAFn">BonoboObjectPOAFn</link> init_fn,
66
<link linkend="BonoboObjectPOAFn">BonoboObjectPOAFn</link> fini_fn,
67
int epv_struct_offset,
68
const <link linkend="GTypeInfo">GTypeInfo</link> *info,
69
const <link linkend="gchar">gchar</link> *type_name);
70
<link linkend="gboolean">gboolean</link> <link linkend="bonobo-type-setup">bonobo_type_setup</link> (<link linkend="GType">GType</link> type,
71
<link linkend="BonoboObjectPOAFn">BonoboObjectPOAFn</link> init_fn,
72
<link linkend="BonoboObjectPOAFn">BonoboObjectPOAFn</link> fini_fn,
73
int epv_struct_offset);
74
#define <link linkend="BONOBO-TYPE-FUNC-FULL-CAPS">BONOBO_TYPE_FUNC_FULL</link> (class_name, corba_name, parent, prefix)
75
#define <link linkend="BONOBO-TYPE-FUNC-CAPS">BONOBO_TYPE_FUNC</link> (class_name, parent, prefix)
85
<title>Description</title>
88
BonoboObject provides an easy to use way of writing CORBA servers. It
89
drastically simplifies the issues of epv and vepv construction by
90
automating these, and automatically instantiates a CORBA_Object on
91
g_object_new. This removes clutter from construction time. For
92
libbonobo-2.0, it strongly deprecates <link linkend="BonoboXObject">BonoboXObject</link>.
96
Again if you are looking to implement a CORBA interface you want to
97
see <link linkend="BonoboXObject">BonoboXObject</link>.
101
The <classname>Bonobo::Unknown</classname> interface (wrapped by
102
BonoboObject) is the foundation for the component system: it provides
103
life cycle management for objects as well as service discovery.
107
The Bonobo interfaces are all based on the
108
<classname>Bonobo::Unknown</classname> interface. This
109
interface is very simple and provides two basic services:
110
object lifetime management and object
111
functionality-discovery. This interface only contains three
117
void void <link linkend="ref">ref</link>();
118
void void <link linkend="unref">unref</link>();
119
Object query_interface (in string repoid);
126
The <function><link linkend="ref">ref</link>()</function> and <function><link linkend="unref">unref</link>()</function>
127
methods are used to control the lifetime of an object. The
128
<function>query_interface</function> method is used to discover
129
optional functionality provided by the object implementation.
133
The lifetime management is based on reference counting: when a
134
component is initially launched, it starts life with a reference
135
count of one. This reference is held by the component invoker.
136
Each time a reference is kept to this object (say, you store a
137
copy of the object in an array), the reference count is
138
incremented. Every time a reference goes out of scope, the
139
reference count needs to be decremented. When the reference
140
count reaches zero, the component knows that there are no
141
outstanding references to it, and it is safe to shutdown. At
142
this point, the component shuts down.
146
It is possible to ask an object which implements the
147
<classname>Bonobo::Unknown</classname> interface if it supports
148
other CORBA interfaces. For example, it would be possible to
149
ask an object whether it supports the
150
"IDL:Bonobo/EmbeddablePrint:1.0" interface to find out if it is
151
possible to print its contents. If the return value from
152
invoking the <function>query_interface</function> method on the
153
interface is CORBA_OBJECT_NIL, then we know that the requested interface
154
is not supported. Otherwise, we can invoke
155
IDL:Bonobo/EmbeddablePrint:1.0 methods on the returned CORBA
160
Clients of the <function>query_interface</function> method use
161
it to discover dynamically if a component supports a given
162
interface. Sometimes the client code would require a specific
163
interface to exist, but many times it is possible to operate in
164
a "downgraded" mode. You should design your code to be able to
165
cope with the lack of interfaces in objects. This will allow
166
your program to deal with more components, and this also allows
167
components to work in more situations.
171
For example, a help browser can load an HTML renderer component and
172
ask this component which sort of features are supported by it:
174
stop_animations (BrowserHTML html)
176
BrowserControl control
178
control = html->query_interface ("IDL:Browser/Control:1.0");
180
control-><link linkend="stop-animations">stop_animations</link>();
186
The return value of the query_interface invocation contains a
187
reference to a CORBA object that is derived from the
188
<classname>Bonobo::Unknown</classname> interface or
189
CORBA_OBJECT_NIL if the interface is not supported by the
190
object. And this interface would have been already
191
<function><link linkend="ref">ref</link>()</function>ed before it was returned. It is up
192
to the caller to call <function><link linkend="unref">unref</link>()</function> when they are
193
done using the interface.
197
BonoboObject implements the Bonobo::Unknown interface and exports the
198
implementations of the methods in this class to simplify creating
199
new objects that inherit from Bonobo::Unknown. This base object
200
provides default implementations for the ref, unref and
201
query_interface methods.
205
Other implementations reuse this implementation by listing on their
206
VEPV tables the bonobo_object_epv entry point vector.
210
The <classname>Bonobo::Unknown</classname> interface is inspired
211
by the Microsoft COM <classname>IUnknown</classname> interface
212
but it has been translated into the CORBA world.
217
<title>Details</title>
219
<title><anchor id="BONOBO-OBJECT-TYPE-CAPS">BONOBO_OBJECT_TYPE</title>
220
<programlisting>#define BONOBO_OBJECT_TYPE BONOBO_TYPE_OBJECT /* deprecated, you should use BONOBO_TYPE_OBJECT */
223
Returns the <link linkend="GtkType">GtkType</link> for the BonoboObject object.
226
<title><anchor id="BONOBO-OBJREF-CAPS">BONOBO_OBJREF()</title>
227
<programlisting>#define BONOBO_OBJREF(o) (bonobo_object_corba_objref(BONOBO_OBJECT(o)))
231
</para><informaltable pgwide="1" frame="none" role="params">
233
<colspec colwidth="2*">
234
<colspec colwidth="8*">
236
<row><entry align="right"><parameter>o</parameter> :</entry>
241
</tbody></tgroup></informaltable></refsect2>
243
<title><anchor id="BonoboObjectPOAFn">BonoboObjectPOAFn ()</title>
244
<programlisting>void (*BonoboObjectPOAFn) (<link linkend="PortableServer-Servant">PortableServer_Servant</link> servant,
245
<link linkend="CORBA-Environment">CORBA_Environment</link> *ev);</programlisting>
248
</para><informaltable pgwide="1" frame="none" role="params">
250
<colspec colwidth="2*">
251
<colspec colwidth="8*">
253
<row><entry align="right"><parameter>servant</parameter> :</entry>
256
<row><entry align="right"><parameter>ev</parameter> :</entry>
261
</tbody></tgroup></informaltable></refsect2>
263
<title><anchor id="BonoboObjectPrivate">struct BonoboObjectPrivate</title>
264
<programlisting>struct BonoboObjectPrivate;</programlisting>
266
Private information kept by the BonoboObject. This should not be
267
used by BonoboObject users.
270
<title><anchor id="BonoboObjectHeader">BonoboObjectHeader</title>
271
<programlisting>typedef struct {
272
GObject base; /* pointer + guint + pointer */
273
BonoboObjectPrivate *priv; /* pointer */
274
guint object_signature; /* guint */
275
} BonoboObjectHeader;
281
<title><anchor id="BONOBO-OBJECT-HEADER-SIZE-CAPS">BONOBO_OBJECT_HEADER_SIZE</title>
282
<programlisting>#define BONOBO_OBJECT_HEADER_SIZE (sizeof (BonoboObjectHeader))
288
<title><anchor id="BONOBO-OBJECT-SIGNATURE-CAPS">BONOBO_OBJECT_SIGNATURE</title>
289
<programlisting>#define BONOBO_OBJECT_SIGNATURE 0xaef2
295
<title><anchor id="BONOBO-SERVANT-SIGNATURE-CAPS">BONOBO_SERVANT_SIGNATURE</title>
296
<programlisting>#define BONOBO_SERVANT_SIGNATURE 0x2fae
302
<title><anchor id="BonoboObject">BonoboObject</title>
303
<programlisting>typedef struct {
304
/* A GObject and its signature of type BonoboObjectHeader */
305
GObject base; /* pointer + guint + pointer */
306
BonoboObjectPrivate *priv; /* pointer */
307
guint object_signature; /* guint */
309
/* A Servant and its signature - same memory layout */
310
POA_Bonobo_Unknown servant; /* pointer + pointer */
311
guint dummy; /* guint */
312
Bonobo_Unknown corba_objref; /* pointer */
313
guint servant_signature;
320
<title><anchor id="BonoboObjectClass">BonoboObjectClass</title>
321
<programlisting>typedef struct {
322
GObjectClass parent_class;
325
void (*destroy) (BonoboObject *object);
326
void (*system_exception) (BonoboObject *object,
327
CORBA_Object cobject,
328
CORBA_Environment *ev);
330
BonoboObjectPOAFn poa_init_fn;
331
BonoboObjectPOAFn poa_fini_fn;
333
POA_Bonobo_Unknown__vepv *vepv;
335
/* The offset of this class' additional epv */
336
int epv_struct_offset;
338
PortableServer_ServantBase__epv base_epv;
339
POA_Bonobo_Unknown__epv epv;
346
<title><anchor id="bonobo-object-add-interface">bonobo_object_add_interface ()</title>
347
<programlisting>void bonobo_object_add_interface (<link linkend="BonoboObject">BonoboObject</link> *object,
348
<link linkend="BonoboObject">BonoboObject</link> *newobj);</programlisting>
350
Adds the interfaces supported by <parameter>newobj</parameter> to the list of interfaces
351
for <parameter>object</parameter>. This function adds the interfaces supported by
352
<parameter>newobj</parameter> to the list of interfaces support by <parameter>object</parameter>. It should never
353
be used when the object has been exposed to the world. This is a firm
354
part of the contract.</para>
357
</para><informaltable pgwide="1" frame="none" role="params">
359
<colspec colwidth="2*">
360
<colspec colwidth="8*">
362
<row><entry align="right"><parameter>object</parameter> :</entry>
363
<entry> The BonoboObject to which an interface is going to be added.
365
<row><entry align="right"><parameter>newobj</parameter> :</entry>
366
<entry> The BonoboObject containing the new interface to be added.
368
</tbody></tgroup></informaltable></refsect2>
370
<title><anchor id="bonobo-object-query-local-interface">bonobo_object_query_local_interface ()</title>
371
<programlisting><link linkend="BonoboObject">BonoboObject</link>* bonobo_object_query_local_interface
372
(<link linkend="BonoboObject">BonoboObject</link> *object,
373
const char *repo_id);</programlisting>
378
</para><informaltable pgwide="1" frame="none" role="params">
380
<colspec colwidth="2*">
381
<colspec colwidth="8*">
383
<row><entry align="right"><parameter>object</parameter> :</entry>
384
<entry> A <link linkend="BonoboObject">BonoboObject</link> which is the aggregate of multiple objects.
386
<row><entry align="right"><parameter>repo_id</parameter> :</entry>
387
<entry> The id of the interface being queried.
389
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> A <link linkend="BonoboObject">BonoboObject</link> for the requested interface.
391
</tbody></tgroup></informaltable></refsect2>
393
<title><anchor id="bonobo-object-query-interface">bonobo_object_query_interface ()</title>
394
<programlisting><link linkend="Bonobo-Unknown">Bonobo_Unknown</link> bonobo_object_query_interface
395
(<link linkend="BonoboObject">BonoboObject</link> *object,
397
<link linkend="CORBA-Environment">CORBA_Environment</link> *opt_ev);</programlisting>
402
</para><informaltable pgwide="1" frame="none" role="params">
404
<colspec colwidth="2*">
405
<colspec colwidth="8*">
407
<row><entry align="right"><parameter>object</parameter> :</entry>
408
<entry> A BonoboObject to be queried for a given interface.
410
<row><entry align="right"><parameter>repo_id</parameter> :</entry>
411
<entry> The name of the interface to be queried.
413
<row><entry align="right"><parameter>opt_ev</parameter> :</entry>
414
<entry> optional exception environment
416
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> The CORBA interface named <parameter>repo_id</parameter> for <parameter>object</parameter>.
418
</tbody></tgroup></informaltable></refsect2>
420
<title><anchor id="bonobo-object-corba-objref">bonobo_object_corba_objref ()</title>
421
<programlisting><link linkend="Bonobo-Unknown">Bonobo_Unknown</link> bonobo_object_corba_objref (<link linkend="BonoboObject">BonoboObject</link> *object);</programlisting>
426
</para><informaltable pgwide="1" frame="none" role="params">
428
<colspec colwidth="2*">
429
<colspec colwidth="8*">
431
<row><entry align="right"><parameter>object</parameter> :</entry>
432
<entry> A BonoboObject whose CORBA object is requested.
434
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> The CORBA interface object for which <parameter>object</parameter> is a wrapper.
436
</tbody></tgroup></informaltable></refsect2>
438
<title><anchor id="bonobo-object-dup-ref">bonobo_object_dup_ref ()</title>
439
<programlisting><link linkend="Bonobo-Unknown">Bonobo_Unknown</link> bonobo_object_dup_ref (<link linkend="Bonobo-Unknown">Bonobo_Unknown</link> object,
440
<link linkend="CORBA-Environment">CORBA_Environment</link> *opt_ev);</programlisting>
442
This function returns a duplicated CORBA Object reference;
443
it also bumps the ref count on the object. This is ideal to
444
use in any method returning a Bonobo_Object in a CORBA impl.
445
If object is CORBA_OBJECT_NIL it is returned unaffected.</para>
448
</para><informaltable pgwide="1" frame="none" role="params">
450
<colspec colwidth="2*">
451
<colspec colwidth="8*">
453
<row><entry align="right"><parameter>object</parameter> :</entry>
454
<entry> a Bonobo_Unknown corba object
456
<row><entry align="right"><parameter>opt_ev</parameter> :</entry>
457
<entry> an optional exception environment
459
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> duplicated & ref'd corba object reference.
461
</tbody></tgroup></informaltable></refsect2>
463
<title><anchor id="bonobo-object-release-unref">bonobo_object_release_unref ()</title>
464
<programlisting><link linkend="Bonobo-Unknown">Bonobo_Unknown</link> bonobo_object_release_unref (<link linkend="Bonobo-Unknown">Bonobo_Unknown</link> object,
465
<link linkend="CORBA-Environment">CORBA_Environment</link> *opt_ev);</programlisting>
467
This function releases a CORBA Object reference;
468
it also decrements the ref count on the bonobo object.
469
This is the converse of bonobo_object_dup_ref. We
470
tolerate object == CORBA_OBJECT_NIL silently.</para>
473
</para><informaltable pgwide="1" frame="none" role="params">
475
<colspec colwidth="2*">
476
<colspec colwidth="8*">
478
<row><entry align="right"><parameter>object</parameter> :</entry>
479
<entry> a Bonobo_Unknown corba object
481
<row><entry align="right"><parameter>opt_ev</parameter> :</entry>
482
<entry> an optional exception environment
484
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>
486
</tbody></tgroup></informaltable></refsect2>
488
<title><anchor id="bonobo-object-ref">bonobo_object_ref ()</title>
489
<programlisting><link linkend="gpointer">gpointer</link> bonobo_object_ref (<link linkend="gpointer">gpointer</link> obj);</programlisting>
491
Increments the reference count for the aggregate BonoboObject.</para>
494
</para><informaltable pgwide="1" frame="none" role="params">
496
<colspec colwidth="2*">
497
<colspec colwidth="8*">
499
<row><entry align="right"><parameter>obj</parameter> :</entry>
502
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>
504
</tbody></tgroup></informaltable></refsect2>
506
<title><anchor id="bonobo-object-idle-unref">bonobo_object_idle_unref ()</title>
507
<programlisting>void bonobo_object_idle_unref (<link linkend="gpointer">gpointer</link> obj);</programlisting>
510
</para><informaltable pgwide="1" frame="none" role="params">
512
<colspec colwidth="2*">
513
<colspec colwidth="8*">
515
<row><entry align="right"><parameter>obj</parameter> :</entry>
518
</tbody></tgroup></informaltable></refsect2>
520
<title><anchor id="bonobo-object-unref">bonobo_object_unref ()</title>
521
<programlisting><link linkend="gpointer">gpointer</link> bonobo_object_unref (<link linkend="gpointer">gpointer</link> obj);</programlisting>
523
Decrements the reference count for the aggregate BonoboObject.</para>
526
</para><informaltable pgwide="1" frame="none" role="params">
528
<colspec colwidth="2*">
529
<colspec colwidth="8*">
531
<row><entry align="right"><parameter>obj</parameter> :</entry>
534
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>
536
</tbody></tgroup></informaltable></refsect2>
538
<title><anchor id="bonobo-object-set-immortal">bonobo_object_set_immortal ()</title>
539
<programlisting>void bonobo_object_set_immortal (<link linkend="BonoboObject">BonoboObject</link> *object,
540
<link linkend="gboolean">gboolean</link> immortal);</programlisting>
543
</para><informaltable pgwide="1" frame="none" role="params">
545
<colspec colwidth="2*">
546
<colspec colwidth="8*">
548
<row><entry align="right"><parameter>object</parameter> :</entry>
551
<row><entry align="right"><parameter>immortal</parameter> :</entry>
556
</tbody></tgroup></informaltable></refsect2>
558
<title><anchor id="bonobo-object-trace-refs">bonobo_object_trace_refs ()</title>
559
<programlisting><link linkend="gpointer">gpointer</link> bonobo_object_trace_refs (<link linkend="gpointer">gpointer</link> obj,
562
<link linkend="gboolean">gboolean</link> ref);</programlisting>
565
</para><informaltable pgwide="1" frame="none" role="params">
567
<colspec colwidth="2*">
568
<colspec colwidth="8*">
570
<row><entry align="right"><parameter>obj</parameter> :</entry>
573
<row><entry align="right"><parameter>fn</parameter> :</entry>
576
<row><entry align="right"><parameter>line</parameter> :</entry>
579
<row><entry align="right"><parameter>ref</parameter> :</entry>
582
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>
584
</tbody></tgroup></informaltable></refsect2>
586
<title><anchor id="bonobo-object-dump-interfaces">bonobo_object_dump_interfaces ()</title>
587
<programlisting>void bonobo_object_dump_interfaces (<link linkend="BonoboObject">BonoboObject</link> *object);</programlisting>
590
</para><informaltable pgwide="1" frame="none" role="params">
592
<colspec colwidth="2*">
593
<colspec colwidth="8*">
595
<row><entry align="right"><parameter>object</parameter> :</entry>
600
</tbody></tgroup></informaltable></refsect2>
602
<title><anchor id="bonobo-object-check-env">bonobo_object_check_env ()</title>
603
<programlisting>void bonobo_object_check_env (<link linkend="BonoboObject">BonoboObject</link> *object,
604
<link linkend="CORBA-Object">CORBA_Object</link> corba_object,
605
<link linkend="CORBA-Environment">CORBA_Environment</link> *ev);</programlisting>
607
This routine verifies the <parameter>ev</parameter> environment for any fatal system
608
exceptions. If a system exception occurs, the object raises a
609
"system_exception" signal. The idea is that GObjects which are
610
used to wrap a CORBA interface can use this function to notify
611
the user if a fatal exception has occurred, causing the object
612
to become defunct.</para>
615
</para><informaltable pgwide="1" frame="none" role="params">
617
<colspec colwidth="2*">
618
<colspec colwidth="8*">
620
<row><entry align="right"><parameter>object</parameter> :</entry>
621
<entry> The object on which we operate
623
<row><entry align="right"><parameter>corba_object</parameter> :</entry>
626
<row><entry align="right"><parameter>ev</parameter> :</entry>
627
<entry> CORBA Environment to check
629
</tbody></tgroup></informaltable></refsect2>
631
<title><anchor id="BONOBO-OBJECT-CHECK-CAPS">BONOBO_OBJECT_CHECK()</title>
632
<programlisting>#define BONOBO_OBJECT_CHECK(o,c,e)</programlisting>
634
Checks if the exception in <parameter>e</parameter> needs to be signaled. If so, then
635
the proper exception signal is generated on the BonoboObject object
636
<parameter>o</parameter> for the CORBA reference <parameter>c</parameter>.
637
</para><informaltable pgwide="1" frame="none" role="params">
639
<colspec colwidth="2*">
640
<colspec colwidth="8*">
642
<row><entry align="right"><parameter>o</parameter> :</entry>
645
<row><entry align="right"><parameter>c</parameter> :</entry>
648
<row><entry align="right"><parameter>e</parameter> :</entry>
653
</tbody></tgroup></informaltable></refsect2>
655
<title><anchor id="bonobo-unknown-ping">bonobo_unknown_ping ()</title>
656
<programlisting><link linkend="gboolean">gboolean</link> bonobo_unknown_ping (<link linkend="Bonobo-Unknown">Bonobo_Unknown</link> object,
657
<link linkend="CORBA-Environment">CORBA_Environment</link> *opt_ev);</programlisting>
659
Pings the object <parameter>object</parameter> using the ref/unref methods from Bonobo::Unknown.
660
You can use this one to see if a remote object has gone away.</para>
663
</para><informaltable pgwide="1" frame="none" role="params">
665
<colspec colwidth="2*">
666
<colspec colwidth="8*">
668
<row><entry align="right"><parameter>object</parameter> :</entry>
669
<entry> a CORBA object reference of type Bonobo::Unknown
671
<row><entry align="right"><parameter>opt_ev</parameter> :</entry>
672
<entry> optional exception environment
674
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> <literal>TRUE</literal> if the Bonobo::Unknown <parameter>object</parameter> is alive.
676
</tbody></tgroup></informaltable></refsect2>
678
<title><anchor id="bonobo-object-list-unref-all">bonobo_object_list_unref_all ()</title>
679
<programlisting>void bonobo_object_list_unref_all (<link linkend="GList">GList</link> **list);</programlisting>
681
This routine unrefs all valid objects in
682
the list and then removes them from <parameter>list</parameter> if
683
they have not already been so removed.</para>
686
</para><informaltable pgwide="1" frame="none" role="params">
688
<colspec colwidth="2*">
689
<colspec colwidth="8*">
691
<row><entry align="right"><parameter>list</parameter> :</entry>
692
<entry> A list of BonoboObjects *s
694
</tbody></tgroup></informaltable></refsect2>
696
<title><anchor id="bonobo-object-slist-unref-all">bonobo_object_slist_unref_all ()</title>
697
<programlisting>void bonobo_object_slist_unref_all (<link linkend="GSList">GSList</link> **list);</programlisting>
700
</para><informaltable pgwide="1" frame="none" role="params">
702
<colspec colwidth="2*">
703
<colspec colwidth="8*">
705
<row><entry align="right"><parameter>list</parameter> :</entry>
710
</tbody></tgroup></informaltable></refsect2>
712
<title><anchor id="bonobo-object">bonobo_object ()</title>
713
<programlisting><link linkend="BonoboObject">BonoboObject</link>* bonobo_object (<link linkend="gpointer">gpointer</link> p);</programlisting>
715
This function can be passed a BonoboObject * or a
716
PortableServer_Servant, and it will return a BonoboObject *.</para>
719
</para><informaltable pgwide="1" frame="none" role="params">
721
<colspec colwidth="2*">
722
<colspec colwidth="8*">
724
<row><entry align="right"><parameter>p</parameter> :</entry>
725
<entry> a pointer to something
727
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> a BonoboObject or NULL on error.
729
</tbody></tgroup></informaltable></refsect2>
731
<title><anchor id="bonobo-object-fast">bonobo_object_fast()</title>
732
<programlisting>#define bonobo_object_fast(o)</programlisting>
735
</para><informaltable pgwide="1" frame="none" role="params">
737
<colspec colwidth="2*">
738
<colspec colwidth="8*">
740
<row><entry align="right"><parameter>o</parameter> :</entry>
745
</tbody></tgroup></informaltable></refsect2>
747
<title><anchor id="bonobo-object-from-servant">bonobo_object_from_servant()</title>
748
<programlisting>#define bonobo_object_from_servant(s) ((BonoboObject *)(((guchar *) (s)) - BONOBO_OBJECT_HEADER_SIZE))
752
</para><informaltable pgwide="1" frame="none" role="params">
754
<colspec colwidth="2*">
755
<colspec colwidth="8*">
757
<row><entry align="right"><parameter>s</parameter> :</entry>
760
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>
762
</tbody></tgroup></informaltable></refsect2>
764
<title><anchor id="bonobo-object-get-servant">bonobo_object_get_servant()</title>
765
<programlisting>#define bonobo_object_get_servant(o) ((PortableServer_Servant)((guchar *)(o) + BONOBO_OBJECT_HEADER_SIZE))
769
</para><informaltable pgwide="1" frame="none" role="params">
771
<colspec colwidth="2*">
772
<colspec colwidth="8*">
774
<row><entry align="right"><parameter>o</parameter> :</entry>
777
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>
779
</tbody></tgroup></informaltable></refsect2>
781
<title><anchor id="bonobo-type-unique">bonobo_type_unique ()</title>
782
<programlisting><link linkend="GType">GType</link> bonobo_type_unique (<link linkend="GType">GType</link> parent_type,
783
<link linkend="BonoboObjectPOAFn">BonoboObjectPOAFn</link> init_fn,
784
<link linkend="BonoboObjectPOAFn">BonoboObjectPOAFn</link> fini_fn,
785
int epv_struct_offset,
786
const <link linkend="GTypeInfo">GTypeInfo</link> *info,
787
const <link linkend="gchar">gchar</link> *type_name);</programlisting>
789
This function is the main entry point for deriving bonobo
790
server interfaces.</para>
793
</para><informaltable pgwide="1" frame="none" role="params">
795
<colspec colwidth="2*">
796
<colspec colwidth="8*">
798
<row><entry align="right"><parameter>parent_type</parameter> :</entry>
799
<entry> the parent GType
801
<row><entry align="right"><parameter>init_fn</parameter> :</entry>
802
<entry> a POA initialization function
804
<row><entry align="right"><parameter>fini_fn</parameter> :</entry>
805
<entry> a POA finialization function or NULL
807
<row><entry align="right"><parameter>epv_struct_offset</parameter> :</entry>
808
<entry> the offset into the struct that the epv
809
commences at, or 0 if we are inheriting a plain GObject
810
from a BonoboObject, adding no new CORBA interfaces
812
<row><entry align="right"><parameter>info</parameter> :</entry>
813
<entry> the standard GTypeInfo.
815
<row><entry align="right"><parameter>type_name</parameter> :</entry>
818
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> the constructed GType.
820
</tbody></tgroup></informaltable></refsect2>
822
<title><anchor id="bonobo-type-setup">bonobo_type_setup ()</title>
823
<programlisting><link linkend="gboolean">gboolean</link> bonobo_type_setup (<link linkend="GType">GType</link> type,
824
<link linkend="BonoboObjectPOAFn">BonoboObjectPOAFn</link> init_fn,
825
<link linkend="BonoboObjectPOAFn">BonoboObjectPOAFn</link> fini_fn,
826
int epv_struct_offset);</programlisting>
828
This function initializes a type derived from BonoboObject, such that
829
when you instantiate a new object of this type with g_type_new the
830
CORBA object will be correctly created and embedded.</para>
833
</para><informaltable pgwide="1" frame="none" role="params">
835
<colspec colwidth="2*">
836
<colspec colwidth="8*">
838
<row><entry align="right"><parameter>type</parameter> :</entry>
839
<entry> The type to initialize
841
<row><entry align="right"><parameter>init_fn</parameter> :</entry>
842
<entry> the POA_init function for the CORBA interface or NULL
844
<row><entry align="right"><parameter>fini_fn</parameter> :</entry>
845
<entry> NULL or a custom POA free fn.
847
<row><entry align="right"><parameter>epv_struct_offset</parameter> :</entry>
848
<entry> the offset in the class structure where the epv is or 0
850
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> TRUE on success, FALSE on error.
852
</tbody></tgroup></informaltable></refsect2>
854
<title><anchor id="BONOBO-TYPE-FUNC-FULL-CAPS">BONOBO_TYPE_FUNC_FULL()</title>
855
<programlisting>#define BONOBO_TYPE_FUNC_FULL(class_name, corba_name, parent, prefix)</programlisting>
858
</para><informaltable pgwide="1" frame="none" role="params">
860
<colspec colwidth="2*">
861
<colspec colwidth="8*">
863
<row><entry align="right"><parameter>class_name</parameter> :</entry>
866
<row><entry align="right"><parameter>corba_name</parameter> :</entry>
869
<row><entry align="right"><parameter>parent</parameter> :</entry>
872
<row><entry align="right"><parameter>prefix</parameter> :</entry>
877
</tbody></tgroup></informaltable></refsect2>
879
<title><anchor id="BONOBO-TYPE-FUNC-CAPS">BONOBO_TYPE_FUNC()</title>
880
<programlisting>#define BONOBO_TYPE_FUNC(class_name, parent, prefix)</programlisting>
883
</para><informaltable pgwide="1" frame="none" role="params">
885
<colspec colwidth="2*">
886
<colspec colwidth="8*">
888
<row><entry align="right"><parameter>class_name</parameter> :</entry>
891
<row><entry align="right"><parameter>parent</parameter> :</entry>
894
<row><entry align="right"><parameter>prefix</parameter> :</entry>
899
</tbody></tgroup></informaltable></refsect2>
906
<title>See Also</title>
908
<link linkend="GtkObject">GtkObject</link>