]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkimmodule.c
Add GtkSpinner::animation-duration style property
[~andy/gtk] / gtk / gtkimmodule.c
index a8c9afb364c0c6cfe94456aaaf4d0dfc2e713784..49eb2abc00ed89f14fe0420b7fbe6db1c5967892 100644 (file)
 
 #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;
 
@@ -101,7 +113,7 @@ gtk_im_module_load (GTypeModule *module)
       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;
        }
   
@@ -115,7 +127,7 @@ gtk_im_module_load (GTypeModule *module)
          !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;
@@ -499,7 +511,7 @@ compare_gtkimcontextinfo_name(const GtkIMContextInfo **a,
  * @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)
@@ -577,8 +589,8 @@ _gtk_im_module_list (const GtkIMContextInfo ***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)
 {
@@ -646,7 +658,7 @@ match_locale (const gchar *locale,
  * 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)
 {
@@ -670,20 +682,16 @@ _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);
@@ -692,7 +700,7 @@ _gtk_im_module_get_default_context_id (GdkWindow *client_window)
             }
           g_free (tmp);
 
-                 if (context_id) 
+                 if (context_id)
             return context_id;
         }
     }