本文整理汇总了C++中GtkIMContextClass::get_preedit_string方法的典型用法代码示例。如果您正苦于以下问题:C++ GtkIMContextClass::get_preedit_string方法的具体用法?C++ GtkIMContextClass::get_preedit_string怎么用?C++ GtkIMContextClass::get_preedit_string使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GtkIMContextClass
的用法示例。
在下文中一共展示了GtkIMContextClass::get_preedit_string方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
/**
* gtk_im_context_get_preedit_string:
* @context: a #GtkIMContext
* @str: (out) (transfer full): location to store the retrieved
* string. The string retrieved must be freed with g_free().
* @attrs: (out) (transfer full): location to store the retrieved
* attribute list. When you are done with this list, you
* must unreference it with pango_attr_list_unref().
* @cursor_pos: (out): location to store position of cursor (in characters)
* within the preedit string.
*
* 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.
**/
void
gtk_im_context_get_preedit_string (GtkIMContext *context,
gchar **str,
PangoAttrList **attrs,
gint *cursor_pos)
{
GtkIMContextClass *klass;
g_return_if_fail (GTK_IS_IM_CONTEXT (context));
klass = GTK_IM_CONTEXT_GET_CLASS (context);
klass->get_preedit_string (context, str, attrs, cursor_pos);
g_return_if_fail (str == NULL || g_utf8_validate (*str, -1, NULL));
}