📄 gtkimcontext.html
字号:
<td> location to store position of cursor (in characters) within the preedit string. </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id4392288"></a><h3><a name="gtk-im-context-filter-keypress"></a>gtk_im_context_filter_keypress ()</h3><a class="indexterm" name="id4392302"></a><pre class="programlisting"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> gtk_im_context_filter_keypress (<a class="link" href="GtkIMContext.html" title="GtkIMContext">GtkIMContext</a> *context, <ahref="/usr/share/gtk-doc/html/gdk/gdk-Event-Structures.html#GdkEventKey">GdkEventKey</a> *event);</pre><p>Allow an input method to internally handle key press and release events. If this function returns <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>, then no further processingshould be done for this key event.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td><td> a <a class="link" href="GtkIMContext.html" title="GtkIMContext"><span class="type">GtkIMContext</span></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>event</code></em> :</span></p></td><td> the key event</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the input method handled the key event.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id4392416"></a><h3><a name="gtk-im-context-focus-in"></a>gtk_im_context_focus_in ()</h3><a class="indexterm" name="id4392429"></a><pre class="programlisting">void gtk_im_context_focus_in (<a class="link" href="GtkIMContext.html" title="GtkIMContext">GtkIMContext</a> *context);</pre><p>Notify the input method that the widget to which thisinput context corresponds has gained focus. The input methodmay, for example, change the displayed feedback to reflectthis change.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td><td> a <a class="link" href="GtkIMContext.html" title="GtkIMContext"><span class="type">GtkIMContext</span></a></td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id4392491"></a><h3><a name="gtk-im-context-focus-out"></a>gtk_im_context_focus_out ()</h3><a class="indexterm" name="id4392504"></a><pre class="programlisting">void gtk_im_context_focus_out (<a class="link" href="GtkIMContext.html" title="GtkIMContext">GtkIMContext</a> *context);</pre><p>Notify the input method that the widget to which thisinput context corresponds has lost focus. The input methodmay, for example, change the displayed feedback or reset the contextsstate to reflect this change.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td><td> a <a class="link" href="GtkIMContext.html" title="GtkIMContext"><span class="type">GtkIMContext</span></a></td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id4392566"></a><h3><a name="gtk-im-context-reset"></a>gtk_im_context_reset ()</h3><a class="indexterm" name="id4392578"></a><pre class="programlisting">void gtk_im_context_reset (<a class="link" href="GtkIMContext.html" title="GtkIMContext">GtkIMContext</a> *context);</pre><p>Notify the input method that a change such as a change in cursorposition has been made. This will typically cause the inputmethod to clear the preedit state.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td><td> a <a class="link" href="GtkIMContext.html" title="GtkIMContext"><span class="type">GtkIMContext</span></a></td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id4392639"></a><h3><a name="gtk-im-context-set-cursor-location"></a>gtk_im_context_set_cursor_location ()</h3><a class="indexterm" name="id4392653"></a><pre class="programlisting">void gtk_im_context_set_cursor_location (<a class="link" href="GtkIMContext.html" title="GtkIMContext">GtkIMContext</a> *context, <ahref="/usr/share/gtk-doc/html/gdk/gdk-Points-Rectangles-and-Regions.html#GdkRectangle">GdkRectangle</a> *area);</pre><p>Notify the input method that a change in cursor position has been made. The location is relative to the clientwindow.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td><td> a <a class="link" href="GtkIMContext.html" title="GtkIMContext"><span class="type">GtkIMContext</span></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>area</code></em> :</span></p></td><td> new location</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id4392735"></a><h3><a name="gtk-im-context-set-use-preedit"></a>gtk_im_context_set_use_preedit ()</h3><a class="indexterm" name="id4392749"></a><pre class="programlisting">void gtk_im_context_set_use_preedit (<a class="link" href="GtkIMContext.html" title="GtkIMContext">GtkIMContext</a> *context, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> use_preedit);</pre><p>Sets whether the IM context should use the preedit stringto display feedback. If <em class="parameter"><code>use_preedit</code></em> is FALSE (defaultis TRUE), then the IM context may use some other method to displayfeedback, such as displaying it in a child of the root window.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td><td> a <a class="link" href="GtkIMContext.html" title="GtkIMContext"><span class="type">GtkIMContext</span></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>use_preedit</code></em> :</span></p></td><td> whether the IM context should use the preedit string.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id4392840"></a><h3><a name="gtk-im-context-set-surrounding"></a>gtk_im_context_set_surrounding ()</h3><a class="indexterm" name="id4392853"></a><pre class="programlisting">void gtk_im_context_set_surrounding (<a class="link" href="GtkIMContext.html" title="GtkIMContext">GtkIMContext</a> *context, const <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar">gchar</a> *text, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint">gint</a> len, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint">gint</a> cursor_index);</pre><p>Sets surrounding context around the insertion point and preeditstring. This function is expected to be called in response to theGtkIMContext::retrieve_surrounding signal, and will likely have noeffect if called at other times.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td><td> a <a class="link" href="GtkIMContext.html" title="GtkIMContext"><span class="type">GtkIMContext</span></a> </td></tr><tr><td><p><span class="term"><em class="parameter"><code>text</code></em> :</span></p></td><td> text surrounding the insertion point, as UTF-8. the preedit string should not be included within <em class="parameter"><code>text</code></em>.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>len</code></em> :</span></p></td><td> the length of <em class="parameter"><code>text</code></em>, or -1 if <em class="parameter"><code>text</code></em> is nul-terminated</td></tr><tr><td><p><span class="term"><em class="parameter"><code>cursor_index</code></em> :</span></p></td><td> the byte index of the insertion cursor within <em class="parameter"><code>text</code></em>.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id4393006"></a><h3><a name="gtk-im-context-get-surrounding"></a>gtk_im_context_get_surrounding ()</h3><a class="indexterm" name="id4393020"></a><pre class="programlisting"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> gtk_im_context_get_surrounding (<a class="link" href="GtkIMContext.html" title="GtkIMContext">GtkIMContext</a> *context, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar">gchar</a> **text, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint">gint</a> *cursor_index);</pre><p>Retrieves context around the insertion point. Input methodstypically want context in order to constrain input text based onexisting text; this is important for languages such as Thai whereonly some sequences of characters are allowed.</p><p>This function is implemented by emitting theGtkIMContext::retrieve_surrounding signal on the input method; inresponse to this signal, a widget should provide as much context asis available, up to an entire paragraph, by calling<a class="link" href="GtkIMContext.html#gtk-im-context-set-surrounding"><code class="function">gtk_im_context_set_surrounding()</code></a>. Note that there is no obligationfor a widget to respond to the ::retrieve_surrounding signal, so inputmethods must be prepared to function without context.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td><td> a <a class="link" href="GtkIMContext.html" title="GtkIMContext"><span class="type">GtkIMContext</span></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>text</code></em> :</span></p></td><td> location to store a UTF-8 encoded string of text holding context around the insertion point. If the function returns <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>, then you must free the result stored in this location with <ahref="/usr/share/gtk-doc/html/glib/glib-Memory-Allocation.html#g-free"><code class="function">g_free()</code></a>.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>cursor_index</code></em> :</span></p></td><td> location to store byte index of the insertion cursor within <em class="parameter"><code>text</code></em>.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -