Sophie

Sophie

distrib > Mandriva > 2008.1 > x86_64 > media > main-release > by-pkgid > 9411cff4bc6d4e61b29ae81cd24665af > files > 1817

gtkmm2.4-doc-2.12.7-1mdv2008.1.x86_64.rpm

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Appendix I. Optional API</title>
<link rel="stylesheet" href="style.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
<link rel="start" href="index.html" title="Programming with gtkmm">
<link rel="up" href="index.html" title="Programming with gtkmm">
<link rel="prev" href="aphs07.html" title="Documentation">
<link rel="next" href="apis02.html" title="Optional API when building gtkmm">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="navheader">
<table width="100%" summary="Navigation header">
<tr><th colspan="3" align="center">Appendix I. Optional API</th></tr>
<tr>
<td width="20%" align="left">
<a accesskey="p" href="aphs07.html"><img src="../icons/prev.png" alt="Prev"></a> </td>
<th width="60%" align="center"> </th>
<td width="20%" align="right"> <a accesskey="n" href="apis02.html"><img src="../icons/next.png" alt="Next"></a>
</td>
</tr>
</table>
<hr>
</div>
<div class="appendix" lang="en">
<div class="titlepage"><div><div><h2 class="title">
<a name="sec-appendix-optional-api"></a>Appendix I. Optional API</h2></div></div></div>
<div class="toc">
<p><b>Table of Contents</b></p>
<ul>
<li><span class="sect1"><a href="api.html#id2600074">Optional API when building glibmm</a></span></li>
<li><span class="sect1"><a href="apis02.html">Optional API when building gtkmm</a></span></li>
</ul>
</div>
<p>The gtkmm API is meant to be easy and convenient. However, some of these conveniences are not worth the overhead on reduced resources devices, such as the Nokia 770 internet tablet. For instance, with regular gtkmm you can implement a signal handler by deriving the class and overriding its virtual on_thesignalname() method. But that additional API increases code size. And in the case of virtual methods, it increases per-object memory size, and demands that the linker loads the method's symbol even if you don't use it. Therefore, gtkmm can be built with a reduced API. In general, the optional API is rarely used, and there are slightly less convenient alternatives for all of the optional API.</p>
<p>When gtkmm has been built with optional API disabled, macros will be undefined, indicating that the API is not available. If you attempt to compile an application that uses this optional API, against a version of gtkmm that has disabled that API, you will see compiler warnings about missing functions.</p>
<p>The following sections describe the available configure options used to disable optional API. Most developers will rarely need to provide these configure options, because they will rarely build glibmm or gtkmm, preferring to use official packages or installers. However, if you are developing for an embedded device, you might need to be aware of these options.</p>
<div class="sect1" lang="en">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="id2600074"></a>Optional API when building glibmm</h2></div></div></div>
<div class="sect2" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="id2600080"></a>--enable-deprecated-api=no</h3></div></div></div>
<p>
When enable-deprecated-api is disabled, no deprecated classes or methods will be available in glibmm. For instance, the Date::set_time(GTime time) method overload will not be provided. The reference documentation contains a <a class="ulink" href="../../../../glibmm-2.4/docs/reference/html/deprecated.html" target="_top">full list of deprecated glibmm API</a>.</p>
<p>If deprecated glibmm API is available, the GLIBMM_DISABLE_DEPRECATED macro will not be defined.</p>
</div>
<div class="sect2" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="id2600105"></a>--enable-api-exceptions=no</h3></div></div></div>
<p>
When enable-api-exceptions is disabled, no exceptions will be used in the glibmm or gtkmm API, and no exceptions will be thrown. This allows applications to be built without support for exceptions. For intance, the g++ -fno-exceptions option may be used. Where a method would normally throw an exception, that method will instead take an additional std::auto_ptr&lt;Glib::Error&gt;&amp; output parameter. If you are not using exceptions then you should check whether this parameter was set and handle any error appropriately.</p>
<p>If exceptions are not available, the GLIBMM_EXCEPTIONS_ENABLED macro will not be defined.</p>
</div>
<div class="sect2" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="id2600132"></a>--enable-api-properties=no</h3></div></div></div>
<p>
When enable-api-properties is disabled, no property accessors will be available in the glibmm or gtkmm API. For instance, the <code class="function">Gtk::Button::property_label()</code> method will not be available. "getter" and "setter" methods, such as <code class="function">Gtk::Button::set_label()</code> will still be available.</p>
<p>When you really need to set or get the property value directly, for instance when using the <code class="classname">Gtk::CellRenderer</code> API, you can use the alternative <code class="function">set_property()</code> and <code class="function">get_property()</code> methods. For instance:</p>
<p>
</p>
<pre class="programlisting">
#ifdef GLIBMM_PROPERTIES_ENABLED
  m_cellrenderer.property_editable() = true;
#else
  m_cellrenderer.set_property("editable", true);
#endif
</pre>
<p>
</p>
<p>If property accessors are not available, the GLIBMM_PROPERTIES_ENABLED macro will not be defined.</p>
</div>
<div class="sect2" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="id2600198"></a>--enable-api-vfuncs=no</h3></div></div></div>
<p>
When enable-api-exceptions is disabled, no _vfunc virtual methods will be available in the glibmm or gtkmm API. These methods allow the developer to override some low-level behaviour of the underlying GTK+ objects, and they are therefore rarely used. For instance, <code class="function">Gtk::Frame::compute_child_allocation_vfunc()</code> will not be available.</p>
<p>However, if you really need to override a _vfunc, for instance when implementing a custom <code class="classname">Gtk::TreeModel</code>, you may directly access the underlying GObject via the <code class="function">gobj()</code> method.</p>
<p>If vfuncs are not available, the GLIBMM_VFUNCS_ENABLED macro will not be defined.</p>
</div>
<div class="sect2" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="id2600240"></a>--enable-api-default-signal-handlers=no</h3></div></div></div>
<p>
When enable-api-exceptions is disabled, no virtual signal handler methods will be available in the glibmm or gtkmm API. For instance, the <code class="function">Gtk::Button::on_clicked()</code> method will not be provided. Instead you must connect a signal handler by using the signal_clicked() accessor. This option offers a considerable code size and per-object memory reduction.</p>
<p>Note, however, that the compiler will not complain if you attempt to override a default signal handler when they are not supported by <span class="application">gtkmm</span>, because the compiler cannot know that you expected to override a virtual method.</p>
<p>If default signal handlers are not available, the GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED macro will not be defined.</p>
</div>
</div>
</div>
<div class="navfooter">
<hr>
<table width="100%" summary="Navigation footer">
<tr>
<td width="40%" align="left">
<a accesskey="p" href="aphs07.html"><img src="../icons/prev.png" alt="Prev"></a> </td>
<td width="20%" align="center"> </td>
<td width="40%" align="right"> <a accesskey="n" href="apis02.html"><img src="../icons/next.png" alt="Next"></a>
</td>
</tr>
<tr>
<td width="40%" align="left" valign="top">Documentation </td>
<td width="20%" align="center"><a accesskey="h" href="index.html"><img src="../icons/home.png" alt="Home"></a></td>
<td width="40%" align="right" valign="top"> Optional API when building gtkmm</td>
</tr>
</table>
</div>
</body>
</html>