]> rtime.felk.cvut.cz Git - sojka/lightdm.git/commitdiff
add layouts property, expose it in vapi
authorMichael Terry <michael.terry@canonical.com>
Thu, 9 Feb 2012 19:42:45 +0000 (14:42 -0500)
committerMichael Terry <michael.terry@canonical.com>
Thu, 9 Feb 2012 19:42:45 +0000 (14:42 -0500)
liblightdm-gobject/liblightdm-gobject-1.vapi
liblightdm-gobject/user.c

index c35774d422205c39e23f9073e9296039df5d00e8..9c08b6821106daf6ea8d9aa5460e8ef7bc4796aa 100644 (file)
@@ -87,6 +87,8 @@ namespace LightDM {
         public unowned string image { get; }
         public unowned string language { get; }
         public unowned string layout { get; }
+        [CCode (array_length = false, array_null_terminated = true)]
+        public unowned string[] layouts { get; }
         public bool logged_in { get; }
         public unowned string name { get; }
         public unowned string real_name { get; }
index d47c05f6624078ea2d97df39ccca07e3fefc109f..b974f2adfaf38d860b421eb4f850d64e6e2cc81b 100644 (file)
@@ -38,6 +38,7 @@ enum
     USER_PROP_BACKGROUND,
     USER_PROP_LANGUAGE,
     USER_PROP_LAYOUT,
+    USER_PROP_LAYOUTS,
     USER_PROP_SESSION,
     USER_PROP_LOGGED_IN
 };
@@ -1322,7 +1323,7 @@ lightdm_user_get_layout (LightDMUser *user)
  * 
  * Get the configured keyboard layouts for a user.
  * 
- * Return value: A NULL-terminated array of keyboard layouts for the given user.  Copy the values if you want to use them long term.
+ * Return value: (transfer none): A NULL-terminated array of keyboard layouts for the given user.  Copy the values if you want to use them long term.
  **/
 const gchar * const *
 lightdm_user_get_layouts (LightDMUser *user)
@@ -1425,6 +1426,9 @@ lightdm_user_get_property (GObject    *object,
     case USER_PROP_LAYOUT:
         g_value_set_string (value, lightdm_user_get_layout (self));
         break;
+    case USER_PROP_LAYOUTS:
+        g_value_set_boxed (value, g_strdupv ((gchar **) lightdm_user_get_layouts (self)));
+        break;
     case USER_PROP_SESSION:
         g_value_set_string (value, lightdm_user_get_session (self));
         break;
@@ -1520,6 +1524,13 @@ lightdm_user_class_init (LightDMUserClass *klass)
                                                           "Keyboard layout used by this user",
                                                           NULL,
                                                           G_PARAM_READABLE));
+    g_object_class_install_property (object_class,
+                                     USER_PROP_LAYOUTS,
+                                     g_param_spec_boxed ("layouts",
+                                                         "layouts",
+                                                         "Keyboard layouts used by this user",
+                                                         G_TYPE_STRV,
+                                                         G_PARAM_READABLE));
     g_object_class_install_property (object_class,
                                      USER_PROP_SESSION,
                                      g_param_spec_string ("session",