<!-- ##### SECTION Title ##### -->
bonobo-context

<!-- ##### SECTION Short_Description ##### -->
Extensible runtime service interface

<!-- ##### SECTION Long_Description ##### -->
<para>
The bonobo-context code is designed to provide a way to
expose CORBA contexts through a single C interface. This
is so that language bindings can get away with wrapping
a single function, and yet have access to the whole
Bonobo service framework. Two examples of this are the
MonikerContext and the RunningContext ( see
Bonobo_Context.idl ).
</para>

<para>
  <example>
     <title>Getting and using the moniker context</title>
     <programlisting>
Bonobo_MonikerContext context;
Bonobo_Unknown        object;

context = bonobo_context_get ("Activation", NULL);

if (context == CORBA_OBJECT_NIL)
	g_error (_("Internal error, no activation context"));

object = Bonobo_MonikerContext_getObject (
	"file:/demo/a.jpeg", "Bonobo/Control", ev);
...
     </programlisting>
  </example>
</para>

<para>
The list of contexts is open and may be expanded in the future,
currently there are the following:
  <itemizedlist>
    <listitem>
      <para>
        Activation - Bonobo/MonikerContext
      </para>
    </listitem>
    <listitem>
      <para>
        Running - Bonobo/RunningContext
      </para>
    </listitem>
  </itemizedlist>
</para>

<para>
The running context is particularly useful for ensuring that
server processes exit cleanly when all their objects and
derived objects are dead. To do this we can simply do the
following:
</para>
<para>
  <example>
    <title>How to get a factory to quit when it is idle</title>
    <programlisting>
static void
last_unref_exit_cb (gpointer      context,
		    BonoboObject *factory)
{
        bonobo_object_unref (factory);
	gtk_main_quit ();
}
...
int main (int argc, char **argv)
{
	...
	bonobo_running_context_ignore_object (BONOBO_OBJREF (object));

	gtk_signal_connect (GTK_OBJECT (bonobo_context_running_get ()),
			    "last_unref", last_unref_exit_cb, factory);
	...
	bonobo_main ();
}
    </programlisting>
  </example>
</para>
<para>
  Since this is a commonly used thing there is a helper to make this
easier:
  <example>
    <title>How to get a factory to quit when it is idle</title>
    <programlisting>
bonobo_running_context_auto_exit_unref (factory) 
    </programlisting>
  </example>
</para>

<!-- ##### SECTION See_Also ##### -->
<para>

</para>

<!-- ##### SECTION Stability_Level ##### -->


<!-- ##### FUNCTION bonobo_context_get ##### -->
<para>

</para>

@context_name: 
@opt_ev: 
@Returns: 


<!-- ##### FUNCTION bonobo_context_add ##### -->
<para>

</para>

@context_name: 
@context: 


<!-- ##### FUNCTION bonobo_context_running_get ##### -->
<para>

</para>

@Returns: 


<!-- ##### FUNCTION bonobo_running_context_auto_exit_unref ##### -->
<para>

</para>

@object: 


