<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
               "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY % local.common.attrib "xmlns:xi  CDATA  #FIXED 'http://www.w3.org/2003/XInclude'">
<!ENTITY version SYSTEM "version.xml">
<!ENTITY pi "&#960;">
<!ENTITY solidus "&#8260;">
]>
<refentry id="GtkIMContext">
<refmeta>
<refentrytitle role="top_of_page" id="GtkIMContext.top_of_page">GtkIMContext</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK4 Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>GtkIMContext</refname>
<refpurpose>Base class for input method contexts</refpurpose>
</refnamediv>

<refsect1 id="GtkIMContext.functions" role="functions_proto">
<title role="functions_proto.title">Functions</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="functions_proto_type" colwidth="150px"/>
<colspec colname="functions_proto_name"/>
<tbody>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-im-context-get-preedit-string">gtk_im_context_get_preedit_string</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-im-context-filter-keypress">gtk_im_context_filter_keypress</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-im-context-focus-in">gtk_im_context_focus_in</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-im-context-focus-out">gtk_im_context_focus_out</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-im-context-reset">gtk_im_context_reset</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-im-context-set-client-widget">gtk_im_context_set_client_widget</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-im-context-set-cursor-location">gtk_im_context_set_cursor_location</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-im-context-set-use-preedit">gtk_im_context_set_use_preedit</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-im-context-set-surrounding">gtk_im_context_set_surrounding</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-im-context-get-surrounding">gtk_im_context_get_surrounding</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-im-context-delete-surrounding">gtk_im_context_delete_surrounding</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkIMContext.properties" role="properties">
<title role="properties.title">Properties</title>
<informaltable frame="none">
<tgroup cols="3">
<colspec colname="properties_type" colwidth="150px"/>
<colspec colname="properties_name" colwidth="300px"/>
<colspec colname="properties_flags" colwidth="200px"/>
<tbody>
<row><entry role="property_type"><link linkend="GtkInputHints"><type>GtkInputHints</type></link></entry><entry role="property_name"><link linkend="GtkIMContext--input-hints">input-hints</link></entry><entry role="property_flags">Read / Write</entry></row>
<row><entry role="property_type"><link linkend="GtkInputPurpose"><type>GtkInputPurpose</type></link></entry><entry role="property_name"><link linkend="GtkIMContext--input-purpose">input-purpose</link></entry><entry role="property_flags">Read / Write</entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkIMContext.signals" role="signal_proto">
<title role="signal_proto.title">Signals</title>
<informaltable frame="none">
<tgroup cols="3">
<colspec colname="signal_proto_type" colwidth="150px"/>
<colspec colname="signal_proto_name" colwidth="300px"/>
<colspec colname="signal_proto_flags" colwidth="200px"/>
<tbody>
<row><entry role="signal_type"><link linkend="void"><returnvalue>void</returnvalue></link></entry><entry role="signal_name"><link linkend="GtkIMContext-commit">commit</link></entry><entry role="signal_flags"><link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></entry></row>
<row><entry role="signal_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link></entry><entry role="signal_name"><link linkend="GtkIMContext-delete-surrounding">delete-surrounding</link></entry><entry role="signal_flags"><link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></entry></row>
<row><entry role="signal_type"><link linkend="void"><returnvalue>void</returnvalue></link></entry><entry role="signal_name"><link linkend="GtkIMContext-preedit-changed">preedit-changed</link></entry><entry role="signal_flags"><link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></entry></row>
<row><entry role="signal_type"><link linkend="void"><returnvalue>void</returnvalue></link></entry><entry role="signal_name"><link linkend="GtkIMContext-preedit-end">preedit-end</link></entry><entry role="signal_flags"><link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></entry></row>
<row><entry role="signal_type"><link linkend="void"><returnvalue>void</returnvalue></link></entry><entry role="signal_name"><link linkend="GtkIMContext-preedit-start">preedit-start</link></entry><entry role="signal_flags"><link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></entry></row>
<row><entry role="signal_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link></entry><entry role="signal_name"><link linkend="GtkIMContext-retrieve-surrounding">retrieve-surrounding</link></entry><entry role="signal_flags"><link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkIMContext.other" role="other_proto">
<title role="other_proto.title">Types and Values</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="other_proto_type" colwidth="150px"/>
<colspec colname="other_proto_name"/>
<tbody>
<row><entry role="datatype_keyword">struct</entry><entry role="function_name"><link linkend="GtkIMContext-struct">GtkIMContext</link></entry></row>
<row><entry role="datatype_keyword">struct</entry><entry role="function_name"><link linkend="GtkIMContextClass">GtkIMContextClass</link></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkIMContext.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<screen>    <link linkend="GObject">GObject</link>
    <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> GtkIMContext
        <phrase role="lineart">&#9500;&#9472;&#9472;</phrase> <link linkend="GtkIMContextSimple">GtkIMContextSimple</link>
        <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> <link linkend="GtkIMMulticontext">GtkIMMulticontext</link>
</screen>
</refsect1>

<refsect1 id="GtkIMContext.includes"><title>Includes</title><synopsis>#include &lt;gtk/gtk.h&gt;
#include &lt;gtk/gtkimmodule.h&gt;
</synopsis></refsect1>

<refsect1 id="GtkIMContext.description" role="desc">
<title role="desc.title">Description</title>
<para><link linkend="GtkIMContext"><type>GtkIMContext</type></link> defines the interface for GTK+ input methods. An input method
is used by GTK+ text input widgets like <link linkend="GtkEntry"><type>GtkEntry</type></link> to map from key events to
Unicode character strings.</para>
<para>The default input method can be set programmatically via the 
<link linkend="GtkSettings--gtk-im-module"><type>“gtk-im-module”</type></link> GtkSettings property. Alternatively, you may set 
the GTK_IM_MODULE environment variable as documented in
<link linkend="gtk-running">Running GTK+ Applications</link>.</para>
<para>The <link linkend="GtkEntry"><type>GtkEntry</type></link> <link linkend="GtkEntry--im-module"><type>“im-module”</type></link> and <link linkend="GtkTextView"><type>GtkTextView</type></link> <link linkend="GtkTextView--im-module"><type>“im-module”</type></link> 
properties may also be used to set input methods for specific widget 
instances. For instance, a certain entry widget might be expected to contain 
certain characters which would be easier to input with a certain input 
method.</para>
<para>An input method may consume multiple key events in sequence and finally
output the composed result. This is called preediting, and an input method
may provide feedback about this process by displaying the intermediate
composition states as preedit text. For instance, the default GTK+ input
method implements the input of arbitrary Unicode code points by holding down
the Control and Shift keys and then typing “U” followed by the hexadecimal
digits of the code point.  When releasing the Control and Shift keys,
preediting ends and the character is inserted as text. Ctrl+Shift+u20AC for
example results in the € sign.</para>
<para>Additional input methods can be made available for use by GTK+ widgets as
loadable modules. An input method module is a small shared library which
implements a subclass of <link linkend="GtkIMContext"><type>GtkIMContext</type></link> or <link linkend="GtkIMContextSimple"><type>GtkIMContextSimple</type></link> and exports
these four functions:</para>
<informalexample><programlisting role="example"><![CDATA[
void im_module_init(GTypeModule *module);
]]></programlisting></informalexample>
<para>
This function should register the <link linkend="GType"><type>GType</type></link> of the <link linkend="GtkIMContext"><type>GtkIMContext</type></link> subclass which
implements the input method by means of <link linkend="g-type-module-register-type"><function>g_type_module_register_type()</function></link>. Note
that <link linkend="g-type-register-static"><function>g_type_register_static()</function></link> cannot be used as the type needs to be
registered dynamically.</para>
<informalexample><programlisting role="example"><![CDATA[
void im_module_exit(void);
]]></programlisting></informalexample>
<para>
Here goes any cleanup code your input method might require on module unload.</para>
<informalexample><programlisting role="example"><![CDATA[
void im_module_list(const GtkIMContextInfo ***contexts, int *n_contexts)
{
  *contexts = info_list;
  *n_contexts = G_N_ELEMENTS (info_list);
}
]]></programlisting></informalexample>
<para>
This function returns the list of input methods provided by the module. The
example implementation above shows a common solution and simply returns a
pointer to statically defined array of <link linkend="GtkIMContextInfo"><type>GtkIMContextInfo</type></link> items for each
provided input method.</para>
<informalexample><programlisting role="example"><![CDATA[
GtkIMContext * im_module_create(const gchar *context_id);
]]></programlisting></informalexample>
<para>
This function should return a pointer to a newly created instance of the
<link linkend="GtkIMContext"><type>GtkIMContext</type></link> subclass identified by <parameter>context_id</parameter>
. The context ID is the same
as specified in the <link linkend="GtkIMContextInfo"><type>GtkIMContextInfo</type></link> array returned by <link linkend="im-module-list"><function>im_module_list()</function></link>.</para>
<para>After a new loadable input method module has been installed on the system,
the configuration file <literal>gtk.immodules</literal> needs to be
regenerated by <link linkend="gtk-query-immodules-3.0">gtk-query-immodules-3.0</link>,
in order for the new input method to become available to GTK+ applications.</para>

</refsect1>
<refsect1 id="GtkIMContext.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="gtk-im-context-get-preedit-string" role="function">
<title>gtk_im_context_get_preedit_string&#160;()</title>
<indexterm zone="gtk-im-context-get-preedit-string"><primary>gtk_im_context_get_preedit_string</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_im_context_get_preedit_string (<parameter><link linkend="GtkIMContext"><type>GtkIMContext</type></link> *context</parameter>,
                                   <parameter><link linkend="gchar"><type>gchar</type></link> **str</parameter>,
                                   <parameter><link linkend="PangoAttrList"><type>PangoAttrList</type></link> **attrs</parameter>,
                                   <parameter><link linkend="gint"><type>gint</type></link> *cursor_pos</parameter>);</programlisting>
