gtk3/docs/reference/libgail-util/html/gail-libgail-util3-GailTextUtil.html
2021-04-15 09:52:10 +01:00

355 lines
17 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GailTextUtil: GAIL Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="GAIL Reference Manual">
<link rel="up" href="libgail-util-main.html" title="GAIL libgail-util Library">
<link rel="prev" href="libgail-util-main.html" title="GAIL libgail-util Library">
<link rel="next" href="gail-libgail-util3-GailMisc.html" title="GailMisc">
<meta name="generator" content="GTK-Doc V1.33.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="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="#gail-libgail-util3-GailTextUtil.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="libgail-util-main.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="libgail-util-main.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="gail-libgail-util3-GailMisc.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="gail-libgail-util3-GailTextUtil"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gail-libgail-util3-GailTextUtil.top_of_page"></a>GailTextUtil</span></h2>
<p>GailTextUtil — GailTextUtil is a utility class which can be used to
implement some of the <a href="/usr/share/gtk-doc/html/atk/AtkText.html#AtkText-struct"><span class="type">AtkText</span></a> functions for accessible objects
which implement <a href="/usr/share/gtk-doc/html/atk/AtkText.html#AtkText-struct"><span class="type">AtkText</span></a>.</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="gail-libgail-util3-GailTextUtil.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_proto_type">
<col class="functions_proto_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<a class="link" href="gail-libgail-util3-GailTextUtil.html#GailTextUtil" title="struct GailTextUtil"><span class="returnvalue">GailTextUtil</span></a> *
</td>
<td class="function_name">
<a class="link" href="gail-libgail-util3-GailTextUtil.html#gail-text-util-new" title="gail_text_util_new ()">gail_text_util_new</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gail-libgail-util3-GailTextUtil.html#gail-text-util-text-setup" title="gail_text_util_text_setup ()">gail_text_util_text_setup</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gail-libgail-util3-GailTextUtil.html#gail-text-util-buffer-setup" title="gail_text_util_buffer_setup ()">gail_text_util_buffer_setup</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gchar</span> *
</td>
<td class="function_name">
<a class="link" href="gail-libgail-util3-GailTextUtil.html#gail-text-util-get-text" title="gail_text_util_get_text ()">gail_text_util_get_text</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gchar</span> *
</td>
<td class="function_name">
<a class="link" href="gail-libgail-util3-GailTextUtil.html#gail-text-util-get-substring" title="gail_text_util_get_substring ()">gail_text_util_get_substring</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="gail-libgail-util3-GailTextUtil.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="other_proto_type">
<col class="other_proto_name">
</colgroup>
<tbody>
<tr>
<td class="datatype_keyword">struct</td>
<td class="function_name"><a class="link" href="gail-libgail-util3-GailTextUtil.html#GailTextUtil" title="struct GailTextUtil">GailTextUtil</a></td>
</tr>
<tr>
<td class="datatype_keyword">enum</td>
<td class="function_name"><a class="link" href="gail-libgail-util3-GailTextUtil.html#GailOffsetType" title="enum GailOffsetType">GailOffsetType</a></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="gail-libgail-util3-GailTextUtil.description"></a><h2>Description</h2>
<p>GailTextUtil is a utility class which can be used to implement the
<a href="/usr/share/gtk-doc/html/atk/AtkText.html#AtkText-struct"><span class="type">AtkText</span></a> functions which get text for accessible objects which implement
<a href="/usr/share/gtk-doc/html/atk/AtkText.html#AtkText-struct"><span class="type">AtkText</span></a>.</p>
<p>In GAIL it is used by the accsesible objects for <span class="type">GnomeCanvasText</span>, <span class="type">GtkEntry</span>,
<span class="type">GtkLabel</span>, <span class="type">GtkCellRendererText</span> and <span class="type">GtkTextView</span>.</p>
</div>
<div class="refsect1">
<a name="gail-libgail-util3-GailTextUtil.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="gail-text-util-new"></a><h3>gail_text_util_new ()</h3>
<pre class="programlisting"><a class="link" href="gail-libgail-util3-GailTextUtil.html#GailTextUtil" title="struct GailTextUtil"><span class="returnvalue">GailTextUtil</span></a> *
gail_text_util_new (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>This function creates a new GailTextUtil object.</p>
<div class="refsect3">
<a name="gail-text-util-new.returns"></a><h4>Returns</h4>
<p> the GailTextUtil object</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gail-text-util-text-setup"></a><h3>gail_text_util_text_setup ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gail_text_util_text_setup (<em class="parameter"><code><a class="link" href="gail-libgail-util3-GailTextUtil.html#GailTextUtil" title="struct GailTextUtil"><span class="type">GailTextUtil</span></a> *textutil</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *text</code></em>);</pre>
<p>This function initializes the GailTextUtil with the specified character string,</p>
<div class="refsect3">
<a name="gail-text-util-text-setup.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>textutil</p></td>
<td class="parameter_description"><p>The <a class="link" href="gail-libgail-util3-GailTextUtil.html#GailTextUtil" title="struct GailTextUtil"><span class="type">GailTextUtil</span></a> to be initialized.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>text</p></td>
<td class="parameter_description"><p>A gchar* which points to the text to be stored in the GailTextUtil</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gail-text-util-buffer-setup"></a><h3>gail_text_util_buffer_setup ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gail_text_util_buffer_setup (<em class="parameter"><code><a class="link" href="gail-libgail-util3-GailTextUtil.html#GailTextUtil" title="struct GailTextUtil"><span class="type">GailTextUtil</span></a> *textutil</code></em>,
<em class="parameter"><code><span class="type">GtkTextBuffer</span> *buffer</code></em>);</pre>
<p>This function initializes the GailTextUtil with the specified GtkTextBuffer</p>
<div class="refsect3">
<a name="gail-text-util-buffer-setup.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>textutil</p></td>
<td class="parameter_description"><p>A <a class="link" href="gail-libgail-util3-GailTextUtil.html#GailTextUtil" title="struct GailTextUtil"><span class="type">GailTextUtil</span></a> to be initialized</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>buffer</p></td>
<td class="parameter_description"><p>The <span class="type">GtkTextBuffer</span> which identifies the text to be stored in the GailUtil.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gail-text-util-get-text"></a><h3>gail_text_util_get_text ()</h3>
<pre class="programlisting"><span class="returnvalue">gchar</span> *
gail_text_util_get_text (<em class="parameter"><code><a class="link" href="gail-libgail-util3-GailTextUtil.html#GailTextUtil" title="struct GailTextUtil"><span class="type">GailTextUtil</span></a> *textutil</code></em>,
<em class="parameter"><code><span class="type">gpointer</span> layout</code></em>,
<em class="parameter"><code><a class="link" href="gail-libgail-util3-GailTextUtil.html#GailOffsetType" title="enum GailOffsetType"><span class="type">GailOffsetType</span></a> function</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/atk/AtkText.html#AtkTextBoundary"><span class="type">AtkTextBoundary</span></a> boundary_type</code></em>,
<em class="parameter"><code><span class="type">gint</span> offset</code></em>,
<em class="parameter"><code><span class="type">gint</span> *start_offset</code></em>,
<em class="parameter"><code><span class="type">gint</span> *end_offset</code></em>);</pre>
<p>This function gets the requested substring from the text in the GtkTextUtil.
The layout is used only for getting the text on a line. The value is NULL
for a GtkTextView which is not wrapped, is a GtkTextView for a GtkTextView
which is wrapped and is a PangoLayout otherwise.</p>
<div class="refsect3">
<a name="gail-text-util-get-text.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>textutil</p></td>
<td class="parameter_description"><p>A <a class="link" href="gail-libgail-util3-GailTextUtil.html#GailTextUtil" title="struct GailTextUtil"><span class="type">GailTextUtil</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>layout</p></td>
<td class="parameter_description"><p>A gpointer which is a PangoLayout, a GtkTreeView of NULL</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>function</p></td>
<td class="parameter_description"><p>An enumeration specifying whether to return the text before, at, or
after the offset.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>boundary_type</p></td>
<td class="parameter_description"><p>The boundary type.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>offset</p></td>
<td class="parameter_description"><p>The offset of the text in the GailTextUtil </p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>start_offset</p></td>
<td class="parameter_description"><p>Address of location in which the start offset is returned</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>end_offset</p></td>
<td class="parameter_description"><p>Address of location in which the end offset is returned</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gail-text-util-get-text.returns"></a><h4>Returns</h4>
<p> the substring requested</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gail-text-util-get-substring"></a><h3>gail_text_util_get_substring ()</h3>
<pre class="programlisting"><span class="returnvalue">gchar</span> *
gail_text_util_get_substring (<em class="parameter"><code><a class="link" href="gail-libgail-util3-GailTextUtil.html#GailTextUtil" title="struct GailTextUtil"><span class="type">GailTextUtil</span></a> *textutil</code></em>,
<em class="parameter"><code><span class="type">gint</span> start_pos</code></em>,
<em class="parameter"><code><span class="type">gint</span> end_pos</code></em>);</pre>
<p>Gets the substring indicated by <em class="parameter"><code>start_pos</code></em>
and <em class="parameter"><code>end_pos</code></em>
</p>
<div class="refsect3">
<a name="gail-text-util-get-substring.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>textutil</p></td>
<td class="parameter_description"><p>A <a class="link" href="gail-libgail-util3-GailTextUtil.html#GailTextUtil" title="struct GailTextUtil"><span class="type">GailTextUtil</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>start_pos</p></td>
<td class="parameter_description"><p>The start position of the substring</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>end_pos</p></td>
<td class="parameter_description"><p>The end position of the substring.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gail-text-util-get-substring.returns"></a><h4>Returns</h4>
<p> the substring indicated by <em class="parameter"><code>start_pos</code></em>
and <em class="parameter"><code>end_pos</code></em>
</p>
</div>
</div>
</div>
<div class="refsect1">
<a name="gail-libgail-util3-GailTextUtil.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="GailTextUtil"></a><h3>struct GailTextUtil</h3>
<pre class="programlisting">struct GailTextUtil {
GObject parent;
GtkTextBuffer *buffer;
};
</pre>
</div>
<hr>
<div class="refsect2">
<a name="GailOffsetType"></a><h3>enum GailOffsetType</h3>
<p>Specifies which of the functions <a href="/usr/share/gtk-doc/html/atk/AtkText.html#atk-text-get-text-before-offset"><code class="function">atk_text_get_text_before_offset()</code></a>,
<a href="/usr/share/gtk-doc/html/atk/AtkText.html#atk-text-get-text-at-offset"><code class="function">atk_text_get_text_at_offset()</code></a>, <a href="/usr/share/gtk-doc/html/atk/AtkText.html#atk-text-get-text-after-offset"><code class="function">atk_text_get_text_after_offset()</code></a> the
function <a class="link" href="gail-libgail-util3-GailTextUtil.html#gail-text-util-get-text" title="gail_text_util_get_text ()"><code class="function">gail_text_util_get_text()</code></a> is being called for.</p>
<div class="refsect3">
<a name="GailOffsetType.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="enum_members_name">
<col class="enum_members_description">
<col width="200px" class="enum_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="enum_member_name"><p><a name="GAIL-BEFORE-OFFSET:CAPS"></a>GAIL_BEFORE_OFFSET</p></td>
<td class="enum_member_description">
<p>Text before offset is required.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GAIL-AT-OFFSET:CAPS"></a>GAIL_AT_OFFSET</p></td>
<td class="enum_member_description">
<p>Text at offset is required,</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GAIL-AFTER-OFFSET:CAPS"></a>GAIL_AFTER_OFFSET</p></td>
<td class="enum_member_description">
<p>Text after offset is required.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.33.1</div>
</body>
</html>