#define SIMPLE_ID "gtk-im-context-simple"
+/**
+ * GtkIMContextInfo:
+ * @context_id: The unique identification string of the input method.
+ * @context_name: The human-readable name of the input method.
+ * @domain: Translation domain to be used with dgettext()
+ * @domain_dirname: Name of locale directory for use with bindtextdomain()
+ * @default_locales: A colon-separated list of locales where this input method
+ * should be the default. The asterisk "*" sets the default for all locales.
+ *
+ * Bookkeeping information about a loadable input method.
+ */
+
typedef struct _GtkIMModule GtkIMModule;
typedef struct _GtkIMModuleClass GtkIMModuleClass;
im_module->library = g_module_open (im_module->path, G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL);
if (!im_module->library)
{
- g_warning (g_module_error());
+ g_warning ("%s", g_module_error());
return FALSE;
}
!g_module_symbol (im_module->library, "im_module_create",
(gpointer *)&im_module->create))
{
- g_warning (g_module_error());
+ g_warning ("%s", g_module_error());
g_module_close (im_module->library);
return FALSE;
* @n_contexts: the length of the array stored in @contexts
*
* List all available types of input method context
- **/
+ */
void
_gtk_im_module_list (const GtkIMContextInfo ***contexts,
guint *n_contexts)
* ID @context_id.
*
* Return value: a newly created input context of or @context_id, or
- * if that could not be created, a newly created GtkIMContextSimple.
- **/
+ * if that could not be created, a newly created GtkIMContextSimple.
+ */
GtkIMContext *
_gtk_im_module_create (const gchar *context_id)
{
* for the given window.
*
* Return value: the context ID (will never be %NULL)
- **/
+ */
const gchar *
_gtk_im_module_get_default_context_id (GdkWindow *client_window)
{
/* Check if the certain immodule is set in XSETTINGS.
*/
- if (client_window != NULL && GDK_IS_DRAWABLE (client_window))
+ if (GDK_IS_DRAWABLE (client_window))
{
screen = gdk_drawable_get_screen (GDK_DRAWABLE (client_window));
- if (screen)
- settings = gtk_settings_get_for_screen (screen);
- else
- settings = gtk_settings_get_default ();
-
+ settings = gtk_settings_get_for_screen (screen);
g_object_get (G_OBJECT (settings), "gtk-im-module", &tmp, NULL);
if (tmp)
{
if (strcmp (tmp, SIMPLE_ID) == 0)
context_id = SIMPLE_ID;
- else
+ else
{
GtkIMModule *module;
module = g_hash_table_lookup (contexts_hash, tmp);
}
g_free (tmp);
- if (context_id)
+ if (context_id)
return context_id;
}
}