/usr/share/gtk-doc/html/rhythmbox/rhythmbox-rb-text-helpers.html is in rhythmbox-doc 3.4.2-4ubuntu1.
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 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>rb-text-helpers: Rhythmbox Development Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="index.html" title="Rhythmbox Development Reference Manual">
<link rel="up" href="ch02.html" title="Lib">
<link rel="prev" href="rhythmbox-rb-util.html" title="rb-util">
<link rel="next" href="rhythmbox-rb-gst-media-types.html" title="rb-gst-media-types">
<meta name="generator" content="GTK-Doc V1.27 (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="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span>
<a href="#rhythmbox-rb-text-helpers.description" class="shortcut">Description</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="ch02.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="rhythmbox-rb-util.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="rhythmbox-rb-gst-media-types.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="rhythmbox-rb-text-helpers"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="rhythmbox-rb-text-helpers.top_of_page"></a>rb-text-helpers</span></h2>
<p>rb-text-helpers — text direction (LTR/RTL) functions</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="rhythmbox-rb-text-helpers.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_return">
<col class="functions_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="rhythmbox-rb-text-helpers.html#rb-text-direction-conflict" title="rb_text_direction_conflict ()">rb_text_direction_conflict</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../pango/pango-Bidirectional-Text.html#PangoDirection"><span class="returnvalue">PangoDirection</span></a>
</td>
<td class="function_name">
<a class="link" href="rhythmbox-rb-text-helpers.html#rb-text-common-direction" title="rb_text_common_direction ()">rb_text_common_direction</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">char</span> *
</td>
<td class="function_name">
<a class="link" href="rhythmbox-rb-text-helpers.html#rb-text-cat" title="rb_text_cat ()">rb_text_cat</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="rhythmbox-rb-text-helpers.description"></a><h2>Description</h2>
<p>Provides some helper functions for constructing strings that
may include both left-to-right and right-to-left text.</p>
</div>
<div class="refsect1">
<a name="rhythmbox-rb-text-helpers.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="rb-text-direction-conflict"></a><h3>rb_text_direction_conflict ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
rb_text_direction_conflict (<em class="parameter"><code><a href="../pango/pango-Bidirectional-Text.html#PangoDirection"><span class="type">PangoDirection</span></a> dir1</code></em>,
<em class="parameter"><code><a href="../pango/pango-Bidirectional-Text.html#PangoDirection"><span class="type">PangoDirection</span></a> dir2</code></em>);</pre>
<p>Direction conflict here means the two directions are defined (non-neutral)
and they are different.</p>
<div class="refsect3">
<a name="rb-text-direction-conflict.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>dir1</p></td>
<td class="parameter_description"><p>direction A</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>dir2</p></td>
<td class="parameter_description"><p>direction B</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="rb-text-direction-conflict.returns"></a><h4>Returns</h4>
<p> <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the two directions conflict.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="rb-text-common-direction"></a><h3>rb_text_common_direction ()</h3>
<pre class="programlisting"><a href="../pango/pango-Bidirectional-Text.html#PangoDirection"><span class="returnvalue">PangoDirection</span></a>
rb_text_common_direction (<em class="parameter"><code>const <span class="type">char</span> *first</code></em>,
<em class="parameter"><code>...</code></em>);</pre>
<p>This functions checks the direction of all given strings and:</p>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem"><p>If all strings are direction neutral, returns <a href="../pango/pango-Bidirectional-Text.html#PANGO-DIRECTION-NEUTRAL:CAPS"><code class="literal">PANGO_DIRECTION_NEUTRAL</code></a>;</p></li>
<li class="listitem"><p>If all strings are either LTR or neutral, returns <a href="../pango/pango-Bidirectional-Text.html#PANGO-DIRECTION-LTR:CAPS"><code class="literal">PANGO_DIRECTION_LTR</code></a>;</p></li>
<li class="listitem"><p>If all strings are either RTL or neutral, returns <a href="../pango/pango-Bidirectional-Text.html#PANGO-DIRECTION-RTL:CAPS"><code class="literal">PANGO_DIRECTION_RTL</code></a>;</p></li>
<li class="listitem"><p>If at least one is RTL and one LTR, returns <a href="../pango/pango-Bidirectional-Text.html#PANGO-DIRECTION-NEUTRAL:CAPS"><code class="literal">PANGO_DIRECTION_NEUTRAL</code></a>.</p></li>
</ol></div>
<p>Note: neutral (1) and mixed (4) are two very different situations,
they share a return code here only because they're the same for our
specific use.</p>
<div class="refsect3">
<a name="rb-text-common-direction.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>first</p></td>
<td class="parameter_description"><p>first string</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>...</p></td>
<td class="parameter_description"><p>rest of strings, terminated with <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="rb-text-common-direction.returns"></a><h4>Returns</h4>
<p> common direction of all strings, as defined above.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="rb-text-cat"></a><h3>rb_text_cat ()</h3>
<pre class="programlisting"><span class="returnvalue">char</span> *
rb_text_cat (<em class="parameter"><code><a href="../pango/pango-Bidirectional-Text.html#PangoDirection"><span class="type">PangoDirection</span></a> base_dir</code></em>,
<em class="parameter"><code>...</code></em>);</pre>
<p>This function concatenates strings to a single string, preserving
each part's original direction (LTR or RTL) using unicode markup,
as detailed here: http://unicode.org/reports/tr9/.</p>
<p>It is called like this:</p>
<p>s = rb_text_cat(base_dir, str1, format1, ..., strN, formatN, <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>)</p>
<p>Format is a printf format with exactly one %s. "%s" or "" will
insert the string as is.</p>
<p>Any string that is empty ("") will be skipped, its format must still be
passed.</p>
<p>A space is inserted between strings.</p>
<p>The algorithm:</p>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem"><p>Caller supplies the base direction of the result in base_dir.</p></li>
<li class="listitem"><p>Insert either LRM or RLM at the beginning of the string to set
its base direction, according to base_dir.</p></li>
<li class="listitem"><p>Find the direction of each string using pango.</p></li>
<li class="listitem"><p>For strings that have the same direction as the base direction,
just insert them in.</p></li>
<li class="listitem"><p>For strings that have the opposite direction than the base one,
insert them surrounded with embedding codes RLE/LRE .. PDF.</p></li>
</ol></div>
<div class="refsect3">
<a name="rb-text-cat.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>base_dir</p></td>
<td class="parameter_description"><p>direction of the result string.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>...</p></td>
<td class="parameter_description"><p>pairs of strings (content, format) terminated with <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="rb-text-cat.returns"></a><h4>Returns</h4>
<p> a new string containing the result.</p>
</div>
</div>
</div>
<div class="refsect1">
<a name="rhythmbox-rb-text-helpers.other_details"></a><h2>Types and Values</h2>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.27</div>
</body>
</html>
|