7
CONTENT="Modular DocBook HTML Stylesheet Version 1.64
10
TITLE="Libbonobo Reference Manual"
11
HREF="index.html"><LINK
13
TITLE="Libbonobo API Reference Manual"
16
TITLE="bonobo-config-database"
17
HREF="libbonobo-bonobo-config-database.html"><LINK
19
TITLE="bonobo-exception"
20
HREF="libbonobo-bonobo-exception.html"></HEAD
43
>Libbonobo Reference Manual</FONT
52
HREF="libbonobo-bonobo-config-database.html"
57
><<< Previous Page</B
106
HREF="libbonobo-bonobo-exception.html"
111
>Next Page >>></B
120
NAME="LIBBONOBO-BONOBO-CONTEXT"
130
>bonobo-context -- Extensible runtime service interface</DIV
132
CLASS="REFSYNOPSISDIV"
150
HREF="libbonobo-bonobo-context.html#BONOBO-CONTEXT-GET"
151
>bonobo_context_get</A
152
> (const CORBA_char *context_name,
153
CORBA_Environment *opt_ev);
155
HREF="libbonobo-bonobo-context.html#BONOBO-CONTEXT-ADD"
156
>bonobo_context_add</A
157
> (const CORBA_char *context_name,
158
Bonobo_Unknown context);
160
HREF="libbonobo-bonobo-object.html#BONOBOOBJECT"
163
HREF="libbonobo-bonobo-context.html#BONOBO-CONTEXT-RUNNING-GET"
164
>bonobo_context_running_get</A
167
HREF="libbonobo-bonobo-context.html#BONOBO-RUNNING-CONTEXT-AUTO-EXIT-UNREF"
168
>bonobo_running_context_auto_exit_unref</A
171
HREF="libbonobo-bonobo-object.html#BONOBOOBJECT"
186
>The bonobo-context code is designed to provide a way to
187
expose CORBA contexts through a single C interface. This
188
is so that language bindings can get away with wrapping
189
a single function, and yet have access to the whole
190
Bonobo service framework. Two examples of this are the
191
MonikerContext and the RunningContext ( see
192
Bonobo_Context.idl ).</P
201
>Example 1. Getting and using the moniker context</B
211
CLASS="PROGRAMLISTING"
212
>Bonobo_MonikerContext context;
213
Bonobo_Unknown object;
215
context = bonobo_context_get ("Activation", NULL);
217
if (context == CORBA_OBJECT_NIL)
218
g_error (_("Internal error, no activation context"));
220
object = Bonobo_MonikerContext_getObject (
221
"file:/demo/a.jpeg", "Bonobo/Control", ev);
230
>The list of contexts is open and may be expanded in the future,
231
currently there are the following:
237
> Activation - Bonobo/MonikerContext
242
> Running - Bonobo/RunningContext
248
>The running context is particularly useful for ensuring that
249
server processes exit cleanly when all their objects and
250
derived objects are dead. To do this we can simply do the
260
>Example 2. How to get a factory to quit when it is idle</B
270
CLASS="PROGRAMLISTING"
272
last_unref_exit_cb (gpointer context,
273
BonoboObject *factory)
275
bonobo_object_unref (factory);
277
HREF=../gtk/gtk-general.html#GTK-MAIN-QUIT
278
>gtk_main_quit</A>();
281
int main (int argc, char **argv)
284
bonobo_running_context_ignore_object (BONOBO_OBJREF (object));
286
gtk_signal_connect (GTK_OBJECT (<A
287
HREF="libbonobo-bonobo-context.html#BONOBO-CONTEXT-RUNNING-GET"
288
>bonobo_context_running_get</A
290
"last_unref", last_unref_exit_cb, factory);
293
HREF="libbonobo-bonobo-main.html#BONOBO-MAIN"
304
> Since this is a commonly used thing there is a helper to make this
313
>Example 3. How to get a factory to quit when it is idle</B
323
CLASS="PROGRAMLISTING"
324
>bonobo_running_context_auto_exit_unref (factory)
346
NAME="BONOBO-CONTEXT-GET"
348
>bonobo_context_get ()</H3
357
CLASS="PROGRAMLISTING"
358
>Bonobo_Unknown bonobo_context_get (const CORBA_char *context_name,
359
CORBA_Environment *opt_ev);</PRE
364
>The most useful context is named 'Activation' and returns
365
the IDL:Bonobo/ActivationContext:1.0 interface.</P
369
CLASS="INFORMALTABLE"
398
> the name of the context</TD
415
> optional Environment, or NULL</TD
430
> a new reference to a global Bonobo context or CORBA_OBJECT_NIL</TD
445
NAME="BONOBO-CONTEXT-ADD"
447
>bonobo_context_add ()</H3
456
CLASS="PROGRAMLISTING"
457
>void bonobo_context_add (const CORBA_char *context_name,
458
Bonobo_Unknown context);</PRE
463
>This function adds a new context to the context system</P
467
CLASS="INFORMALTABLE"
496
> the name to refer to the context by</TD
513
> The Bonobo_Unknown; a ref. is taken on this.</TD
528
NAME="BONOBO-CONTEXT-RUNNING-GET"
530
>bonobo_context_running_get ()</H3
539
CLASS="PROGRAMLISTING"
541
HREF="libbonobo-bonobo-object.html#BONOBOOBJECT"
543
>* bonobo_context_running_get (void);</PRE
550
CLASS="INFORMALTABLE"
592
NAME="BONOBO-RUNNING-CONTEXT-AUTO-EXIT-UNREF"
594
>bonobo_running_context_auto_exit_unref ()</H3
603
CLASS="PROGRAMLISTING"
604
>void bonobo_running_context_auto_exit_unref
606
HREF="libbonobo-bonobo-object.html#BONOBOOBJECT"
615
CLASS="INFORMALTABLE"
656
CLEAR="all"><BR><TABLE
668
HREF="libbonobo-bonobo-config-database.html"
673
><<< Previous Page</B
722
HREF="libbonobo-bonobo-exception.html"
727
>Next Page >>></B
740
>bonobo-config-database</B
b'\\ No newline at end of file'