<para>Retrieve the current preedit string for the input context,
and a list of attributes to apply to the string.
This string should be displayed inserted at the insertion
point.</para>
<refsect3 id="gtk-im-context-get-preedit-string.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>context</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkIMContext"><type>GtkIMContext</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>str</para></entry>
<entry role="parameter_description"><para>location to store the retrieved
string. The string retrieved must be freed with <link linkend="g-free"><function>g_free()</function></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>][<acronym>transfer full</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>attrs</para></entry>
<entry role="parameter_description"><para>location to store the retrieved
attribute list.  When you are done with this list, you
must unreference it with <link linkend="pango-attr-list-unref"><function>pango_attr_list_unref()</function></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>][<acronym>transfer full</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>cursor_pos</para></entry>
<entry role="parameter_description"><para>location to store position of cursor (in characters)
within the preedit string. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-im-context-filter-keypress" role="function">
<title>gtk_im_context_filter_keypress&#160;()</title>
<indexterm zone="gtk-im-context-filter-keypress"><primary>gtk_im_context_filter_keypress</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gtk_im_context_filter_keypress (<parameter><link linkend="GtkIMContext"><type>GtkIMContext</type></link> *context</parameter>,
                                <parameter><link linkend="GdkEvent"><type>GdkEvent</type></link> *event</parameter>);</programlisting>
<para>Allow an input method to internally handle key press and release 
events. If this function returns <link linkend="TRUE:CAPS"><literal>TRUE</literal></link>, then no further processing
should be done for this key event.</para>
<refsect3 id="gtk-im-context-filter-keypress.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>context</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkIMContext"><type>GtkIMContext</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>event</para></entry>
<entry role="parameter_description"><para>the key event</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-im-context-filter-keypress.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the input method handled the key event.</para>
</refsect3></refsect2>
<refsect2 id="gtk-im-context-focus-in" role="function">
<title>gtk_im_context_focus_in&#160;()</title>
<indexterm zone="gtk-im-context-focus-in"><primary>gtk_im_context_focus_in</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_im_context_focus_in (<parameter><link linkend="GtkIMContext"><type>GtkIMContext</type></link> *context</parameter>);</programlisting>
<para>Notify the input method that the widget to which this
input context corresponds has gained focus. The input method
may, for example, change the displayed feedback to reflect
this change.</para>
<refsect3 id="gtk-im-context-focus-in.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>context</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkIMContext"><type>GtkIMContext</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-im-context-focus-out" role="function">
<title>gtk_im_context_focus_out&#160;()</title>
<indexterm zone="gtk-im-context-focus-out"><primary>gtk_im_context_focus_out</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_im_context_focus_out (<parameter><link linkend="GtkIMContext"><type>GtkIMContext</type></link> *context</parameter>);</programlisting>
<para>Notify the input method that the widget to which this
input context corresponds has lost focus. The input method
may, for example, change the displayed feedback or reset the contexts
state to reflect this change.</para>
<refsect3 id="gtk-im-context-focus-out.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>context</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkIMContext"><type>GtkIMContext</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-im-context-reset" role="function">
<title>gtk_im_context_reset&#160;()</title>
<indexterm zone="gtk-im-context-reset"><primary>gtk_im_context_reset</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_im_context_reset (<parameter><link linkend="GtkIMContext"><type>GtkIMContext</type></link> *context</parameter>);</programlisting>
<para>Notify the input method that a change such as a change in cursor
position has been made. This will typically cause the input
method to clear the preedit state.</para>
<refsect3 id="gtk-im-context-reset.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>context</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkIMContext"><type>GtkIMContext</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-im-context-set-client-widget" role="function">
<title>gtk_im_context_set_client_widget&#160;()</title>
<indexterm zone="gtk-im-context-set-client-widget"><primary>gtk_im_context_set_client_widget</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_im_context_set_client_widget (<parameter><link linkend="GtkIMContext"><type>GtkIMContext</type></link> *context</parameter>,
                                  <parameter><link linkend="GtkWidget"><type>GtkWidget</type></link> *widget</parameter>);</programlisting>
<para>Set the client window for the input context; this is the
<link linkend="GtkWidget"><type>GtkWidget</type></link> holding the input focus. This widget is
used in order to correctly position status windows, and may
also be used for purposes internal to the input method.</para>
<refsect3 id="gtk-im-context-set-client-widget.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>context</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkIMContext"><type>GtkIMContext</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>widget</para></entry>
<entry role="parameter_description"><para>the client widget. This may be <link linkend="NULL:CAPS"><literal>NULL</literal></link> to indicate
that the previous client widget no longer exists. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>allow-none</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-im-context-set-cursor-location" role="function">
<title>gtk_im_context_set_cursor_location&#160;()</title>
<indexterm zone="gtk-im-context-set-cursor-location"><primary>gtk_im_context_set_cursor_location</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_im_context_set_cursor_location (<parameter><link linkend="GtkIMContext"><type>GtkIMContext</type></link> *context</parameter>,
                                    <parameter>const <link linkend="GdkRectangle"><type>GdkRectangle</type></link> *area</parameter>);</programlisting>
<para>Notify the input method that a change in cursor 
position has been made. The location is relative to the client
window.</para>
<refsect3 id="gtk-im-context-set-cursor-location.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>context</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkIMContext"><type>GtkIMContext</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>area</para></entry>
<entry role="parameter_description"><para>new location</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-im-context-set-use-preedit" role="function">
<title>gtk_im_context_set_use_preedit&#160;()</title>
<indexterm zone="gtk-im-context-set-use-preedit"><primary>gtk_im_context_set_use_preedit</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_im_context_set_use_preedit (<parameter><link linkend="GtkIMContext"><type>GtkIMContext</type></link> *context</parameter>,
                                <parameter><link linkend="gboolean"><type>gboolean</type></link> use_preedit</parameter>);</programlisting>
<para>Sets whether the IM context should use the preedit string
to display feedback. If <parameter>use_preedit</parameter>
 is FALSE (default
is TRUE), then the IM context may use some other method to display
feedback, such as displaying it in a child of the root window.</para>
<refsect3 id="gtk-im-context-set-use-preedit.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>context</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkIMContext"><type>GtkIMContext</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>use_preedit</para></entry>
<entry role="parameter_description"><para>whether the IM context should use the preedit string.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-im-context-set-surrounding" role="function">
<title>gtk_im_context_set_surrounding&#160;()</title>
<indexterm zone="gtk-im-context-set-surrounding"><primary>gtk_im_context_set_surrounding</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_im_context_set_surrounding (<parameter><link linkend="GtkIMContext"><type>GtkIMContext</type></link> *context</parameter>,
                                <parameter>const <link linkend="gchar"><type>gchar</type></link> *text</parameter>,
                                <parameter><link linkend="gint"><type>gint</type></link> len</parameter>,
                                <parameter><link linkend="gint"><type>gint</type></link> cursor_index</parameter>);</programlisting>
<para>Sets surrounding context around the insertion point and preedit
string. This function is expected to be called in response to the
GtkIMContext::retrieve_surrounding signal, and will likely have no
effect if called at other times.</para>
<refsect3 id="gtk-im-context-set-surrounding.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>context</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkIMContext"><type>GtkIMContext</type></link> </para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>text</para></entry>
<entry role="parameter_description"><para>text surrounding the insertion point, as UTF-8.
the preedit string should not be included within
<parameter>text</parameter>
.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>len</para></entry>
<entry role="parameter_description"><para>the length of <parameter>text</parameter>
, or -1 if <parameter>text</parameter>
is nul-terminated</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>cursor_index</para></entry>
<entry role="parameter_description"><para>the byte index of the insertion cursor within <parameter>text</parameter>
.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-im-context-get-surrounding" role="function">
<title>gtk_im_context_get_surrounding&#160;()</title>
<indexterm zone="gtk-im-context-get-surrounding"><primary>gtk_im_context_get_surrounding</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gtk_im_context_get_surrounding (<parameter><link linkend="GtkIMContext"><type>GtkIMContext</type></link> *context</parameter>,
                                <parameter><link linkend="gchar"><type>gchar</type></link> **text</parameter>,
                                <parameter><link linkend="gint"><type>gint</type></link> *cursor_index</parameter>);</programlisting>
<para>Retrieves context around the insertion point. Input methods
typically want context in order to constrain input text based on
existing text; this is important for languages such as Thai where
only some sequences of characters are allowed.</para>
<para>This function is implemented by emitting the
GtkIMContext::retrieve_surrounding signal on the input method; in
response to this signal, a widget should provide as much context as
is available, up to an entire paragraph, by calling
<link linkend="gtk-im-context-set-surrounding"><function>gtk_im_context_set_surrounding()</function></link>. Note that there is no obligation
for a widget to respond to the ::retrieve_surrounding signal, so input
methods must be prepared to function without context.</para>
<refsect3 id="gtk-im-context-get-surrounding.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>context</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkIMContext"><type>GtkIMContext</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>text</para></entry>
<entry role="parameter_description"><para>location to store a UTF-8 encoded
string of text holding context around the insertion point.
If the function returns <link linkend="TRUE:CAPS"><literal>TRUE</literal></link>, then you must free the result
stored in this location with <link linkend="g-free"><function>g_free()</function></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>][<acronym>transfer full</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>cursor_index</para></entry>
<entry role="parameter_description"><para>location to store byte index of the insertion
cursor within <parameter>text</parameter>
. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-im-context-get-surrounding.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if surrounding text was provided; in this case
you must free the result stored in *text.</para>
</refsect3></refsect2>
<refsect2 id="gtk-im-context-delete-surrounding" role="function">
<title>gtk_im_context_delete_surrounding&#160;()</title>
<indexterm zone="gtk-im-context-delete-surrounding"><primary>gtk_im_context_delete_surrounding</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gtk_im_context_delete_surrounding (<parameter><link linkend="GtkIMContext"><type>GtkIMContext</type></link> *context</parameter>,
                                   <parameter><link linkend="gint"><type>gint</type></link> offset</parameter>,
                                   <parameter><link linkend="gint"><type>gint</type></link> n_chars</parameter>);</programlisting>
<para>Asks the widget that the input context is attached to to delete
characters around the cursor position by emitting the
GtkIMContext::delete_surrounding signal. Note that <parameter>offset</parameter>
 and <parameter>n_chars</parameter>

are in characters not in bytes which differs from the usage other
places in <link linkend="GtkIMContext"><type>GtkIMContext</type></link>.</para>
<para>In order to use this function, you should first call
<link linkend="gtk-im-context-get-surrounding"><function>gtk_im_context_get_surrounding()</function></link> to get the current context, and
call this function immediately afterwards to make sure that you
know what you are deleting. You should also account for the fact
that even if the signal was handled, the input context might not
have deleted all the characters that were requested to be deleted.</para>
<para>This function is used by an input method that wants to make
subsitutions in the existing text in response to new input. It is
not useful for applications.</para>
<refsect3 id="gtk-im-context-delete-surrounding.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>context</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkIMContext"><type>GtkIMContext</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>offset</para></entry>
<entry role="parameter_description"><para>offset from cursor position in chars;
a negative value means start before the cursor.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>n_chars</para></entry>
<entry role="parameter_description"><para>number of characters to delete.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-im-context-delete-surrounding.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the signal was handled.</para>
</refsect3></refsect2>

</refsect1>
<refsect1 id="GtkIMContext.other_details" role="details">
<title role="details.title">Types and Values</title>
<refsect2 id="GtkIMContext-struct" role="struct">
<title>struct GtkIMContext</title>
<indexterm zone="GtkIMContext-struct"><primary>GtkIMContext</primary></indexterm>
<programlisting language="C">struct GtkIMContext;</programlisting>
</refsect2>
<refsect2 id="GtkIMContextClass" role="struct">
<title>struct GtkIMContextClass</title>
<indexterm zone="GtkIMContextClass"><primary>GtkIMContextClass</primary></indexterm>
<programlisting language="C">struct GtkIMContextClass {
  /* Signals */
  void     (*preedit_start)        (GtkIMContext *context);
  void     (*preedit_end)          (GtkIMContext *context);
  void     (*preedit_changed)      (GtkIMContext *context);
  void     (*commit)               (GtkIMContext *context, const gchar *str);
  gboolean (*retrieve_surrounding) (GtkIMContext *context);
  gboolean (*delete_surrounding)   (GtkIMContext *context,
				    gint          offset,
				    gint          n_chars);

  /* Virtual functions */
  void     (*set_client_widget)   (GtkIMContext   *context,
				   GtkWidget      *widget);
  void     (*get_preedit_string)  (GtkIMContext   *context,
				   gchar         **str,
				   PangoAttrList **attrs,
				   gint           *cursor_pos);
  gboolean (*filter_keypress)     (GtkIMContext   *context,
			           GdkEvent       *event);
  void     (*focus_in)            (GtkIMContext   *context);
  void     (*focus_out)           (GtkIMContext   *context);
  void     (*reset)               (GtkIMContext   *context);
  void     (*set_cursor_location) (GtkIMContext   *context,
				   GdkRectangle   *area);
  void     (*set_use_preedit)     (GtkIMContext   *context,
				   gboolean        use_preedit);
  void     (*set_surrounding)     (GtkIMContext   *context,
				   const gchar    *text,
				   gint            len,
				   gint            cursor_index);
  gboolean (*get_surrounding)     (GtkIMContext   *context,
				   gchar         **text,
				   gint           *cursor_index);
};
</programlisting>
<refsect3 id="GtkIMContextClass.members" role="struct_members">
<title>Members</title>
<informaltable role="struct_members_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="struct_members_name" colwidth="300px"/>
<colspec colname="struct_members_description"/>
<colspec colname="struct_members_annotations" colwidth="200px"/>
<tbody>
<row role="member"><entry role="struct_member_name"><para><structfield id="GtkIMContextClass.preedit-start">preedit_start</structfield>&#160;()</para></entry>
<entry role="struct_member_description"><para>Default handler of the <link linkend="GtkIMContext-preedit-start"><type>“preedit-start”</type></link> signal.</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
<row role="member"><entry role="struct_member_name"><para><structfield id="GtkIMContextClass.preedit-end">preedit_end</structfield>&#160;()</para></entry>
<entry role="struct_member_description"><para>Default handler of the <link linkend="GtkIMContext-preedit-end"><type>“preedit-end”</type></link> signal.</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
<row role="member"><entry role="struct_member_name"><para><structfield id="GtkIMContextClass.preedit-changed">preedit_changed</structfield>&#160;()</para></entry>
<entry role="struct_member_description"><para>Default handler of the <link linkend="GtkIMContext-preedit-changed"><type>“preedit-changed”</type></link>
signal.</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
<row role="member"><entry role="struct_member_name"><para><structfield id="GtkIMContextClass.commit">commit</structfield>&#160;()</para></entry>
<entry role="struct_member_description"><para>Default handler of the <link linkend="GtkIMContext-commit"><type>“commit”</type></link> signal.</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
<row role="member"><entry role="struct_member_name"><para><structfield id="GtkIMContextClass.retrieve-surrounding">retrieve_surrounding</structfield>&#160;()</para></entry>
<entry role="struct_member_description"><para>Default handler of the
<link linkend="GtkIMContext-retrieve-surrounding"><type>“retrieve-surrounding”</type></link> signal.</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
<row role="member"><entry role="struct_member_name"><para><structfield id="GtkIMContextClass.delete-surrounding">delete_surrounding</structfield>&#160;()</para></entry>
<entry role="struct_member_description"><para>Default handler of the
<link linkend="GtkIMContext-delete-surrounding"><type>“delete-surrounding”</type></link> signal.</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
<row role="member"><entry role="struct_member_name"><para><structfield id="GtkIMContextClass.set-client-widget">set_client_widget</structfield>&#160;()</para></entry>
<entry role="struct_member_description"><para>Called via <link linkend="gtk-im-context-set-client-widget"><function>gtk_im_context_set_client_widget()</function></link> when the
input window where the entered text will appear changes. Override this to
keep track of the current input window, for instance for the purpose of
positioning a status display of your input method.</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
<row role="member"><entry role="struct_member_name"><para><structfield id="GtkIMContextClass.get-preedit-string">get_preedit_string</structfield>&#160;()</para></entry>
<entry role="struct_member_description"><para>Called via <link linkend="gtk-im-context-get-preedit-string"><function>gtk_im_context_get_preedit_string()</function></link> to
retrieve the text currently being preedited for display at the cursor
position. Any input method which composes complex characters or any
other compositions from multiple sequential key presses should override
this method to provide feedback.</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
<row role="member"><entry role="struct_member_name"><para><structfield id="GtkIMContextClass.filter-keypress">filter_keypress</structfield>&#160;()</para></entry>
<entry role="struct_member_description"><para>Called via <link linkend="gtk-im-context-filter-keypress"><function>gtk_im_context_filter_keypress()</function></link> on every
key press or release event. Every non-trivial input method needs to
override this in order to implement the mapping from key events to text.
A return value of <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> indicates to the caller that the event was
consumed by the input method. In that case, the <link linkend="GtkIMContext-commit"><type>“commit”</type></link>
signal should be emitted upon completion of a key sequence to pass the
resulting text back to the input widget. Alternatively, <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> may be
returned to indicate that the event wasn’t handled by the input method.
If a builtin mapping exists for the key, it is used to produce a
character.</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
<row role="member"><entry role="struct_member_name"><para><structfield id="GtkIMContextClass.focus-in">focus_in</structfield>&#160;()</para></entry>
<entry role="struct_member_description"><para>Called via <link linkend="gtk-im-context-focus-in"><function>gtk_im_context_focus_in()</function></link> when the input widget
has gained focus. May be overridden to keep track of the current focus.</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
<row role="member"><entry role="struct_member_name"><para><structfield id="GtkIMContextClass.focus-out">focus_out</structfield>&#160;()</para></entry>
<entry role="struct_member_description"><para>Called via <link linkend="gtk-im-context-focus-out"><function>gtk_im_context_focus_out()</function></link> when the input widget
has lost focus. May be overridden to keep track of the current focus.</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
<row role="member"><entry role="struct_member_name"><para><structfield id="GtkIMContextClass.reset">reset</structfield>&#160;()</para></entry>
<entry role="struct_member_description"><para>Called via <link linkend="gtk-im-context-reset"><function>gtk_im_context_reset()</function></link> to signal a change such as a
change in cursor position. An input method that implements preediting
should override this method to clear the preedit state on reset.</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
<row role="member"><entry role="struct_member_name"><para><structfield id="GtkIMContextClass.set-cursor-location">set_cursor_location</structfield>&#160;()</para></entry>
<entry role="struct_member_description"><para>Called via <link linkend="gtk-im-context-set-cursor-location"><function>gtk_im_context_set_cursor_location()</function></link>
to inform the input method of the current cursor location relative to
the client window. May be overridden to implement the display of popup
windows at the cursor position.</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
<row role="member"><entry role="struct_member_name"><para><structfield id="GtkIMContextClass.set-use-preedit">set_use_preedit</structfield>&#160;()</para></entry>
<entry role="struct_member_description"><para>Called via <link linkend="gtk-im-context-set-use-preedit"><function>gtk_im_context_set_use_preedit()</function></link> to control
the use of the preedit string. Override this to display feedback by some
other means if turned off.</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
<row role="member"><entry role="struct_member_name"><para><structfield id="GtkIMContextClass.set-surrounding">set_surrounding</structfield>&#160;()</para></entry>
<entry role="struct_member_description"><para>Called via <link linkend="gtk-im-context-set-surrounding"><function>gtk_im_context_set_surrounding()</function></link> in response
to signal <link linkend="GtkIMContext-retrieve-surrounding"><type>“retrieve-surrounding”</type></link> to update the input
method’s idea of the context around the cursor. It is not necessary to
override this method even with input methods which implement
context-dependent behavior. The base implementation is sufficient for
<link linkend="gtk-im-context-get-surrounding"><function>gtk_im_context_get_surrounding()</function></link> to work.</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
<row role="member"><entry role="struct_member_name"><para><structfield id="GtkIMContextClass.get-surrounding">get_surrounding</structfield>&#160;()</para></entry>
<entry role="struct_member_description"><para>Called via <link linkend="gtk-im-context-get-surrounding"><function>gtk_im_context_get_surrounding()</function></link> to update
the context around the cursor location. It is not necessary to override
this method even with input methods which implement context-dependent
behavior. The base implementation emits
<link linkend="GtkIMContext-retrieve-surrounding"><type>“retrieve-surrounding”</type></link> and records the context received
by the subsequent invocation of <parameter>get_surrounding</parameter>
.</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
</tbody></tgroup></informaltable>
</refsect3>
</refsect2>

</refsect1>
<refsect1 id="GtkIMContext.property-details" role="property_details">
<title role="property_details.title">Property Details</title>
<refsect2 id="GtkIMContext--input-hints" role="property"><title>The <literal>“input-hints”</literal> property</title>
<indexterm zone="GtkIMContext--input-hints"><primary>GtkIMContext:input-hints</primary></indexterm>
<programlisting>  “input-hints”              <link linkend="GtkInputHints"><type>GtkInputHints</type></link></programlisting>
<para>Hints for the text field behaviour.</para><para>Owner: GtkIMContext</para>
<para>Flags: Read / Write</para>
</refsect2>
<refsect2 id="GtkIMContext--input-purpose" role="property"><title>The <literal>“input-purpose”</literal> property</title>
<indexterm zone="GtkIMContext--input-purpose"><primary>GtkIMContext:input-purpose</primary></indexterm>
<programlisting>  “input-purpose”            <link linkend="GtkInputPurpose"><type>GtkInputPurpose</type></link></programlisting>
<para>Purpose of the text field.</para><para>Owner: GtkIMContext</para>
<para>Flags: Read / Write</para>
<para>Default value: GTK_INPUT_PURPOSE_FREE_FORM</para>
</refsect2>

</refsect1>
<refsect1 id="GtkIMContext.signal-details" role="signals">
<title role="signals.title">Signal Details</title>
<refsect2 id="GtkIMContext-commit" role="signal"><title>The <literal>“commit”</literal> signal</title>
<indexterm zone="GtkIMContext-commit"><primary>GtkIMContext::commit</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
user_function (<link linkend="GtkIMContext"><type>GtkIMContext</type></link> *context,
               <link linkend="gchar"><type>gchar</type></link>        *str,
               <link linkend="gpointer"><type>gpointer</type></link>      user_data)</programlisting>
<para>The ::commit signal is emitted when a complete input sequence
has been entered by the user. This can be a single character
immediately after a key press or the final result of preediting.</para>
<refsect3 id="GtkIMContext-commit.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>context</para></entry>
<entry role="parameter_description"><para>the object on which the signal is emitted</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>str</para></entry>
<entry role="parameter_description"><para>the completed character(s) entered by the user</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><simpara>user_data</simpara></entry>
<entry role="parameter_description"><simpara>user data set when the signal handler was connected.</simpara></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para>Flags: <link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></para>
</refsect2><refsect2 id="GtkIMContext-delete-surrounding" role="signal"><title>The <literal>“delete-surrounding”</literal> signal</title>
<indexterm zone="GtkIMContext-delete-surrounding"><primary>GtkIMContext::delete-surrounding</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
user_function (<link linkend="GtkIMContext"><type>GtkIMContext</type></link> *context,
               <link linkend="gint"><type>gint</type></link>          offset,
               <link linkend="gint"><type>gint</type></link>          n_chars,
               <link linkend="gpointer"><type>gpointer</type></link>      user_data)</programlisting>
<para>The ::delete-surrounding signal is emitted when the input method
needs to delete all or part of the context surrounding the cursor.</para>
<refsect3 id="GtkIMContext-delete-surrounding.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>context</para></entry>
<entry role="parameter_description"><para>the object on which the signal is emitted</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>offset</para></entry>
<entry role="parameter_description"><para>the character offset from the cursor position of the text
to be deleted. A negative value indicates a position before
the cursor.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>n_chars</para></entry>
<entry role="parameter_description"><para>the number of characters to be deleted</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><simpara>user_data</simpara></entry>
<entry role="parameter_description"><simpara>user data set when the signal handler was connected.</simpara></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GtkIMContext-delete-surrounding.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the signal was handled.</para>
</refsect3><para>Flags: <link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></para>
</refsect2><refsect2 id="GtkIMContext-preedit-changed" role="signal"><title>The <literal>“preedit-changed”</literal> signal</title>
<indexterm zone="GtkIMContext-preedit-changed"><primary>GtkIMContext::preedit-changed</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
user_function (<link linkend="GtkIMContext"><type>GtkIMContext</type></link> *context,
               <link linkend="gpointer"><type>gpointer</type></link>      user_data)</programlisting>
<para>The ::preedit-changed signal is emitted whenever the preedit sequence
currently being entered has changed.  It is also emitted at the end of
a preedit sequence, in which case
<link linkend="gtk-im-context-get-preedit-string"><function>gtk_im_context_get_preedit_string()</function></link> returns the empty string.</para>
<refsect3 id="GtkIMContext-preedit-changed.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>context</para></entry>
<entry role="parameter_description"><para>the object on which the signal is emitted</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><simpara>user_data</simpara></entry>
<entry role="parameter_description"><simpara>user data set when the signal handler was connected.</simpara></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para>Flags: <link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></para>
</refsect2><refsect2 id="GtkIMContext-preedit-end" role="signal"><title>The <literal>“preedit-end”</literal> signal</title>
<indexterm zone="GtkIMContext-preedit-end"><primary>GtkIMContext::preedit-end</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
user_function (<link linkend="GtkIMContext"><type>GtkIMContext</type></link> *context,
               <link linkend="gpointer"><type>gpointer</type></link>      user_data)</programlisting>
<para>The ::preedit-end signal is emitted when a preediting sequence
has been completed or canceled.</para>
<refsect3 id="GtkIMContext-preedit-end.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>context</para></entry>
<entry role="parameter_description"><para>the object on which the signal is emitted</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><simpara>user_data</simpara></entry>
<entry role="parameter_description"><simpara>user data set when the signal handler was connected.</simpara></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para>Flags: <link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></para>
</refsect2><refsect2 id="GtkIMContext-preedit-start" role="signal"><title>The <literal>“preedit-start”</literal> signal</title>
<indexterm zone="GtkIMContext-preedit-start"><primary>GtkIMContext::preedit-start</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
user_function (<link linkend="GtkIMContext"><type>GtkIMContext</type></link> *context,
               <link linkend="gpointer"><type>gpointer</type></link>      user_data)</programlisting>
<para>The ::preedit-start signal is emitted when a new preediting sequence
starts.</para>
<refsect3 id="GtkIMContext-preedit-start.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>context</para></entry>
<entry role="parameter_description"><para>the object on which the signal is emitted</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><simpara>user_data</simpara></entry>
<entry role="parameter_description"><simpara>user data set when the signal handler was connected.</simpara></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para>Flags: <link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></para>
</refsect2><refsect2 id="GtkIMContext-retrieve-surrounding" role="signal"><title>The <literal>“retrieve-surrounding”</literal> signal</title>
<indexterm zone="GtkIMContext-retrieve-surrounding"><primary>GtkIMContext::retrieve-surrounding</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
user_function (<link linkend="GtkIMContext"><type>GtkIMContext</type></link> *context,
               <link linkend="gpointer"><type>gpointer</type></link>      user_data)</programlisting>
<para>The ::retrieve-surrounding signal is emitted when the input method
requires the context surrounding the cursor.  The callback should set
the input method surrounding context by calling the
<link linkend="gtk-im-context-set-surrounding"><function>gtk_im_context_set_surrounding()</function></link> method.</para>
<refsect3 id="GtkIMContext-retrieve-surrounding.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>context</para></entry>
<entry role="parameter_description"><para>the object on which the signal is emitted</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><simpara>user_data</simpara></entry>
<entry role="parameter_description"><simpara>user data set when the signal handler was connected.</simpara></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GtkIMContext-retrieve-surrounding.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the signal was handled.</para>
</refsect3><para>Flags: <link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></para>
</refsect2>
</refsect1>

</refentry>
