/usr/share/doc/libgnomeprint2.2-doc/html/libgnomeprint-gnome-print-unit.html is in libgnomeprint2.2-doc 2.18.8-3ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>gnome-print-unit</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="index.html" title="GNOME Print Reference Manual">
<link rel="up" href="libgnomeprintunsorted.html" title="Part II. API Reference">
<link rel="prev" href="libgnomeprint-Pango-Integration.html" title="Pango Integration">
<link rel="next" href="libgnomeprint-gnome-rfont.html" title="gnome-rfont">
<meta name="generator" content="GTK-Doc V1.15.1 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</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="libgnomeprint-Pango-Integration.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="libgnomeprintunsorted.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">GNOME Print Reference Manual</th>
<td><a accesskey="n" href="libgnomeprint-gnome-rfont.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#libgnomeprint-gnome-print-unit.synopsis" class="shortcut">Top</a>
|
<a href="#libgnomeprint-gnome-print-unit.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry">
<a name="libgnomeprint-gnome-print-unit"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="libgnomeprint-gnome-print-unit.top_of_page"></a>gnome-print-unit</span></h2>
<p>gnome-print-unit</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="libgnomeprint-gnome-print-unit.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">struct <a class="link" href="libgnomeprint-gnome-print-unit.html#GnomePrintUnit" title="struct GnomePrintUnit">GnomePrintUnit</a>;
enum <a class="link" href="libgnomeprint-gnome-print-unit.html#GnomePrintUnitBase" title="enum GnomePrintUnitBase">GnomePrintUnitBase</a>;
#define <a class="link" href="libgnomeprint-gnome-print-unit.html#GNOME-PRINT-PS-UNIT:CAPS" title="GNOME_PRINT_PS_UNIT">GNOME_PRINT_PS_UNIT</a>
#define <a class="link" href="libgnomeprint-gnome-print-unit.html#GNOME-PRINT-UNITS-ALL:CAPS" title="GNOME_PRINT_UNITS_ALL">GNOME_PRINT_UNITS_ALL</a>
const <a class="link" href="libgnomeprint-gnome-print-unit.html#GnomePrintUnit" title="struct GnomePrintUnit"><span class="returnvalue">GnomePrintUnit</span></a> * <a class="link" href="libgnomeprint-gnome-print-unit.html#gnome-print-unit-get-identity" title="gnome_print_unit_get_identity ()">gnome_print_unit_get_identity</a> (<em class="parameter"><code><span class="type">guint</span> base</code></em>);
const <a class="link" href="libgnomeprint-gnome-print-unit.html#GnomePrintUnit" title="struct GnomePrintUnit"><span class="returnvalue">GnomePrintUnit</span></a> * <a class="link" href="libgnomeprint-gnome-print-unit.html#gnome-print-unit-get-default" title="gnome_print_unit_get_default ()">gnome_print_unit_get_default</a> (<em class="parameter"><code><span class="type">void</span></code></em>);
const <a class="link" href="libgnomeprint-gnome-print-unit.html#GnomePrintUnit" title="struct GnomePrintUnit"><span class="returnvalue">GnomePrintUnit</span></a> * <a class="link" href="libgnomeprint-gnome-print-unit.html#gnome-print-unit-get-by-name" title="gnome_print_unit_get_by_name ()">gnome_print_unit_get_by_name</a> (<em class="parameter"><code>const <span class="type">guchar</span> *name</code></em>);
const <a class="link" href="libgnomeprint-gnome-print-unit.html#GnomePrintUnit" title="struct GnomePrintUnit"><span class="returnvalue">GnomePrintUnit</span></a> * <a class="link" href="libgnomeprint-gnome-print-unit.html#gnome-print-unit-get-by-abbreviation" title="gnome_print_unit_get_by_abbreviation ()">gnome_print_unit_get_by_abbreviation</a>
(<em class="parameter"><code>const <span class="type">guchar</span> *abbreviation</code></em>);
<span class="returnvalue">GList</span> * <a class="link" href="libgnomeprint-gnome-print-unit.html#gnome-print-unit-get-list" title="gnome_print_unit_get_list ()">gnome_print_unit_get_list</a> (<em class="parameter"><code><span class="type">guint</span> bases</code></em>);
<span class="returnvalue">void</span> <a class="link" href="libgnomeprint-gnome-print-unit.html#gnome-print-unit-free-list" title="gnome_print_unit_free_list ()">gnome_print_unit_free_list</a> (<em class="parameter"><code><span class="type">GList</span> *units</code></em>);
<span class="returnvalue">gboolean</span> <a class="link" href="libgnomeprint-gnome-print-unit.html#gnome-print-convert-distance" title="gnome_print_convert_distance ()">gnome_print_convert_distance</a> (<em class="parameter"><code><span class="type">gdouble</span> *distance</code></em>,
<em class="parameter"><code>const <a class="link" href="libgnomeprint-gnome-print-unit.html#GnomePrintUnit" title="struct GnomePrintUnit"><span class="type">GnomePrintUnit</span></a> *from</code></em>,
<em class="parameter"><code>const <a class="link" href="libgnomeprint-gnome-print-unit.html#GnomePrintUnit" title="struct GnomePrintUnit"><span class="type">GnomePrintUnit</span></a> *to</code></em>);
<span class="returnvalue">gboolean</span> <a class="link" href="libgnomeprint-gnome-print-unit.html#gnome-print-convert-distance-full" title="gnome_print_convert_distance_full ()">gnome_print_convert_distance_full</a> (<em class="parameter"><code><span class="type">gdouble</span> *distance</code></em>,
<em class="parameter"><code>const <a class="link" href="libgnomeprint-gnome-print-unit.html#GnomePrintUnit" title="struct GnomePrintUnit"><span class="type">GnomePrintUnit</span></a> *from</code></em>,
<em class="parameter"><code>const <a class="link" href="libgnomeprint-gnome-print-unit.html#GnomePrintUnit" title="struct GnomePrintUnit"><span class="type">GnomePrintUnit</span></a> *to</code></em>,
<em class="parameter"><code><span class="type">gdouble</span> ctmscale</code></em>,
<em class="parameter"><code><span class="type">gdouble</span> devicescale</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="libgnomeprint-gnome-print-unit.description"></a><h2>Description</h2>
<p>
</p>
</div>
<div class="refsect1">
<a name="libgnomeprint-gnome-print-unit.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="GnomePrintUnit"></a><h3>struct GnomePrintUnit</h3>
<pre class="programlisting">struct GnomePrintUnit {
guint version : 8; /* Has to be 0 at moment */
guint base : 8; /* Base */
gdouble unittobase;
/* I am not absolutely sure, but seems that gettext can do the magic */
guchar *name;
guchar *abbr;
guchar *plural;
guchar *abbr_plural;
};
</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2">
<a name="GnomePrintUnitBase"></a><h3>enum GnomePrintUnitBase</h3>
<pre class="programlisting">typedef enum {
GNOME_PRINT_UNIT_DIMENSIONLESS = (1 << 0), /* For percentages and like */
GNOME_PRINT_UNIT_ABSOLUTE = (1 << 1), /* Real world distances - i.e. mm, cm... */
GNOME_PRINT_UNIT_DEVICE = (1 << 2), /* Semi-real device-dependent distances i.e. pixels */
GNOME_PRINT_UNIT_USERSPACE = (1 << 3) /* Mathematical coordinates */
} GnomePrintUnitBase;
</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2">
<a name="GNOME-PRINT-PS-UNIT:CAPS"></a><h3>GNOME_PRINT_PS_UNIT</h3>
<pre class="programlisting">#define GNOME_PRINT_PS_UNIT (gnome_print_unit_get_identity (GNOME_PRINT_UNIT_ABSOLUTE))
</pre>
<p>
The <a class="link" href="libgnomeprint-gnome-print-unit.html#GnomePrintUnit" title="struct GnomePrintUnit"><span class="type">GnomePrintUnit</span></a> structure that represents the absolute units.
</p>
</div>
<hr>
<div class="refsect2">
<a name="GNOME-PRINT-UNITS-ALL:CAPS"></a><h3>GNOME_PRINT_UNITS_ALL</h3>
<pre class="programlisting">#define GNOME_PRINT_UNITS_ALL (GNOME_PRINT_UNIT_DIMENSIONLESS | GNOME_PRINT_UNIT_ABSOLUTE | GNOME_PRINT_UNIT_DEVICE | GNOME_PRINT_UNIT_USERSPACE)
</pre>
<p>
Convenience macro for all of the different GNOME_PRINT_UNIT_* macros.
</p>
</div>
<hr>
<div class="refsect2">
<a name="gnome-print-unit-get-identity"></a><h3>gnome_print_unit_get_identity ()</h3>
<pre class="programlisting">const <a class="link" href="libgnomeprint-gnome-print-unit.html#GnomePrintUnit" title="struct GnomePrintUnit"><span class="returnvalue">GnomePrintUnit</span></a> * gnome_print_unit_get_identity (<em class="parameter"><code><span class="type">guint</span> base</code></em>);</pre>
<p>
Retrieves the <a class="link" href="libgnomeprint-gnome-print-unit.html#GnomePrintUnit" title="struct GnomePrintUnit"><span class="type">GnomePrintUnit</span></a> structure referenced by base <em class="parameter"><code>base</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>base</code></em> :</span></p></td>
<td>The base of the <a class="link" href="libgnomeprint-gnome-print-unit.html#GnomePrintUnit" title="struct GnomePrintUnit"><span class="type">GnomePrintUnit</span></a> to retrieve
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> The <a class="link" href="libgnomeprint-gnome-print-unit.html#GnomePrintUnit" title="struct GnomePrintUnit"><span class="type">GnomePrintUnit</span></a> structure representing <em class="parameter"><code>base</code></em>. <a href="../liboil/liboil-liboiljunk.html#NULL--CAPS"><code class="literal">NULL</code></a> on error
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gnome-print-unit-get-default"></a><h3>gnome_print_unit_get_default ()</h3>
<pre class="programlisting">const <a class="link" href="libgnomeprint-gnome-print-unit.html#GnomePrintUnit" title="struct GnomePrintUnit"><span class="returnvalue">GnomePrintUnit</span></a> * gnome_print_unit_get_default (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Used to get the default <a class="link" href="libgnomeprint-gnome-print-unit.html#GnomePrintUnit" title="struct GnomePrintUnit"><span class="type">GnomePrintUnit</span></a> structure.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> A pointer to the default <a class="link" href="libgnomeprint-gnome-print-unit.html#GnomePrintUnit" title="struct GnomePrintUnit"><span class="type">GnomePrintUnit</span></a> structure
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gnome-print-unit-get-by-name"></a><h3>gnome_print_unit_get_by_name ()</h3>
<pre class="programlisting">const <a class="link" href="libgnomeprint-gnome-print-unit.html#GnomePrintUnit" title="struct GnomePrintUnit"><span class="returnvalue">GnomePrintUnit</span></a> * gnome_print_unit_get_by_name (<em class="parameter"><code>const <span class="type">guchar</span> *name</code></em>);</pre>
<p>
Get a unit based on its name, for example "Millimeter" or "Inches".
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
<td>Name of the unit, as a string pointer
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> A constant pointer to a <a class="link" href="libgnomeprint-gnome-print-unit.html#GnomePrintUnit" title="struct GnomePrintUnit"><span class="type">GnomePrintUnit</span></a>, <a href="../liboil/liboil-liboiljunk.html#NULL--CAPS"><code class="literal">NULL</code></a> on error
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gnome-print-unit-get-by-abbreviation"></a><h3>gnome_print_unit_get_by_abbreviation ()</h3>
<pre class="programlisting">const <a class="link" href="libgnomeprint-gnome-print-unit.html#GnomePrintUnit" title="struct GnomePrintUnit"><span class="returnvalue">GnomePrintUnit</span></a> * gnome_print_unit_get_by_abbreviation
(<em class="parameter"><code>const <span class="type">guchar</span> *abbreviation</code></em>);</pre>
<p>
Get a unit based on its abbreviation, for example "cm" "pts" or "in".
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>abbreviation</code></em> :</span></p></td>
<td>Abbreviation of the unit, as a string pointer
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> A constant pointer to a GnomePrintUnit, <a href="../liboil/liboil-liboiljunk.html#NULL--CAPS"><code class="literal">NULL</code></a> on error
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gnome-print-unit-get-list"></a><h3>gnome_print_unit_get_list ()</h3>
<pre class="programlisting"><span class="returnvalue">GList</span> * gnome_print_unit_get_list (<em class="parameter"><code><span class="type">guint</span> bases</code></em>);</pre>
<p>
Gets a list of the units represented by the bases <em class="parameter"><code>bases</code></em>. To get
a list of all units then use <a class="link" href="libgnomeprint-gnome-print-unit.html#GNOME-PRINT-UNITS-ALL:CAPS" title="GNOME_PRINT_UNITS_ALL"><span class="type">GNOME_PRINT_UNITS_ALL</span></a>. The list that
is returned should be freed using <a class="link" href="libgnomeprint-gnome-print-unit.html#gnome-print-unit-free-list" title="gnome_print_unit_free_list ()"><span class="type">gnome_print_unit_free_list</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>bases</code></em> :</span></p></td>
<td>The bases to include in the list
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> A pointer to a <span class="type">GList</span>, <a href="../liboil/liboil-liboiljunk.html#NULL--CAPS"><code class="literal">NULL</code></a> on error
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gnome-print-unit-free-list"></a><h3>gnome_print_unit_free_list ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> gnome_print_unit_free_list (<em class="parameter"><code><span class="type">GList</span> *units</code></em>);</pre>
<p>
Used to free the list of units created by <a class="link" href="libgnomeprint-gnome-print-unit.html#gnome-print-unit-get-list" title="gnome_print_unit_get_list ()"><span class="type">gnome_print_unit_get_list</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>units</code></em> :</span></p></td>
<td>A pointer to a GList to be freed
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gnome-print-convert-distance"></a><h3>gnome_print_convert_distance ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span> gnome_print_convert_distance (<em class="parameter"><code><span class="type">gdouble</span> *distance</code></em>,
<em class="parameter"><code>const <a class="link" href="libgnomeprint-gnome-print-unit.html#GnomePrintUnit" title="struct GnomePrintUnit"><span class="type">GnomePrintUnit</span></a> *from</code></em>,
<em class="parameter"><code>const <a class="link" href="libgnomeprint-gnome-print-unit.html#GnomePrintUnit" title="struct GnomePrintUnit"><span class="type">GnomePrintUnit</span></a> *to</code></em>);</pre>
<p>
Check whether a conversion between <em class="parameter"><code>from</code></em> and <em class="parameter"><code>to</code></em> can be made
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>distance</code></em> :</span></p></td>
<td>The distance to convert, and the converted value on success
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>from</code></em> :</span></p></td>
<td>Units to convert from
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>to</code></em> :</span></p></td>
<td>Units to convert to
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <code class="literal">TRUE</code> if the conversion is possible, <code class="literal">FALSE</code> if
it is not or on error
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gnome-print-convert-distance-full"></a><h3>gnome_print_convert_distance_full ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span> gnome_print_convert_distance_full (<em class="parameter"><code><span class="type">gdouble</span> *distance</code></em>,
<em class="parameter"><code>const <a class="link" href="libgnomeprint-gnome-print-unit.html#GnomePrintUnit" title="struct GnomePrintUnit"><span class="type">GnomePrintUnit</span></a> *from</code></em>,
<em class="parameter"><code>const <a class="link" href="libgnomeprint-gnome-print-unit.html#GnomePrintUnit" title="struct GnomePrintUnit"><span class="type">GnomePrintUnit</span></a> *to</code></em>,
<em class="parameter"><code><span class="type">gdouble</span> ctmscale</code></em>,
<em class="parameter"><code><span class="type">gdouble</span> devicescale</code></em>);</pre>
<p>
Convert a distance from one unit to another. You should supply a scale
as necessary.
</p>
<p>
ctmscale is userspace->absolute, devicescale is device->absolute
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>distance</code></em> :</span></p></td>
<td>The distance to convert, and the result on success
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>from</code></em> :</span></p></td>
<td>Units to convert from
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>to</code></em> :</span></p></td>
<td>Units to convert to
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>ctmscale</code></em> :</span></p></td>
<td>The userspace scale to use
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>devicescale</code></em> :</span></p></td>
<td>The device scale to use
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <code class="literal">TRUE</code> if the conversion is possible, <code class="literal">FALSE</code> if
it is not or on error
</td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.15.1</div>
</body>
</html>
|