KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
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 :  /proc/21572/root/usr/share/gtk-doc/html/libbonobo/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/21572/root/usr/share/gtk-doc/html/libbonobo/libbonobo-bonobo-context.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>bonobo-context</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
<link rel="start" href="index.html" title="Libbonobo Reference Manual">
<link rel="up" href="general.html" title="General">
<link rel="prev" href="libbonobo-bonobo-types.html" title="bonobo-types">
<link rel="next" href="libbonobo-bonobo-exception.html" title="bonobo-exception">
<meta name="generator" content="GTK-Doc V1.7 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="chapter" href="general.html" title="General">
<link rel="chapter" href="factories.html" title="Objects, Factories, Reference Counting">
<link rel="chapter" href="property-bags.html" title="Property Bags, Events, Listeners">
<link rel="chapter" href="monikers.html" title="Monikers">
<link rel="chapter" href="streams.html" title="Storages and Streams">
<link rel="chapter" href="persist.html" title="Persistency">
<link rel="chapter" href="misc.html" title="Miscellaneous">
</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="libbonobo-bonobo-types.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="general.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">Libbonobo Reference Manual</th>
<td><a accesskey="n" href="libbonobo-bonobo-exception.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="#id2687339" class="shortcut">Top</a>
                  &#160;|&#160;
                  <a href="#id2687450" class="shortcut">Description</a></nobr></td></tr>
</table>
<div class="refentry" lang="en">
<a name="libbonobo-bonobo-context"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2>
<a name="id2687339"></a><span class="refentrytitle">bonobo-context</span>
</h2>
<p>bonobo-context &#8212; Extensible runtime service interface</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<pre class="synopsis">



Bonobo_Unknown <a href="libbonobo-bonobo-context.html#bonobo-context-get">bonobo_context_get</a>           (const CORBA_char *context_name,
                                             CORBA_Environment *opt_ev);
void        <a href="libbonobo-bonobo-context.html#bonobo-context-add">bonobo_context_add</a>              (const CORBA_char *context_name,
                                             Bonobo_Unknown context);
<a href="libbonobo-bonobo-object.html#BonoboObject">BonoboObject</a>* <a href="libbonobo-bonobo-context.html#bonobo-context-running-get">bonobo_context_running_get</a>    (void);
void        <a href="libbonobo-bonobo-context.html#bonobo-running-context-auto-exit-unref">bonobo_running_context_auto_exit_unref</a>
                                            (<a href="libbonobo-bonobo-object.html#BonoboObject">BonoboObject</a> *object);
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id2687450"></a><h2>Description</h2>
<p>
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 ).
</p>
<p>
  </p>
<div class="example">
<a name="id2687471"></a><p class="title"><b>Example&#160;1.&#160;Getting and using the moniker context</b></p>
<pre class="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);
...
     </pre>
</div>
<p>
</p>
<p>
The list of contexts is open and may be expanded in the future,
currently there are the following:
  </p>
<div class="itemizedlist"><ul type="disc">
<li><p>
        Activation - Bonobo/MonikerContext
      </p></li>
<li><p>
        Running - Bonobo/RunningContext
      </p></li>
</ul></div>
<p>
</p>
<p>
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:
</p>
<p>
  </p>
<div class="example">
<a name="id2687522"></a><p class="title"><b>Example&#160;2.&#160;How to get a factory to quit when it is idle</b></p>
<pre class="programlisting">
static void
last_unref_exit_cb (gpointer      context,
		    BonoboObject *factory)
{
        bonobo_object_unref (factory);
	<a
href="/usr/share/gtk-doc/html/gtk/gtk-General.html#gtk-main-quit"
><code class="function">gtk_main_quit()</code></a>;
}
...
int main (int argc, char **argv)
{
	...
	bonobo_running_context_ignore_object (BONOBO_OBJREF (object));

	gtk_signal_connect (GTK_OBJECT (<a href="libbonobo-bonobo-context.html#bonobo-context-running-get"><code class="function">bonobo_context_running_get()</code></a>),
			    "last_unref", last_unref_exit_cb, factory);
	...
	<a href="libbonobo-bonobo-main.html#bonobo-main"><code class="function">bonobo_main()</code></a>;
}
    </pre>
</div>
<p>
</p>
<p>
  Since this is a commonly used thing there is a helper to make this
easier:
  </p>
<div class="example">
<a name="id2687579"></a><p class="title"><b>Example&#160;3.&#160;How to get a factory to quit when it is idle</b></p>
<pre class="programlisting">
bonobo_running_context_auto_exit_unref (factory) 
    </pre>
</div>
<p>
</p>
</div>
<div class="refsect1" lang="en">
<a name="id2687595"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="id2687605"></a><h3>
<a name="bonobo-context-get"></a>bonobo_context_get ()</h3>
<a class="indexterm" name="id2687618"></a><pre class="programlisting">Bonobo_Unknown bonobo_context_get           (const CORBA_char *context_name,
                                             CORBA_Environment *opt_ev);</pre>
<p>
The most useful context is named 'Activation' and returns
the IDL:Bonobo/ActivationContext:1.0 interface.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>context_name</code></em>&#160;:</span></td>
<td> the name of the context
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>opt_ev</code></em>&#160;:</span></td>
<td> optional Environment, or NULL
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> a new reference to a global Bonobo context or CORBA_OBJECT_NIL
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2687703"></a><h3>
<a name="bonobo-context-add"></a>bonobo_context_add ()</h3>
<a class="indexterm" name="id2687716"></a><pre class="programlisting">void        bonobo_context_add              (const CORBA_char *context_name,
                                             Bonobo_Unknown context);</pre>
<p>
This function adds a new context to the context system</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>context_name</code></em>&#160;:</span></td>
<td> the name to refer to the context by
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>context</code></em>&#160;:</span></td>
<td> The Bonobo_Unknown; a ref. is taken on this.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2687789"></a><h3>
<a name="bonobo-context-running-get"></a>bonobo_context_running_get ()</h3>
<a class="indexterm" name="id2687803"></a><pre class="programlisting"><a href="libbonobo-bonobo-object.html#BonoboObject">BonoboObject</a>* bonobo_context_running_get    (void);</pre>
<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>&#160;:</span></td>
<td>


</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2687838"></a><h3>
<a name="bonobo-running-context-auto-exit-unref"></a>bonobo_running_context_auto_exit_unref ()</h3>
<a class="indexterm" name="id2687852"></a><pre class="programlisting">void        bonobo_running_context_auto_exit_unref
                                            (<a href="libbonobo-bonobo-object.html#BonoboObject">BonoboObject</a> *object);</pre>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><em class="parameter"><code>object</code></em>&#160;:</span></td>
<td>


</td>
</tr></tbody>
</table></div>
</div>
</div>
</div>
</body>
</html>

Anon7 - 2021