From 3730ae416dfd4373e2c5d38f35fab2dac3fc47bb Mon Sep 17 00:00:00 2001 From: Packit Service Date: Jan 27 2021 00:18:55 +0000 Subject: Prepare for a new update Reverting patches so we can apply the latest update and changes can be seen in the spec file and sources. --- diff --git a/data/meson.build b/data/meson.build index 5a2cd5a..e93ba64 100644 --- a/data/meson.build +++ b/data/meson.build @@ -4,7 +4,6 @@ schemas = [ 'org.gnome.settings-daemon.peripherals.gschema.xml', 'org.gnome.settings-daemon.peripherals.wacom.gschema.xml', 'org.gnome.settings-daemon.plugins.gschema.xml', - 'org.gnome.settings-daemon.plugins.account.gschema.xml', 'org.gnome.settings-daemon.plugins.color.gschema.xml', 'org.gnome.settings-daemon.plugins.housekeeping.gschema.xml', 'org.gnome.settings-daemon.plugins.media-keys.gschema.xml', diff --git a/data/org.gnome.settings-daemon.plugins.account.gschema.xml.in b/data/org.gnome.settings-daemon.plugins.account.gschema.xml.in deleted file mode 100644 index f3d59e8..0000000 --- a/data/org.gnome.settings-daemon.plugins.account.gschema.xml.in +++ /dev/null @@ -1,9 +0,0 @@ - - - - 1440 - Time before repeated warning about account password expiration - If a user's account is expiring, a notification will get displayed periodically after the specified number of minutes - - - diff --git a/meson.build b/meson.build index 1632ea0..a352d04 100644 --- a/meson.build +++ b/meson.build @@ -103,7 +103,6 @@ upower_glib_dep = dependency('upower-glib', version: '>= 0.99.0') x11_dep = dependency('x11') m_dep = cc.find_library('m') -dl_dep = cc.find_library('dl') # ALSA integration (default enabled) enable_alsa = get_option('alsa') diff --git a/plugins/account/Makefile.am b/plugins/account/Makefile.am deleted file mode 100644 index e06abcf..0000000 --- a/plugins/account/Makefile.am +++ /dev/null @@ -1,68 +0,0 @@ -plugin_name = account - -dbus_accounts_built_sources = org.freedesktop.Accounts.c org.freedesktop.Accounts.h -dbus_accounts_user_built_sources = org.freedesktop.Accounts.User.c org.freedesktop.Accounts.User.h - -BUILT_SOURCES = $(dbus_accounts_built_sources) \ - $(dbus_accounts_user_built_sources) - -libexec_PROGRAMS = gsd-account - -$(dbus_accounts_built_sources) : Makefile.am org.freedesktop.Accounts.xml - $(AM_V_GEN) gdbus-codegen \ - --interface-prefix org.freedesktop. \ - --c-namespace Gsd \ - --generate-c-code org.freedesktop.Accounts \ - --annotate "org.freedesktop.Accounts" \ - "org.gtk.GDBus.C.Name" Accounts \ - $(srcdir)/org.freedesktop.Accounts.xml - -$(dbus_accounts_user_built_sources) : Makefile.am org.freedesktop.Accounts.User.xml - $(AM_V_GEN) gdbus-codegen \ - --interface-prefix org.freedesktop. \ - --c-namespace Gsd \ - --generate-c-code org.freedesktop.Accounts.User \ - --annotate "org.freedesktop.Accounts.User" \ - "org.gtk.GDBus.C.Name" AccountsUser \ - $(srcdir)/org.freedesktop.Accounts.User.xml - -gsd_account_SOURCES = \ - main.c \ - gsd-account-manager.c \ - gsd-account-manager.h \ - $(COMMON_FILES) - -nodist_gsd_account_SOURCES = \ - $(dbus_accounts_built_sources) \ - $(dbus_accounts_user_built_sources) - -gsd_account_CPPFLAGS = \ - -I$(top_srcdir)/data/ \ - -I$(top_srcdir)/gnome-settings-daemon \ - -I$(top_builddir)/gnome-settings-daemon \ - -I$(top_srcdir)/plugins/common \ - -DGNOME_SETTINGS_LOCALEDIR=\""$(datadir)/locale"\" \ - -DLIBEXECDIR=\""$(libexecdir)"\" \ - $(AM_CPPFLAGS) - -gsd_account_CFLAGS = \ - $(PLUGIN_CFLAGS) \ - $(ACCOUNT_CFLAGS) - -gsd_account_LDADD = \ - $(top_builddir)/gnome-settings-daemon/libgsd.la \ - $(top_builddir)/plugins/common/libcommon.la \ - $(ACCOUNT_LIBS) - -desktopdir = $(sysconfdir)/xdg/autostart -desktop_in_files = org.gnome.SettingsDaemon.Account.desktop.in -desktop_DATA = $(desktop_in_files:.desktop.in=.desktop) - -org.gnome.SettingsDaemon.Account.desktop: $(desktop_in_files) Makefile - $(AM_V_GEN) sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@ - -EXTRA_DIST = $(desktop_in_files) - -CLEANFILES = $(desktop_DATA) - -DISTCLEANFILES = $(desktop_DATA) diff --git a/plugins/account/gsd-account-manager.c b/plugins/account/gsd-account-manager.c deleted file mode 100644 index b48c0fe..0000000 --- a/plugins/account/gsd-account-manager.c +++ /dev/null @@ -1,523 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- - * - * Copyright (C) 2017 Red Hat, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . - * - */ - -#include "config.h" - -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include - -#include -#include -#include - -#include "gnome-settings-profile.h" -#include "gnome-settings-bus.h" -#include "gsd-account-manager.h" -#include "org.freedesktop.Accounts.h" -#include "org.freedesktop.Accounts.User.h" - -#define GSD_ACCOUNT_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GSD_TYPE_ACCOUNT_MANAGER, GsdAccountManagerPrivate)) - -struct GsdAccountManagerPrivate -{ - GSettings *settings; - - GsdAccounts *accounts_proxy; - GsdAccountsUser *accounts_user_proxy; - GCancellable *cancellable; - - GsdScreenSaver *screensaver_proxy; - - gint64 expiration_time; - gint64 last_change_time; - gint64 min_days_between_changes; - gint64 max_days_between_changes; - gint64 days_to_warn; - gint64 days_after_expiration_until_lock; - - NotifyNotification *notification; - - gint64 last_notify_time; - int notify_period; - guint notify_period_timeout_id; -}; - -static void gsd_account_manager_class_init (GsdAccountManagerClass *klass); -static void gsd_account_manager_init (GsdAccountManager *account_manager); -static void gsd_account_manager_finalize (GObject *object); -static void fetch_password_expiration_policy (GsdAccountManager *manager); - -G_DEFINE_TYPE (GsdAccountManager, gsd_account_manager, G_TYPE_OBJECT) - -static gpointer manager_object = NULL; - -static void -on_notification_closed (NotifyNotification *notification, - gpointer user_data) -{ - GsdAccountManager *manager = user_data; - - g_clear_object (&manager->priv->notification); -} - -static void -hide_notification (GsdAccountManager *manager) -{ - if (manager->priv->notification == NULL) - return; - - notify_notification_close (manager->priv->notification, NULL); - g_clear_object (&manager->priv->notification); -} - -static void -show_notification (GsdAccountManager *manager, - const char *primary_text, - const char *secondary_text) -{ - g_assert (manager->priv->notification == NULL); - - manager->priv->notification = notify_notification_new (primary_text, - secondary_text, - "avatar-default-symbolic"); - notify_notification_set_app_name (manager->priv->notification, _("User Account")); - notify_notification_set_hint (manager->priv->notification, - "resident", - g_variant_new_boolean (TRUE)); - notify_notification_set_timeout (manager->priv->notification, - NOTIFY_EXPIRES_NEVER); - - g_signal_connect (manager->priv->notification, - "closed", - G_CALLBACK (on_notification_closed), - manager); - - notify_notification_show (manager->priv->notification, NULL); - - manager->priv->last_notify_time = g_get_monotonic_time (); -} - -static void -update_password_notification (GsdAccountManager *manager) -{ - gint64 days_since_epoch; - gint64 days_until_expiration = -1; - gint64 days_since_last_change = -1; - gint64 days_left = -1; - g_autofree char *primary_text = NULL; - g_autofree char *secondary_text = NULL; - gboolean password_already_expired = FALSE; - - hide_notification (manager); - - days_since_epoch = g_get_real_time () / G_USEC_PER_SEC / 60 / 60 / 24; - - if (manager->priv->expiration_time > 0) { - days_until_expiration = manager->priv->expiration_time - days_since_epoch; - - if (days_until_expiration <= 0) { - password_already_expired = TRUE; - goto out; - } - } - - if (manager->priv->last_change_time == 0) { - password_already_expired = TRUE; - goto out; - } - - days_since_last_change = days_since_epoch - manager->priv->last_change_time; - - if (days_since_last_change < 0) { - /* time skew, password was changed in the future! */ - goto out; - } - - if (manager->priv->max_days_between_changes > -1) { - if (manager->priv->days_after_expiration_until_lock > -1) { - if ((days_since_last_change > manager->priv->max_days_between_changes) && - (days_since_last_change > manager->priv->days_after_expiration_until_lock)) { - password_already_expired = TRUE; - goto out; - } - } - - if (days_since_last_change > manager->priv->max_days_between_changes) { - password_already_expired = TRUE; - goto out; - } - - if (manager->priv->days_to_warn > -1) { - if (days_since_last_change > manager->priv->max_days_between_changes - manager->priv->days_to_warn) { - days_left = manager->priv->last_change_time + manager->priv->max_days_between_changes - days_since_epoch; - - if (days_until_expiration >= 0) - days_left = MIN (days_left, days_until_expiration); - goto out; - } - } - } - -out: - if (password_already_expired) { - primary_text = g_strdup_printf (_("Password Expired")); - secondary_text = g_strdup_printf (_("Your password is expired. Please update it.")); - } else if (days_left >= 0) { - primary_text = g_strdup_printf (_("Password Expiring Soon")); - if (days_left == 0) - secondary_text = g_strdup_printf (_("Your password is expiring today.")); - else if (days_left == 1) - secondary_text = g_strdup_printf (_("Your password is expiring in a day.")); - else - secondary_text = g_strdup_printf (_("Your password is expiring in %ld days."), - days_left); - } - - if (primary_text != NULL && secondary_text != NULL) - show_notification (manager, - primary_text, - secondary_text); -} - -static gboolean -set_policy_number (gint64 *destination, - gint64 source) -{ - if (*destination == source) - return FALSE; - - *destination = source; - return TRUE; -} - -static gboolean -on_notify_period_elapsed (GsdAccountManager *manager) -{ - manager->priv->notify_period_timeout_id = 0; - fetch_password_expiration_policy (manager); - return G_SOURCE_REMOVE; -} - -static void -queue_periodic_timeout (GsdAccountManager *manager) -{ - if (manager->priv->notify_period_timeout_id != 0) { - g_source_remove (manager->priv->notify_period_timeout_id); - manager->priv->notify_period_timeout_id = 0; - } - - if (manager->priv->notify_period > 0) { - gint64 seconds_since_last_notification; - guint seconds_between_notifications; - guint seconds_until_next_notification; - - seconds_since_last_notification = MAX (0, (g_get_monotonic_time () - manager->priv->last_notify_time) / G_USEC_PER_SEC); - seconds_between_notifications = manager->priv->notify_period * 60; - - if (seconds_since_last_notification > seconds_between_notifications) - seconds_until_next_notification = seconds_between_notifications; - else - seconds_until_next_notification = seconds_between_notifications - seconds_since_last_notification; - - manager->priv->notify_period_timeout_id = g_timeout_add_seconds (seconds_until_next_notification, - (GSourceFunc) on_notify_period_elapsed, - manager); - } -} - -static void -on_got_password_expiration_policy (GsdAccountsUser *accounts_user_proxy, - GAsyncResult *res, - gpointer user_data) -{ - GsdAccountManager *manager = user_data; - g_autoptr(GError) error = NULL; - gboolean succeeded; - gint64 expiration_time; - gint64 last_change_time; - gint64 min_days_between_changes; - gint64 max_days_between_changes; - gint64 days_to_warn; - gint64 days_after_expiration_until_lock; - - gnome_settings_profile_start (NULL); - succeeded = gsd_accounts_user_call_get_password_expiration_policy_finish (accounts_user_proxy, - &expiration_time, - &last_change_time, - &min_days_between_changes, - &max_days_between_changes, - &days_to_warn, - &days_after_expiration_until_lock, - res, - &error); - - if (!succeeded) { - g_warning ("Failed to get password expiration policy for user: %s", error->message); - goto out; - } - - set_policy_number (&manager->priv->expiration_time, expiration_time); - set_policy_number (&manager->priv->last_change_time, last_change_time); - set_policy_number (&manager->priv->min_days_between_changes, min_days_between_changes); - set_policy_number (&manager->priv->max_days_between_changes, max_days_between_changes); - set_policy_number (&manager->priv->days_to_warn, days_to_warn); - set_policy_number (&manager->priv->days_after_expiration_until_lock, days_after_expiration_until_lock); - - update_password_notification (manager); - queue_periodic_timeout (manager); -out: - gnome_settings_profile_end (NULL); -} - -static void -fetch_password_expiration_policy (GsdAccountManager *manager) -{ - gsd_accounts_user_call_get_password_expiration_policy (manager->priv->accounts_user_proxy, - manager->priv->cancellable, - (GAsyncReadyCallback) - on_got_password_expiration_policy, - manager); -} - -static void -on_screensaver_signal (GDBusProxy *proxy, - const gchar *sender_name, - const gchar *signal_name, - GVariant *parameters, - gpointer user_data) -{ - GsdAccountManager *manager = user_data; - - if (g_strcmp0 (signal_name, "ActiveChanged") == 0) { - gboolean active; - - g_variant_get (parameters, "(b)", &active); - - if (!active) { - fetch_password_expiration_policy (manager); - } - } -} - -static void -on_got_accounts_user_proxy (GObject *source_object, - GAsyncResult *res, - gpointer user_data) -{ - GsdAccountManager *manager = user_data; - g_autoptr(GError) error = NULL; - - gnome_settings_profile_start (NULL); - manager->priv->accounts_user_proxy = gsd_accounts_user_proxy_new_finish (res, &error); - - if (manager->priv->accounts_user_proxy != NULL) { - fetch_password_expiration_policy (manager); - - manager->priv->screensaver_proxy = gnome_settings_bus_get_screen_saver_proxy (); - - g_signal_connect (manager->priv->screensaver_proxy, - "g-signal", - G_CALLBACK (on_screensaver_signal), - manager); - - } else { - g_warning ("Failed to get user proxy to accounts service: %s", error->message); - goto out; - } - -out: - gnome_settings_profile_end (NULL); -} - -static void -on_got_user_object_path (GsdAccounts *accounts_proxy, - GAsyncResult *res, - gpointer user_data) -{ - GsdAccountManager *manager = user_data; - g_autoptr(GError) error = NULL; - gboolean succeeded; - gchar *object_path; - GDBusConnection *connection; - - gnome_settings_profile_start (NULL); - - succeeded = gsd_accounts_call_find_user_by_id_finish (accounts_proxy, - &object_path, - res, - &error); - - if (!succeeded) { - g_warning ("Unable to find current user in accounts service: %s", - error->message); - goto out; - } - - connection = g_dbus_proxy_get_connection (G_DBUS_PROXY (accounts_proxy)); - gsd_accounts_user_proxy_new (connection, - G_DBUS_PROXY_FLAGS_NONE, - "org.freedesktop.Accounts", - object_path, - manager->priv->cancellable, - (GAsyncReadyCallback) - on_got_accounts_user_proxy, - manager); - -out: - gnome_settings_profile_end (NULL); -} - -static void -on_got_accounts_proxy (GObject *source_object, - GAsyncResult *res, - gpointer user_data) -{ - GsdAccountManager *manager = user_data; - g_autoptr(GError) error = NULL; - - gnome_settings_profile_start (NULL); - manager->priv->accounts_proxy = gsd_accounts_proxy_new_for_bus_finish (res, &error); - - if (manager->priv->accounts_proxy != NULL) { - gsd_accounts_call_find_user_by_id (manager->priv->accounts_proxy, - getuid (), - manager->priv->cancellable, - (GAsyncReadyCallback) - on_got_user_object_path, - manager); - } else { - g_warning ("Failed to get proxy to accounts service: %s", error->message); - } - gnome_settings_profile_end (NULL); -} - -static void -on_notify_period_changed (GsdAccountManager *manager) -{ - manager->priv->notify_period = g_settings_get_int (manager->priv->settings, "notify-period"); - - queue_periodic_timeout (manager); -} - -gboolean -gsd_account_manager_start (GsdAccountManager *manager, - GError **error) -{ - g_debug ("Starting accounts manager"); - - gnome_settings_profile_start (NULL); - manager->priv->cancellable = g_cancellable_new (); - manager->priv->settings = g_settings_new ("org.gnome.settings-daemon.plugins.account"); - - manager->priv->notify_period = g_settings_get_int (manager->priv->settings, "notify-period"); - g_signal_connect_object (G_OBJECT (manager->priv->settings), - "changed::notify-period", - G_CALLBACK (on_notify_period_changed), - manager, - G_CONNECT_SWAPPED); - - gsd_accounts_proxy_new_for_bus (G_BUS_TYPE_SYSTEM, - G_DBUS_PROXY_FLAGS_NONE, - "org.freedesktop.Accounts", - "/org/freedesktop/Accounts", - manager->priv->cancellable, - (GAsyncReadyCallback) - on_got_accounts_proxy, - manager); - gnome_settings_profile_end (NULL); - - return TRUE; -} - -void -gsd_account_manager_stop (GsdAccountManager *manager) -{ - g_debug ("Stopping accounts manager"); - - if (manager->priv->cancellable != NULL) { - g_cancellable_cancel (manager->priv->cancellable); - g_clear_object (&manager->priv->cancellable); - } - - g_clear_object (&manager->priv->settings); - g_clear_object (&manager->priv->accounts_proxy); - g_clear_object (&manager->priv->accounts_user_proxy); - g_clear_object (&manager->priv->notification); - g_clear_object (&manager->priv->screensaver_proxy); -} - -static void -gsd_account_manager_class_init (GsdAccountManagerClass *klass) -{ - GObjectClass *object_class = G_OBJECT_CLASS (klass); - - object_class->finalize = gsd_account_manager_finalize; - - notify_init ("gnome-settings-daemon"); - - g_type_class_add_private (klass, sizeof (GsdAccountManagerPrivate)); -} - -static void -gsd_account_manager_init (GsdAccountManager *manager) -{ - manager->priv = GSD_ACCOUNT_MANAGER_GET_PRIVATE (manager); -} - -static void -gsd_account_manager_finalize (GObject *object) -{ - GsdAccountManager *manager; - - g_return_if_fail (object != NULL); - g_return_if_fail (GSD_IS_ACCOUNT_MANAGER (object)); - - manager = GSD_ACCOUNT_MANAGER (object); - - g_return_if_fail (manager->priv != NULL); - - gsd_account_manager_stop (manager); - - G_OBJECT_CLASS (gsd_account_manager_parent_class)->finalize (object); -} - -GsdAccountManager * -gsd_account_manager_new (void) -{ - if (manager_object != NULL) { - g_object_ref (manager_object); - } else { - manager_object = g_object_new (GSD_TYPE_ACCOUNT_MANAGER, NULL); - g_object_add_weak_pointer (manager_object, - (gpointer *) &manager_object); - } - - return GSD_ACCOUNT_MANAGER (manager_object); -} diff --git a/plugins/account/gsd-account-manager.h b/plugins/account/gsd-account-manager.h deleted file mode 100644 index faefcc1..0000000 --- a/plugins/account/gsd-account-manager.h +++ /dev/null @@ -1,54 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- - * - * Copyright (C) 2017 Red Hat, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . - * - */ - -#ifndef __GSD_ACCOUNT_MANAGER_H -#define __GSD_ACCOUNT_MANAGER_H - -#include - -G_BEGIN_DECLS - -#define GSD_TYPE_ACCOUNT_MANAGER (gsd_account_manager_get_type ()) -#define GSD_ACCOUNT_MANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GSD_TYPE_ACCOUNT_MANAGER, GsdAccountManager)) -#define GSD_ACCOUNT_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GSD_TYPE_ACCOUNT_MANAGER, GsdAccountManagerClass)) -#define GSD_IS_ACCOUNT_MANAGER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSD_TYPE_ACCOUNT_MANAGER)) -#define GSD_IS_ACCOUNT_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GSD_TYPE_ACCOUNT_MANAGER)) -#define GSD_ACCOUNT_MANAGER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GSD_TYPE_ACCOUNT_MANAGER, GsdAccountManagerClass)) - -typedef struct GsdAccountManagerPrivate GsdAccountManagerPrivate; - -typedef struct { - GObject parent; - GsdAccountManagerPrivate *priv; -} GsdAccountManager; - -typedef struct { - GObjectClass parent_class; -} GsdAccountManagerClass; - -GType gsd_account_manager_get_type (void); - -GsdAccountManager * gsd_account_manager_new (void); -gboolean gsd_account_manager_start (GsdAccountManager *manager, - GError **error); -void gsd_account_manager_stop (GsdAccountManager *manager); - -G_END_DECLS - -#endif /* __GSD_ACCOUNT_MANAGER_H */ diff --git a/plugins/account/main.c b/plugins/account/main.c deleted file mode 100644 index 9b854f6..0000000 --- a/plugins/account/main.c +++ /dev/null @@ -1,7 +0,0 @@ -#define NEW gsd_account_manager_new -#define START gsd_account_manager_start -#define STOP gsd_account_manager_stop -#define MANAGER GsdAccountManager -#include "gsd-account-manager.h" - -#include "daemon-skeleton.h" diff --git a/plugins/account/meson.build b/plugins/account/meson.build deleted file mode 100644 index c70ac36..0000000 --- a/plugins/account/meson.build +++ /dev/null @@ -1,39 +0,0 @@ -sources = files( - 'gsd-account-manager.c', - 'main.c' -) - -sources += gnome.gdbus_codegen( - 'org.freedesktop.Accounts', - 'org.freedesktop.Accounts.xml', - interface_prefix: 'org.freedesktop.', - namespace: 'Gsd', - object_manager: false, - annotations: ['org.freedesktop.Accounts', 'org.gtk.GDBus.C.Name', 'Accounts'] -) - -sources += gnome.gdbus_codegen( - 'org.freedesktop.Accounts.User', - 'org.freedesktop.Accounts.User.xml', - interface_prefix: 'org.freedesktop.', - namespace: 'Gsd', - object_manager: false, - annotations: ['org.freedesktop.Accounts.User', 'org.gtk.GDBus.C.Name', 'AccountsUser'] -) - -deps = plugins_deps + [ - gio_unix_dep, - libnotify_dep, - nss_dep -] - -executable( - 'gsd-' + plugin_name, - sources, - include_directories: [top_inc, common_inc], - dependencies: deps, - c_args: cflags, - install: true, - install_rpath: gsd_pkglibdir, - install_dir: gsd_libexecdir -) diff --git a/plugins/account/org.freedesktop.Accounts.User.c b/plugins/account/org.freedesktop.Accounts.User.c deleted file mode 100644 index 3b18d18..0000000 --- a/plugins/account/org.freedesktop.Accounts.User.c +++ /dev/null @@ -1,6176 +0,0 @@ -/* - * Generated by gdbus-codegen 2.54.1. DO NOT EDIT. - * - * The license of this code is the same as for the source it was derived from. - */ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include "org.freedesktop.Accounts.User.h" - -#include -#ifdef G_OS_UNIX -# include -#endif - -typedef struct -{ - GDBusArgInfo parent_struct; - gboolean use_gvariant; -} _ExtendedGDBusArgInfo; - -typedef struct -{ - GDBusMethodInfo parent_struct; - const gchar *signal_name; - gboolean pass_fdlist; -} _ExtendedGDBusMethodInfo; - -typedef struct -{ - GDBusSignalInfo parent_struct; - const gchar *signal_name; -} _ExtendedGDBusSignalInfo; - -typedef struct -{ - GDBusPropertyInfo parent_struct; - const gchar *hyphen_name; - gboolean use_gvariant; -} _ExtendedGDBusPropertyInfo; - -typedef struct -{ - GDBusInterfaceInfo parent_struct; - const gchar *hyphen_name; -} _ExtendedGDBusInterfaceInfo; - -typedef struct -{ - const _ExtendedGDBusPropertyInfo *info; - guint prop_id; - GValue orig_value; /* the value before the change */ -} ChangedProperty; - -static void -_changed_property_free (ChangedProperty *data) -{ - g_value_unset (&data->orig_value); - g_free (data); -} - -static gboolean -_g_strv_equal0 (gchar **a, gchar **b) -{ - gboolean ret = FALSE; - guint n; - if (a == NULL && b == NULL) - { - ret = TRUE; - goto out; - } - if (a == NULL || b == NULL) - goto out; - if (g_strv_length (a) != g_strv_length (b)) - goto out; - for (n = 0; a[n] != NULL; n++) - if (g_strcmp0 (a[n], b[n]) != 0) - goto out; - ret = TRUE; -out: - return ret; -} - -static gboolean -_g_variant_equal0 (GVariant *a, GVariant *b) -{ - gboolean ret = FALSE; - if (a == NULL && b == NULL) - { - ret = TRUE; - goto out; - } - if (a == NULL || b == NULL) - goto out; - ret = g_variant_equal (a, b); -out: - return ret; -} - -G_GNUC_UNUSED static gboolean -_g_value_equal (const GValue *a, const GValue *b) -{ - gboolean ret = FALSE; - g_assert (G_VALUE_TYPE (a) == G_VALUE_TYPE (b)); - switch (G_VALUE_TYPE (a)) - { - case G_TYPE_BOOLEAN: - ret = (g_value_get_boolean (a) == g_value_get_boolean (b)); - break; - case G_TYPE_UCHAR: - ret = (g_value_get_uchar (a) == g_value_get_uchar (b)); - break; - case G_TYPE_INT: - ret = (g_value_get_int (a) == g_value_get_int (b)); - break; - case G_TYPE_UINT: - ret = (g_value_get_uint (a) == g_value_get_uint (b)); - break; - case G_TYPE_INT64: - ret = (g_value_get_int64 (a) == g_value_get_int64 (b)); - break; - case G_TYPE_UINT64: - ret = (g_value_get_uint64 (a) == g_value_get_uint64 (b)); - break; - case G_TYPE_DOUBLE: - { - /* Avoid -Wfloat-equal warnings by doing a direct bit compare */ - gdouble da = g_value_get_double (a); - gdouble db = g_value_get_double (b); - ret = memcmp (&da, &db, sizeof (gdouble)) == 0; - } - break; - case G_TYPE_STRING: - ret = (g_strcmp0 (g_value_get_string (a), g_value_get_string (b)) == 0); - break; - case G_TYPE_VARIANT: - ret = _g_variant_equal0 (g_value_get_variant (a), g_value_get_variant (b)); - break; - default: - if (G_VALUE_TYPE (a) == G_TYPE_STRV) - ret = _g_strv_equal0 (g_value_get_boxed (a), g_value_get_boxed (b)); - else - g_critical ("_g_value_equal() does not handle type %s", g_type_name (G_VALUE_TYPE (a))); - break; - } - return ret; -} - -/* ------------------------------------------------------------------------ - * Code for interface org.freedesktop.Accounts.User - * ------------------------------------------------------------------------ - */ - -/** - * SECTION:GsdAccountsUser - * @title: GsdAccountsUser - * @short_description: Generated C code for the org.freedesktop.Accounts.User D-Bus interface - * - * This section contains code for working with the org.freedesktop.Accounts.User D-Bus interface in C. - */ - -/* ---- Introspection data for org.freedesktop.Accounts.User ---- */ - -static const _ExtendedGDBusArgInfo _gsd_accounts_user_method_info_set_user_name_IN_ARG_name = -{ - { - -1, - (gchar *) "name", - (gchar *) "s", - NULL - }, - FALSE -}; - -static const _ExtendedGDBusArgInfo * const _gsd_accounts_user_method_info_set_user_name_IN_ARG_pointers[] = -{ - &_gsd_accounts_user_method_info_set_user_name_IN_ARG_name, - NULL -}; - -static const GDBusAnnotationInfo _gsd_accounts_user_method_set_user_name_annotation_info_0 = -{ - -1, - (gchar *) "org.freedesktop.DBus.GLib.Async", - (gchar *) "", - NULL -}; - -static const GDBusAnnotationInfo * const _gsd_accounts_user_method_set_user_name_annotation_info_pointers[] = -{ - &_gsd_accounts_user_method_set_user_name_annotation_info_0, - NULL -}; - -static const _ExtendedGDBusMethodInfo _gsd_accounts_user_method_info_set_user_name = -{ - { - -1, - (gchar *) "SetUserName", - (GDBusArgInfo **) &_gsd_accounts_user_method_info_set_user_name_IN_ARG_pointers, - NULL, - (GDBusAnnotationInfo **) &_gsd_accounts_user_method_set_user_name_annotation_info_pointers - }, - "handle-set-user-name", - FALSE -}; - -static const _ExtendedGDBusArgInfo _gsd_accounts_user_method_info_set_real_name_IN_ARG_name = -{ - { - -1, - (gchar *) "name", - (gchar *) "s", - NULL - }, - FALSE -}; - -static const _ExtendedGDBusArgInfo * const _gsd_accounts_user_method_info_set_real_name_IN_ARG_pointers[] = -{ - &_gsd_accounts_user_method_info_set_real_name_IN_ARG_name, - NULL -}; - -static const GDBusAnnotationInfo _gsd_accounts_user_method_set_real_name_annotation_info_0 = -{ - -1, - (gchar *) "org.freedesktop.DBus.GLib.Async", - (gchar *) "", - NULL -}; - -static const GDBusAnnotationInfo * const _gsd_accounts_user_method_set_real_name_annotation_info_pointers[] = -{ - &_gsd_accounts_user_method_set_real_name_annotation_info_0, - NULL -}; - -static const _ExtendedGDBusMethodInfo _gsd_accounts_user_method_info_set_real_name = -{ - { - -1, - (gchar *) "SetRealName", - (GDBusArgInfo **) &_gsd_accounts_user_method_info_set_real_name_IN_ARG_pointers, - NULL, - (GDBusAnnotationInfo **) &_gsd_accounts_user_method_set_real_name_annotation_info_pointers - }, - "handle-set-real-name", - FALSE -}; - -static const _ExtendedGDBusArgInfo _gsd_accounts_user_method_info_set_email_IN_ARG_email = -{ - { - -1, - (gchar *) "email", - (gchar *) "s", - NULL - }, - FALSE -}; - -static const _ExtendedGDBusArgInfo * const _gsd_accounts_user_method_info_set_email_IN_ARG_pointers[] = -{ - &_gsd_accounts_user_method_info_set_email_IN_ARG_email, - NULL -}; - -static const GDBusAnnotationInfo _gsd_accounts_user_method_set_email_annotation_info_0 = -{ - -1, - (gchar *) "org.freedesktop.DBus.GLib.Async", - (gchar *) "", - NULL -}; - -static const GDBusAnnotationInfo * const _gsd_accounts_user_method_set_email_annotation_info_pointers[] = -{ - &_gsd_accounts_user_method_set_email_annotation_info_0, - NULL -}; - -static const _ExtendedGDBusMethodInfo _gsd_accounts_user_method_info_set_email = -{ - { - -1, - (gchar *) "SetEmail", - (GDBusArgInfo **) &_gsd_accounts_user_method_info_set_email_IN_ARG_pointers, - NULL, - (GDBusAnnotationInfo **) &_gsd_accounts_user_method_set_email_annotation_info_pointers - }, - "handle-set-email", - FALSE -}; - -static const _ExtendedGDBusArgInfo _gsd_accounts_user_method_info_set_language_IN_ARG_language = -{ - { - -1, - (gchar *) "language", - (gchar *) "s", - NULL - }, - FALSE -}; - -static const _ExtendedGDBusArgInfo * const _gsd_accounts_user_method_info_set_language_IN_ARG_pointers[] = -{ - &_gsd_accounts_user_method_info_set_language_IN_ARG_language, - NULL -}; - -static const GDBusAnnotationInfo _gsd_accounts_user_method_set_language_annotation_info_0 = -{ - -1, - (gchar *) "org.freedesktop.DBus.GLib.Async", - (gchar *) "", - NULL -}; - -static const GDBusAnnotationInfo * const _gsd_accounts_user_method_set_language_annotation_info_pointers[] = -{ - &_gsd_accounts_user_method_set_language_annotation_info_0, - NULL -}; - -static const _ExtendedGDBusMethodInfo _gsd_accounts_user_method_info_set_language = -{ - { - -1, - (gchar *) "SetLanguage", - (GDBusArgInfo **) &_gsd_accounts_user_method_info_set_language_IN_ARG_pointers, - NULL, - (GDBusAnnotationInfo **) &_gsd_accounts_user_method_set_language_annotation_info_pointers - }, - "handle-set-language", - FALSE -}; - -static const _ExtendedGDBusArgInfo _gsd_accounts_user_method_info_set_xsession_IN_ARG_x_session = -{ - { - -1, - (gchar *) "x_session", - (gchar *) "s", - NULL - }, - FALSE -}; - -static const _ExtendedGDBusArgInfo * const _gsd_accounts_user_method_info_set_xsession_IN_ARG_pointers[] = -{ - &_gsd_accounts_user_method_info_set_xsession_IN_ARG_x_session, - NULL -}; - -static const GDBusAnnotationInfo _gsd_accounts_user_method_set_xsession_annotation_info_0 = -{ - -1, - (gchar *) "org.freedesktop.DBus.GLib.Async", - (gchar *) "", - NULL -}; - -static const GDBusAnnotationInfo _gsd_accounts_user_method_set_xsession_annotation_info_1 = -{ - -1, - (gchar *) "org.freedesktop.DBus.GLib.CSymbol", - (gchar *) "user_set_x_session", - NULL -}; - -static const GDBusAnnotationInfo * const _gsd_accounts_user_method_set_xsession_annotation_info_pointers[] = -{ - &_gsd_accounts_user_method_set_xsession_annotation_info_0, - &_gsd_accounts_user_method_set_xsession_annotation_info_1, - NULL -}; - -static const _ExtendedGDBusMethodInfo _gsd_accounts_user_method_info_set_xsession = -{ - { - -1, - (gchar *) "SetXSession", - (GDBusArgInfo **) &_gsd_accounts_user_method_info_set_xsession_IN_ARG_pointers, - NULL, - (GDBusAnnotationInfo **) &_gsd_accounts_user_method_set_xsession_annotation_info_pointers - }, - "handle-set-xsession", - FALSE -}; - -static const _ExtendedGDBusArgInfo _gsd_accounts_user_method_info_set_location_IN_ARG_location = -{ - { - -1, - (gchar *) "location", - (gchar *) "s", - NULL - }, - FALSE -}; - -static const _ExtendedGDBusArgInfo * const _gsd_accounts_user_method_info_set_location_IN_ARG_pointers[] = -{ - &_gsd_accounts_user_method_info_set_location_IN_ARG_location, - NULL -}; - -static const GDBusAnnotationInfo _gsd_accounts_user_method_set_location_annotation_info_0 = -{ - -1, - (gchar *) "org.freedesktop.DBus.GLib.Async", - (gchar *) "", - NULL -}; - -static const GDBusAnnotationInfo * const _gsd_accounts_user_method_set_location_annotation_info_pointers[] = -{ - &_gsd_accounts_user_method_set_location_annotation_info_0, - NULL -}; - -static const _ExtendedGDBusMethodInfo _gsd_accounts_user_method_info_set_location = -{ - { - -1, - (gchar *) "SetLocation", - (GDBusArgInfo **) &_gsd_accounts_user_method_info_set_location_IN_ARG_pointers, - NULL, - (GDBusAnnotationInfo **) &_gsd_accounts_user_method_set_location_annotation_info_pointers - }, - "handle-set-location", - FALSE -}; - -static const _ExtendedGDBusArgInfo _gsd_accounts_user_method_info_set_home_directory_IN_ARG_homedir = -{ - { - -1, - (gchar *) "homedir", - (gchar *) "s", - NULL - }, - FALSE -}; - -static const _ExtendedGDBusArgInfo * const _gsd_accounts_user_method_info_set_home_directory_IN_ARG_pointers[] = -{ - &_gsd_accounts_user_method_info_set_home_directory_IN_ARG_homedir, - NULL -}; - -static const GDBusAnnotationInfo _gsd_accounts_user_method_set_home_directory_annotation_info_0 = -{ - -1, - (gchar *) "org.freedesktop.DBus.GLib.Async", - (gchar *) "", - NULL -}; - -static const GDBusAnnotationInfo * const _gsd_accounts_user_method_set_home_directory_annotation_info_pointers[] = -{ - &_gsd_accounts_user_method_set_home_directory_annotation_info_0, - NULL -}; - -static const _ExtendedGDBusMethodInfo _gsd_accounts_user_method_info_set_home_directory = -{ - { - -1, - (gchar *) "SetHomeDirectory", - (GDBusArgInfo **) &_gsd_accounts_user_method_info_set_home_directory_IN_ARG_pointers, - NULL, - (GDBusAnnotationInfo **) &_gsd_accounts_user_method_set_home_directory_annotation_info_pointers - }, - "handle-set-home-directory", - FALSE -}; - -static const _ExtendedGDBusArgInfo _gsd_accounts_user_method_info_set_shell_IN_ARG_shell = -{ - { - -1, - (gchar *) "shell", - (gchar *) "s", - NULL - }, - FALSE -}; - -static const _ExtendedGDBusArgInfo * const _gsd_accounts_user_method_info_set_shell_IN_ARG_pointers[] = -{ - &_gsd_accounts_user_method_info_set_shell_IN_ARG_shell, - NULL -}; - -static const GDBusAnnotationInfo _gsd_accounts_user_method_set_shell_annotation_info_0 = -{ - -1, - (gchar *) "org.freedesktop.DBus.GLib.Async", - (gchar *) "", - NULL -}; - -static const GDBusAnnotationInfo * const _gsd_accounts_user_method_set_shell_annotation_info_pointers[] = -{ - &_gsd_accounts_user_method_set_shell_annotation_info_0, - NULL -}; - -static const _ExtendedGDBusMethodInfo _gsd_accounts_user_method_info_set_shell = -{ - { - -1, - (gchar *) "SetShell", - (GDBusArgInfo **) &_gsd_accounts_user_method_info_set_shell_IN_ARG_pointers, - NULL, - (GDBusAnnotationInfo **) &_gsd_accounts_user_method_set_shell_annotation_info_pointers - }, - "handle-set-shell", - FALSE -}; - -static const _ExtendedGDBusArgInfo _gsd_accounts_user_method_info_set_icon_file_IN_ARG_filename = -{ - { - -1, - (gchar *) "filename", - (gchar *) "s", - NULL - }, - FALSE -}; - -static const _ExtendedGDBusArgInfo * const _gsd_accounts_user_method_info_set_icon_file_IN_ARG_pointers[] = -{ - &_gsd_accounts_user_method_info_set_icon_file_IN_ARG_filename, - NULL -}; - -static const GDBusAnnotationInfo _gsd_accounts_user_method_set_icon_file_annotation_info_0 = -{ - -1, - (gchar *) "org.freedesktop.DBus.GLib.Async", - (gchar *) "", - NULL -}; - -static const GDBusAnnotationInfo * const _gsd_accounts_user_method_set_icon_file_annotation_info_pointers[] = -{ - &_gsd_accounts_user_method_set_icon_file_annotation_info_0, - NULL -}; - -static const _ExtendedGDBusMethodInfo _gsd_accounts_user_method_info_set_icon_file = -{ - { - -1, - (gchar *) "SetIconFile", - (GDBusArgInfo **) &_gsd_accounts_user_method_info_set_icon_file_IN_ARG_pointers, - NULL, - (GDBusAnnotationInfo **) &_gsd_accounts_user_method_set_icon_file_annotation_info_pointers - }, - "handle-set-icon-file", - FALSE -}; - -static const _ExtendedGDBusArgInfo _gsd_accounts_user_method_info_set_locked_IN_ARG_locked = -{ - { - -1, - (gchar *) "locked", - (gchar *) "b", - NULL - }, - FALSE -}; - -static const _ExtendedGDBusArgInfo * const _gsd_accounts_user_method_info_set_locked_IN_ARG_pointers[] = -{ - &_gsd_accounts_user_method_info_set_locked_IN_ARG_locked, - NULL -}; - -static const GDBusAnnotationInfo _gsd_accounts_user_method_set_locked_annotation_info_0 = -{ - -1, - (gchar *) "org.freedesktop.DBus.GLib.Async", - (gchar *) "", - NULL -}; - -static const GDBusAnnotationInfo * const _gsd_accounts_user_method_set_locked_annotation_info_pointers[] = -{ - &_gsd_accounts_user_method_set_locked_annotation_info_0, - NULL -}; - -static const _ExtendedGDBusMethodInfo _gsd_accounts_user_method_info_set_locked = -{ - { - -1, - (gchar *) "SetLocked", - (GDBusArgInfo **) &_gsd_accounts_user_method_info_set_locked_IN_ARG_pointers, - NULL, - (GDBusAnnotationInfo **) &_gsd_accounts_user_method_set_locked_annotation_info_pointers - }, - "handle-set-locked", - FALSE -}; - -static const _ExtendedGDBusArgInfo _gsd_accounts_user_method_info_set_account_type_IN_ARG_accountType = -{ - { - -1, - (gchar *) "accountType", - (gchar *) "i", - NULL - }, - FALSE -}; - -static const _ExtendedGDBusArgInfo * const _gsd_accounts_user_method_info_set_account_type_IN_ARG_pointers[] = -{ - &_gsd_accounts_user_method_info_set_account_type_IN_ARG_accountType, - NULL -}; - -static const GDBusAnnotationInfo _gsd_accounts_user_method_set_account_type_annotation_info_0 = -{ - -1, - (gchar *) "org.freedesktop.DBus.GLib.Async", - (gchar *) "", - NULL -}; - -static const GDBusAnnotationInfo * const _gsd_accounts_user_method_set_account_type_annotation_info_pointers[] = -{ - &_gsd_accounts_user_method_set_account_type_annotation_info_0, - NULL -}; - -static const _ExtendedGDBusMethodInfo _gsd_accounts_user_method_info_set_account_type = -{ - { - -1, - (gchar *) "SetAccountType", - (GDBusArgInfo **) &_gsd_accounts_user_method_info_set_account_type_IN_ARG_pointers, - NULL, - (GDBusAnnotationInfo **) &_gsd_accounts_user_method_set_account_type_annotation_info_pointers - }, - "handle-set-account-type", - FALSE -}; - -static const _ExtendedGDBusArgInfo _gsd_accounts_user_method_info_set_password_mode_IN_ARG_mode = -{ - { - -1, - (gchar *) "mode", - (gchar *) "i", - NULL - }, - FALSE -}; - -static const _ExtendedGDBusArgInfo * const _gsd_accounts_user_method_info_set_password_mode_IN_ARG_pointers[] = -{ - &_gsd_accounts_user_method_info_set_password_mode_IN_ARG_mode, - NULL -}; - -static const GDBusAnnotationInfo _gsd_accounts_user_method_set_password_mode_annotation_info_0 = -{ - -1, - (gchar *) "org.freedesktop.DBus.GLib.Async", - (gchar *) "", - NULL -}; - -static const GDBusAnnotationInfo * const _gsd_accounts_user_method_set_password_mode_annotation_info_pointers[] = -{ - &_gsd_accounts_user_method_set_password_mode_annotation_info_0, - NULL -}; - -static const _ExtendedGDBusMethodInfo _gsd_accounts_user_method_info_set_password_mode = -{ - { - -1, - (gchar *) "SetPasswordMode", - (GDBusArgInfo **) &_gsd_accounts_user_method_info_set_password_mode_IN_ARG_pointers, - NULL, - (GDBusAnnotationInfo **) &_gsd_accounts_user_method_set_password_mode_annotation_info_pointers - }, - "handle-set-password-mode", - FALSE -}; - -static const _ExtendedGDBusArgInfo _gsd_accounts_user_method_info_set_password_IN_ARG_password = -{ - { - -1, - (gchar *) "password", - (gchar *) "s", - NULL - }, - FALSE -}; - -static const _ExtendedGDBusArgInfo _gsd_accounts_user_method_info_set_password_IN_ARG_hint = -{ - { - -1, - (gchar *) "hint", - (gchar *) "s", - NULL - }, - FALSE -}; - -static const _ExtendedGDBusArgInfo * const _gsd_accounts_user_method_info_set_password_IN_ARG_pointers[] = -{ - &_gsd_accounts_user_method_info_set_password_IN_ARG_password, - &_gsd_accounts_user_method_info_set_password_IN_ARG_hint, - NULL -}; - -static const GDBusAnnotationInfo _gsd_accounts_user_method_set_password_annotation_info_0 = -{ - -1, - (gchar *) "org.freedesktop.DBus.GLib.Async", - (gchar *) "", - NULL -}; - -static const GDBusAnnotationInfo * const _gsd_accounts_user_method_set_password_annotation_info_pointers[] = -{ - &_gsd_accounts_user_method_set_password_annotation_info_0, - NULL -}; - -static const _ExtendedGDBusMethodInfo _gsd_accounts_user_method_info_set_password = -{ - { - -1, - (gchar *) "SetPassword", - (GDBusArgInfo **) &_gsd_accounts_user_method_info_set_password_IN_ARG_pointers, - NULL, - (GDBusAnnotationInfo **) &_gsd_accounts_user_method_set_password_annotation_info_pointers - }, - "handle-set-password", - FALSE -}; - -static const _ExtendedGDBusArgInfo _gsd_accounts_user_method_info_set_password_hint_IN_ARG_hint = -{ - { - -1, - (gchar *) "hint", - (gchar *) "s", - NULL - }, - FALSE -}; - -static const _ExtendedGDBusArgInfo * const _gsd_accounts_user_method_info_set_password_hint_IN_ARG_pointers[] = -{ - &_gsd_accounts_user_method_info_set_password_hint_IN_ARG_hint, - NULL -}; - -static const GDBusAnnotationInfo _gsd_accounts_user_method_set_password_hint_annotation_info_0 = -{ - -1, - (gchar *) "org.freedesktop.DBus.GLib.Async", - (gchar *) "", - NULL -}; - -static const GDBusAnnotationInfo * const _gsd_accounts_user_method_set_password_hint_annotation_info_pointers[] = -{ - &_gsd_accounts_user_method_set_password_hint_annotation_info_0, - NULL -}; - -static const _ExtendedGDBusMethodInfo _gsd_accounts_user_method_info_set_password_hint = -{ - { - -1, - (gchar *) "SetPasswordHint", - (GDBusArgInfo **) &_gsd_accounts_user_method_info_set_password_hint_IN_ARG_pointers, - NULL, - (GDBusAnnotationInfo **) &_gsd_accounts_user_method_set_password_hint_annotation_info_pointers - }, - "handle-set-password-hint", - FALSE -}; - -static const _ExtendedGDBusArgInfo _gsd_accounts_user_method_info_set_automatic_login_IN_ARG_enabled = -{ - { - -1, - (gchar *) "enabled", - (gchar *) "b", - NULL - }, - FALSE -}; - -static const _ExtendedGDBusArgInfo * const _gsd_accounts_user_method_info_set_automatic_login_IN_ARG_pointers[] = -{ - &_gsd_accounts_user_method_info_set_automatic_login_IN_ARG_enabled, - NULL -}; - -static const GDBusAnnotationInfo _gsd_accounts_user_method_set_automatic_login_annotation_info_0 = -{ - -1, - (gchar *) "org.freedesktop.DBus.GLib.Async", - (gchar *) "", - NULL -}; - -static const GDBusAnnotationInfo * const _gsd_accounts_user_method_set_automatic_login_annotation_info_pointers[] = -{ - &_gsd_accounts_user_method_set_automatic_login_annotation_info_0, - NULL -}; - -static const _ExtendedGDBusMethodInfo _gsd_accounts_user_method_info_set_automatic_login = -{ - { - -1, - (gchar *) "SetAutomaticLogin", - (GDBusArgInfo **) &_gsd_accounts_user_method_info_set_automatic_login_IN_ARG_pointers, - NULL, - (GDBusAnnotationInfo **) &_gsd_accounts_user_method_set_automatic_login_annotation_info_pointers - }, - "handle-set-automatic-login", - FALSE -}; - -static const _ExtendedGDBusArgInfo _gsd_accounts_user_method_info_get_password_expiration_policy_OUT_ARG_expiration_time = -{ - { - -1, - (gchar *) "expiration_time", - (gchar *) "x", - NULL - }, - FALSE -}; - -static const _ExtendedGDBusArgInfo _gsd_accounts_user_method_info_get_password_expiration_policy_OUT_ARG_last_change_time = -{ - { - -1, - (gchar *) "last_change_time", - (gchar *) "x", - NULL - }, - FALSE -}; - -static const _ExtendedGDBusArgInfo _gsd_accounts_user_method_info_get_password_expiration_policy_OUT_ARG_min_days_between_changes = -{ - { - -1, - (gchar *) "min_days_between_changes", - (gchar *) "x", - NULL - }, - FALSE -}; - -static const _ExtendedGDBusArgInfo _gsd_accounts_user_method_info_get_password_expiration_policy_OUT_ARG_max_days_between_changes = -{ - { - -1, - (gchar *) "max_days_between_changes", - (gchar *) "x", - NULL - }, - FALSE -}; - -static const _ExtendedGDBusArgInfo _gsd_accounts_user_method_info_get_password_expiration_policy_OUT_ARG_days_to_warn = -{ - { - -1, - (gchar *) "days_to_warn", - (gchar *) "x", - NULL - }, - FALSE -}; - -static const _ExtendedGDBusArgInfo _gsd_accounts_user_method_info_get_password_expiration_policy_OUT_ARG_days_after_expiration_until_lock = -{ - { - -1, - (gchar *) "days_after_expiration_until_lock", - (gchar *) "x", - NULL - }, - FALSE -}; - -static const _ExtendedGDBusArgInfo * const _gsd_accounts_user_method_info_get_password_expiration_policy_OUT_ARG_pointers[] = -{ - &_gsd_accounts_user_method_info_get_password_expiration_policy_OUT_ARG_expiration_time, - &_gsd_accounts_user_method_info_get_password_expiration_policy_OUT_ARG_last_change_time, - &_gsd_accounts_user_method_info_get_password_expiration_policy_OUT_ARG_min_days_between_changes, - &_gsd_accounts_user_method_info_get_password_expiration_policy_OUT_ARG_max_days_between_changes, - &_gsd_accounts_user_method_info_get_password_expiration_policy_OUT_ARG_days_to_warn, - &_gsd_accounts_user_method_info_get_password_expiration_policy_OUT_ARG_days_after_expiration_until_lock, - NULL -}; - -static const GDBusAnnotationInfo _gsd_accounts_user_method_get_password_expiration_policy_annotation_info_0 = -{ - -1, - (gchar *) "org.freedesktop.DBus.GLib.Async", - (gchar *) "", - NULL -}; - -static const GDBusAnnotationInfo * const _gsd_accounts_user_method_get_password_expiration_policy_annotation_info_pointers[] = -{ - &_gsd_accounts_user_method_get_password_expiration_policy_annotation_info_0, - NULL -}; - -static const _ExtendedGDBusMethodInfo _gsd_accounts_user_method_info_get_password_expiration_policy = -{ - { - -1, - (gchar *) "GetPasswordExpirationPolicy", - NULL, - (GDBusArgInfo **) &_gsd_accounts_user_method_info_get_password_expiration_policy_OUT_ARG_pointers, - (GDBusAnnotationInfo **) &_gsd_accounts_user_method_get_password_expiration_policy_annotation_info_pointers - }, - "handle-get-password-expiration-policy", - FALSE -}; - -static const _ExtendedGDBusMethodInfo * const _gsd_accounts_user_method_info_pointers[] = -{ - &_gsd_accounts_user_method_info_set_user_name, - &_gsd_accounts_user_method_info_set_real_name, - &_gsd_accounts_user_method_info_set_email, - &_gsd_accounts_user_method_info_set_language, - &_gsd_accounts_user_method_info_set_xsession, - &_gsd_accounts_user_method_info_set_location, - &_gsd_accounts_user_method_info_set_home_directory, - &_gsd_accounts_user_method_info_set_shell, - &_gsd_accounts_user_method_info_set_icon_file, - &_gsd_accounts_user_method_info_set_locked, - &_gsd_accounts_user_method_info_set_account_type, - &_gsd_accounts_user_method_info_set_password_mode, - &_gsd_accounts_user_method_info_set_password, - &_gsd_accounts_user_method_info_set_password_hint, - &_gsd_accounts_user_method_info_set_automatic_login, - &_gsd_accounts_user_method_info_get_password_expiration_policy, - NULL -}; - -static const _ExtendedGDBusSignalInfo _gsd_accounts_user_signal_info_changed = -{ - { - -1, - (gchar *) "Changed", - NULL, - NULL - }, - "changed" -}; - -static const _ExtendedGDBusSignalInfo * const _gsd_accounts_user_signal_info_pointers[] = -{ - &_gsd_accounts_user_signal_info_changed, - NULL -}; - -static const _ExtendedGDBusPropertyInfo _gsd_accounts_user_property_info_uid = -{ - { - -1, - (gchar *) "Uid", - (gchar *) "t", - G_DBUS_PROPERTY_INFO_FLAGS_READABLE, - NULL - }, - "uid", - FALSE -}; - -static const _ExtendedGDBusPropertyInfo _gsd_accounts_user_property_info_user_name = -{ - { - -1, - (gchar *) "UserName", - (gchar *) "s", - G_DBUS_PROPERTY_INFO_FLAGS_READABLE, - NULL - }, - "user-name", - FALSE -}; - -static const _ExtendedGDBusPropertyInfo _gsd_accounts_user_property_info_real_name = -{ - { - -1, - (gchar *) "RealName", - (gchar *) "s", - G_DBUS_PROPERTY_INFO_FLAGS_READABLE, - NULL - }, - "real-name", - FALSE -}; - -static const _ExtendedGDBusPropertyInfo _gsd_accounts_user_property_info_account_type = -{ - { - -1, - (gchar *) "AccountType", - (gchar *) "i", - G_DBUS_PROPERTY_INFO_FLAGS_READABLE, - NULL - }, - "account-type", - FALSE -}; - -static const _ExtendedGDBusPropertyInfo _gsd_accounts_user_property_info_home_directory = -{ - { - -1, - (gchar *) "HomeDirectory", - (gchar *) "s", - G_DBUS_PROPERTY_INFO_FLAGS_READABLE, - NULL - }, - "home-directory", - FALSE -}; - -static const _ExtendedGDBusPropertyInfo _gsd_accounts_user_property_info_shell = -{ - { - -1, - (gchar *) "Shell", - (gchar *) "s", - G_DBUS_PROPERTY_INFO_FLAGS_READABLE, - NULL - }, - "shell", - FALSE -}; - -static const _ExtendedGDBusPropertyInfo _gsd_accounts_user_property_info_email = -{ - { - -1, - (gchar *) "Email", - (gchar *) "s", - G_DBUS_PROPERTY_INFO_FLAGS_READABLE, - NULL - }, - "email", - FALSE -}; - -static const _ExtendedGDBusPropertyInfo _gsd_accounts_user_property_info_language = -{ - { - -1, - (gchar *) "Language", - (gchar *) "s", - G_DBUS_PROPERTY_INFO_FLAGS_READABLE, - NULL - }, - "language", - FALSE -}; - -static const _ExtendedGDBusPropertyInfo _gsd_accounts_user_property_info_xsession = -{ - { - -1, - (gchar *) "XSession", - (gchar *) "s", - G_DBUS_PROPERTY_INFO_FLAGS_READABLE, - NULL - }, - "xsession", - FALSE -}; - -static const _ExtendedGDBusPropertyInfo _gsd_accounts_user_property_info_location = -{ - { - -1, - (gchar *) "Location", - (gchar *) "s", - G_DBUS_PROPERTY_INFO_FLAGS_READABLE, - NULL - }, - "location", - FALSE -}; - -static const _ExtendedGDBusPropertyInfo _gsd_accounts_user_property_info_login_frequency = -{ - { - -1, - (gchar *) "LoginFrequency", - (gchar *) "t", - G_DBUS_PROPERTY_INFO_FLAGS_READABLE, - NULL - }, - "login-frequency", - FALSE -}; - -static const _ExtendedGDBusPropertyInfo _gsd_accounts_user_property_info_login_time = -{ - { - -1, - (gchar *) "LoginTime", - (gchar *) "x", - G_DBUS_PROPERTY_INFO_FLAGS_READABLE, - NULL - }, - "login-time", - FALSE -}; - -static const _ExtendedGDBusPropertyInfo _gsd_accounts_user_property_info_login_history = -{ - { - -1, - (gchar *) "LoginHistory", - (gchar *) "a(xxa{sv})", - G_DBUS_PROPERTY_INFO_FLAGS_READABLE, - NULL - }, - "login-history", - FALSE -}; - -static const _ExtendedGDBusPropertyInfo _gsd_accounts_user_property_info_icon_file = -{ - { - -1, - (gchar *) "IconFile", - (gchar *) "s", - G_DBUS_PROPERTY_INFO_FLAGS_READABLE, - NULL - }, - "icon-file", - FALSE -}; - -static const _ExtendedGDBusPropertyInfo _gsd_accounts_user_property_info_locked = -{ - { - -1, - (gchar *) "Locked", - (gchar *) "b", - G_DBUS_PROPERTY_INFO_FLAGS_READABLE, - NULL - }, - "locked", - FALSE -}; - -static const _ExtendedGDBusPropertyInfo _gsd_accounts_user_property_info_password_mode = -{ - { - -1, - (gchar *) "PasswordMode", - (gchar *) "i", - G_DBUS_PROPERTY_INFO_FLAGS_READABLE, - NULL - }, - "password-mode", - FALSE -}; - -static const _ExtendedGDBusPropertyInfo _gsd_accounts_user_property_info_password_hint = -{ - { - -1, - (gchar *) "PasswordHint", - (gchar *) "s", - G_DBUS_PROPERTY_INFO_FLAGS_READABLE, - NULL - }, - "password-hint", - FALSE -}; - -static const _ExtendedGDBusPropertyInfo _gsd_accounts_user_property_info_automatic_login = -{ - { - -1, - (gchar *) "AutomaticLogin", - (gchar *) "b", - G_DBUS_PROPERTY_INFO_FLAGS_READABLE, - NULL - }, - "automatic-login", - FALSE -}; - -static const _ExtendedGDBusPropertyInfo _gsd_accounts_user_property_info_system_account = -{ - { - -1, - (gchar *) "SystemAccount", - (gchar *) "b", - G_DBUS_PROPERTY_INFO_FLAGS_READABLE, - NULL - }, - "system-account", - FALSE -}; - -static const _ExtendedGDBusPropertyInfo _gsd_accounts_user_property_info_local_account = -{ - { - -1, - (gchar *) "LocalAccount", - (gchar *) "b", - G_DBUS_PROPERTY_INFO_FLAGS_READABLE, - NULL - }, - "local-account", - FALSE -}; - -static const _ExtendedGDBusPropertyInfo * const _gsd_accounts_user_property_info_pointers[] = -{ - &_gsd_accounts_user_property_info_uid, - &_gsd_accounts_user_property_info_user_name, - &_gsd_accounts_user_property_info_real_name, - &_gsd_accounts_user_property_info_account_type, - &_gsd_accounts_user_property_info_home_directory, - &_gsd_accounts_user_property_info_shell, - &_gsd_accounts_user_property_info_email, - &_gsd_accounts_user_property_info_language, - &_gsd_accounts_user_property_info_xsession, - &_gsd_accounts_user_property_info_location, - &_gsd_accounts_user_property_info_login_frequency, - &_gsd_accounts_user_property_info_login_time, - &_gsd_accounts_user_property_info_login_history, - &_gsd_accounts_user_property_info_icon_file, - &_gsd_accounts_user_property_info_locked, - &_gsd_accounts_user_property_info_password_mode, - &_gsd_accounts_user_property_info_password_hint, - &_gsd_accounts_user_property_info_automatic_login, - &_gsd_accounts_user_property_info_system_account, - &_gsd_accounts_user_property_info_local_account, - NULL -}; - -static const _ExtendedGDBusInterfaceInfo _gsd_accounts_user_interface_info = -{ - { - -1, - (gchar *) "org.freedesktop.Accounts.User", - (GDBusMethodInfo **) &_gsd_accounts_user_method_info_pointers, - (GDBusSignalInfo **) &_gsd_accounts_user_signal_info_pointers, - (GDBusPropertyInfo **) &_gsd_accounts_user_property_info_pointers, - NULL - }, - "accounts-user", -}; - - -/** - * gsd_accounts_user_interface_info: - * - * Gets a machine-readable description of the org.freedesktop.Accounts.User D-Bus interface. - * - * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free. - */ -GDBusInterfaceInfo * -gsd_accounts_user_interface_info (void) -{ - return (GDBusInterfaceInfo *) &_gsd_accounts_user_interface_info.parent_struct; -} - -/** - * gsd_accounts_user_override_properties: - * @klass: The class structure for a #GObject-derived class. - * @property_id_begin: The property id to assign to the first overridden property. - * - * Overrides all #GObject properties in the #GsdAccountsUser interface for a concrete class. - * The properties are overridden in the order they are defined. - * - * Returns: The last property id. - */ -guint -gsd_accounts_user_override_properties (GObjectClass *klass, guint property_id_begin) -{ - g_object_class_override_property (klass, property_id_begin++, "uid"); - g_object_class_override_property (klass, property_id_begin++, "user-name"); - g_object_class_override_property (klass, property_id_begin++, "real-name"); - g_object_class_override_property (klass, property_id_begin++, "account-type"); - g_object_class_override_property (klass, property_id_begin++, "home-directory"); - g_object_class_override_property (klass, property_id_begin++, "shell"); - g_object_class_override_property (klass, property_id_begin++, "email"); - g_object_class_override_property (klass, property_id_begin++, "language"); - g_object_class_override_property (klass, property_id_begin++, "xsession"); - g_object_class_override_property (klass, property_id_begin++, "location"); - g_object_class_override_property (klass, property_id_begin++, "login-frequency"); - g_object_class_override_property (klass, property_id_begin++, "login-time"); - g_object_class_override_property (klass, property_id_begin++, "login-history"); - g_object_class_override_property (klass, property_id_begin++, "icon-file"); - g_object_class_override_property (klass, property_id_begin++, "locked"); - g_object_class_override_property (klass, property_id_begin++, "password-mode"); - g_object_class_override_property (klass, property_id_begin++, "password-hint"); - g_object_class_override_property (klass, property_id_begin++, "automatic-login"); - g_object_class_override_property (klass, property_id_begin++, "system-account"); - g_object_class_override_property (klass, property_id_begin++, "local-account"); - return property_id_begin - 1; -} - - - -/** - * GsdAccountsUser: - * - * Abstract interface type for the D-Bus interface org.freedesktop.Accounts.User. - */ - -/** - * GsdAccountsUserIface: - * @parent_iface: The parent interface. - * @handle_get_password_expiration_policy: Handler for the #GsdAccountsUser::handle-get-password-expiration-policy signal. - * @handle_set_account_type: Handler for the #GsdAccountsUser::handle-set-account-type signal. - * @handle_set_automatic_login: Handler for the #GsdAccountsUser::handle-set-automatic-login signal. - * @handle_set_email: Handler for the #GsdAccountsUser::handle-set-email signal. - * @handle_set_home_directory: Handler for the #GsdAccountsUser::handle-set-home-directory signal. - * @handle_set_icon_file: Handler for the #GsdAccountsUser::handle-set-icon-file signal. - * @handle_set_language: Handler for the #GsdAccountsUser::handle-set-language signal. - * @handle_set_location: Handler for the #GsdAccountsUser::handle-set-location signal. - * @handle_set_locked: Handler for the #GsdAccountsUser::handle-set-locked signal. - * @handle_set_password: Handler for the #GsdAccountsUser::handle-set-password signal. - * @handle_set_password_hint: Handler for the #GsdAccountsUser::handle-set-password-hint signal. - * @handle_set_password_mode: Handler for the #GsdAccountsUser::handle-set-password-mode signal. - * @handle_set_real_name: Handler for the #GsdAccountsUser::handle-set-real-name signal. - * @handle_set_shell: Handler for the #GsdAccountsUser::handle-set-shell signal. - * @handle_set_user_name: Handler for the #GsdAccountsUser::handle-set-user-name signal. - * @handle_set_xsession: Handler for the #GsdAccountsUser::handle-set-xsession signal. - * @get_account_type: Getter for the #GsdAccountsUser:account-type property. - * @get_automatic_login: Getter for the #GsdAccountsUser:automatic-login property. - * @get_email: Getter for the #GsdAccountsUser:email property. - * @get_home_directory: Getter for the #GsdAccountsUser:home-directory property. - * @get_icon_file: Getter for the #GsdAccountsUser:icon-file property. - * @get_language: Getter for the #GsdAccountsUser:language property. - * @get_local_account: Getter for the #GsdAccountsUser:local-account property. - * @get_location: Getter for the #GsdAccountsUser:location property. - * @get_locked: Getter for the #GsdAccountsUser:locked property. - * @get_login_frequency: Getter for the #GsdAccountsUser:login-frequency property. - * @get_login_history: Getter for the #GsdAccountsUser:login-history property. - * @get_login_time: Getter for the #GsdAccountsUser:login-time property. - * @get_password_hint: Getter for the #GsdAccountsUser:password-hint property. - * @get_password_mode: Getter for the #GsdAccountsUser:password-mode property. - * @get_real_name: Getter for the #GsdAccountsUser:real-name property. - * @get_shell: Getter for the #GsdAccountsUser:shell property. - * @get_system_account: Getter for the #GsdAccountsUser:system-account property. - * @get_uid: Getter for the #GsdAccountsUser:uid property. - * @get_user_name: Getter for the #GsdAccountsUser:user-name property. - * @get_xsession: Getter for the #GsdAccountsUser:xsession property. - * @changed: Handler for the #GsdAccountsUser::changed signal. - * - * Virtual table for the D-Bus interface org.freedesktop.Accounts.User. - */ - -typedef GsdAccountsUserIface GsdAccountsUserInterface; -G_DEFINE_INTERFACE (GsdAccountsUser, gsd_accounts_user, G_TYPE_OBJECT) - -static void -gsd_accounts_user_default_init (GsdAccountsUserIface *iface) -{ - /* GObject signals for incoming D-Bus method calls: */ - /** - * GsdAccountsUser::handle-set-user-name: - * @object: A #GsdAccountsUser. - * @invocation: A #GDBusMethodInvocation. - * @arg_name: Argument passed by remote caller. - * - * Signal emitted when a remote caller is invoking the SetUserName() D-Bus method. - * - * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gsd_accounts_user_complete_set_user_name() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. - * - * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - */ - g_signal_new ("handle-set-user-name", - G_TYPE_FROM_INTERFACE (iface), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GsdAccountsUserIface, handle_set_user_name), - g_signal_accumulator_true_handled, - NULL, - g_cclosure_marshal_generic, - G_TYPE_BOOLEAN, - 2, - G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); - - /** - * GsdAccountsUser::handle-set-real-name: - * @object: A #GsdAccountsUser. - * @invocation: A #GDBusMethodInvocation. - * @arg_name: Argument passed by remote caller. - * - * Signal emitted when a remote caller is invoking the SetRealName() D-Bus method. - * - * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gsd_accounts_user_complete_set_real_name() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. - * - * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - */ - g_signal_new ("handle-set-real-name", - G_TYPE_FROM_INTERFACE (iface), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GsdAccountsUserIface, handle_set_real_name), - g_signal_accumulator_true_handled, - NULL, - g_cclosure_marshal_generic, - G_TYPE_BOOLEAN, - 2, - G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); - - /** - * GsdAccountsUser::handle-set-email: - * @object: A #GsdAccountsUser. - * @invocation: A #GDBusMethodInvocation. - * @arg_email: Argument passed by remote caller. - * - * Signal emitted when a remote caller is invoking the SetEmail() D-Bus method. - * - * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gsd_accounts_user_complete_set_email() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. - * - * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - */ - g_signal_new ("handle-set-email", - G_TYPE_FROM_INTERFACE (iface), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GsdAccountsUserIface, handle_set_email), - g_signal_accumulator_true_handled, - NULL, - g_cclosure_marshal_generic, - G_TYPE_BOOLEAN, - 2, - G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); - - /** - * GsdAccountsUser::handle-set-language: - * @object: A #GsdAccountsUser. - * @invocation: A #GDBusMethodInvocation. - * @arg_language: Argument passed by remote caller. - * - * Signal emitted when a remote caller is invoking the SetLanguage() D-Bus method. - * - * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gsd_accounts_user_complete_set_language() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. - * - * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - */ - g_signal_new ("handle-set-language", - G_TYPE_FROM_INTERFACE (iface), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GsdAccountsUserIface, handle_set_language), - g_signal_accumulator_true_handled, - NULL, - g_cclosure_marshal_generic, - G_TYPE_BOOLEAN, - 2, - G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); - - /** - * GsdAccountsUser::handle-set-xsession: - * @object: A #GsdAccountsUser. - * @invocation: A #GDBusMethodInvocation. - * @arg_x_session: Argument passed by remote caller. - * - * Signal emitted when a remote caller is invoking the SetXSession() D-Bus method. - * - * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gsd_accounts_user_complete_set_xsession() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. - * - * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - */ - g_signal_new ("handle-set-xsession", - G_TYPE_FROM_INTERFACE (iface), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GsdAccountsUserIface, handle_set_xsession), - g_signal_accumulator_true_handled, - NULL, - g_cclosure_marshal_generic, - G_TYPE_BOOLEAN, - 2, - G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); - - /** - * GsdAccountsUser::handle-set-location: - * @object: A #GsdAccountsUser. - * @invocation: A #GDBusMethodInvocation. - * @arg_location: Argument passed by remote caller. - * - * Signal emitted when a remote caller is invoking the SetLocation() D-Bus method. - * - * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gsd_accounts_user_complete_set_location() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. - * - * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - */ - g_signal_new ("handle-set-location", - G_TYPE_FROM_INTERFACE (iface), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GsdAccountsUserIface, handle_set_location), - g_signal_accumulator_true_handled, - NULL, - g_cclosure_marshal_generic, - G_TYPE_BOOLEAN, - 2, - G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); - - /** - * GsdAccountsUser::handle-set-home-directory: - * @object: A #GsdAccountsUser. - * @invocation: A #GDBusMethodInvocation. - * @arg_homedir: Argument passed by remote caller. - * - * Signal emitted when a remote caller is invoking the SetHomeDirectory() D-Bus method. - * - * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gsd_accounts_user_complete_set_home_directory() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. - * - * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - */ - g_signal_new ("handle-set-home-directory", - G_TYPE_FROM_INTERFACE (iface), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GsdAccountsUserIface, handle_set_home_directory), - g_signal_accumulator_true_handled, - NULL, - g_cclosure_marshal_generic, - G_TYPE_BOOLEAN, - 2, - G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); - - /** - * GsdAccountsUser::handle-set-shell: - * @object: A #GsdAccountsUser. - * @invocation: A #GDBusMethodInvocation. - * @arg_shell: Argument passed by remote caller. - * - * Signal emitted when a remote caller is invoking the SetShell() D-Bus method. - * - * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gsd_accounts_user_complete_set_shell() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. - * - * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - */ - g_signal_new ("handle-set-shell", - G_TYPE_FROM_INTERFACE (iface), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GsdAccountsUserIface, handle_set_shell), - g_signal_accumulator_true_handled, - NULL, - g_cclosure_marshal_generic, - G_TYPE_BOOLEAN, - 2, - G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); - - /** - * GsdAccountsUser::handle-set-icon-file: - * @object: A #GsdAccountsUser. - * @invocation: A #GDBusMethodInvocation. - * @arg_filename: Argument passed by remote caller. - * - * Signal emitted when a remote caller is invoking the SetIconFile() D-Bus method. - * - * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gsd_accounts_user_complete_set_icon_file() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. - * - * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - */ - g_signal_new ("handle-set-icon-file", - G_TYPE_FROM_INTERFACE (iface), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GsdAccountsUserIface, handle_set_icon_file), - g_signal_accumulator_true_handled, - NULL, - g_cclosure_marshal_generic, - G_TYPE_BOOLEAN, - 2, - G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); - - /** - * GsdAccountsUser::handle-set-locked: - * @object: A #GsdAccountsUser. - * @invocation: A #GDBusMethodInvocation. - * @arg_locked: Argument passed by remote caller. - * - * Signal emitted when a remote caller is invoking the SetLocked() D-Bus method. - * - * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gsd_accounts_user_complete_set_locked() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. - * - * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - */ - g_signal_new ("handle-set-locked", - G_TYPE_FROM_INTERFACE (iface), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GsdAccountsUserIface, handle_set_locked), - g_signal_accumulator_true_handled, - NULL, - g_cclosure_marshal_generic, - G_TYPE_BOOLEAN, - 2, - G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_BOOLEAN); - - /** - * GsdAccountsUser::handle-set-account-type: - * @object: A #GsdAccountsUser. - * @invocation: A #GDBusMethodInvocation. - * @arg_accountType: Argument passed by remote caller. - * - * Signal emitted when a remote caller is invoking the SetAccountType() D-Bus method. - * - * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gsd_accounts_user_complete_set_account_type() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. - * - * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - */ - g_signal_new ("handle-set-account-type", - G_TYPE_FROM_INTERFACE (iface), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GsdAccountsUserIface, handle_set_account_type), - g_signal_accumulator_true_handled, - NULL, - g_cclosure_marshal_generic, - G_TYPE_BOOLEAN, - 2, - G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_INT); - - /** - * GsdAccountsUser::handle-set-password-mode: - * @object: A #GsdAccountsUser. - * @invocation: A #GDBusMethodInvocation. - * @arg_mode: Argument passed by remote caller. - * - * Signal emitted when a remote caller is invoking the SetPasswordMode() D-Bus method. - * - * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gsd_accounts_user_complete_set_password_mode() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. - * - * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - */ - g_signal_new ("handle-set-password-mode", - G_TYPE_FROM_INTERFACE (iface), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GsdAccountsUserIface, handle_set_password_mode), - g_signal_accumulator_true_handled, - NULL, - g_cclosure_marshal_generic, - G_TYPE_BOOLEAN, - 2, - G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_INT); - - /** - * GsdAccountsUser::handle-set-password: - * @object: A #GsdAccountsUser. - * @invocation: A #GDBusMethodInvocation. - * @arg_password: Argument passed by remote caller. - * @arg_hint: Argument passed by remote caller. - * - * Signal emitted when a remote caller is invoking the SetPassword() D-Bus method. - * - * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gsd_accounts_user_complete_set_password() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. - * - * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - */ - g_signal_new ("handle-set-password", - G_TYPE_FROM_INTERFACE (iface), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GsdAccountsUserIface, handle_set_password), - g_signal_accumulator_true_handled, - NULL, - g_cclosure_marshal_generic, - G_TYPE_BOOLEAN, - 3, - G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_STRING); - - /** - * GsdAccountsUser::handle-set-password-hint: - * @object: A #GsdAccountsUser. - * @invocation: A #GDBusMethodInvocation. - * @arg_hint: Argument passed by remote caller. - * - * Signal emitted when a remote caller is invoking the SetPasswordHint() D-Bus method. - * - * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gsd_accounts_user_complete_set_password_hint() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. - * - * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - */ - g_signal_new ("handle-set-password-hint", - G_TYPE_FROM_INTERFACE (iface), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GsdAccountsUserIface, handle_set_password_hint), - g_signal_accumulator_true_handled, - NULL, - g_cclosure_marshal_generic, - G_TYPE_BOOLEAN, - 2, - G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); - - /** - * GsdAccountsUser::handle-set-automatic-login: - * @object: A #GsdAccountsUser. - * @invocation: A #GDBusMethodInvocation. - * @arg_enabled: Argument passed by remote caller. - * - * Signal emitted when a remote caller is invoking the SetAutomaticLogin() D-Bus method. - * - * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gsd_accounts_user_complete_set_automatic_login() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. - * - * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - */ - g_signal_new ("handle-set-automatic-login", - G_TYPE_FROM_INTERFACE (iface), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GsdAccountsUserIface, handle_set_automatic_login), - g_signal_accumulator_true_handled, - NULL, - g_cclosure_marshal_generic, - G_TYPE_BOOLEAN, - 2, - G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_BOOLEAN); - - /** - * GsdAccountsUser::handle-get-password-expiration-policy: - * @object: A #GsdAccountsUser. - * @invocation: A #GDBusMethodInvocation. - * - * Signal emitted when a remote caller is invoking the GetPasswordExpirationPolicy() D-Bus method. - * - * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gsd_accounts_user_complete_get_password_expiration_policy() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. - * - * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - */ - g_signal_new ("handle-get-password-expiration-policy", - G_TYPE_FROM_INTERFACE (iface), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GsdAccountsUserIface, handle_get_password_expiration_policy), - g_signal_accumulator_true_handled, - NULL, - g_cclosure_marshal_generic, - G_TYPE_BOOLEAN, - 1, - G_TYPE_DBUS_METHOD_INVOCATION); - - /* GObject signals for received D-Bus signals: */ - /** - * GsdAccountsUser::changed: - * @object: A #GsdAccountsUser. - * - * On the client-side, this signal is emitted whenever the D-Bus signal "Changed" is received. - * - * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. - */ - g_signal_new ("changed", - G_TYPE_FROM_INTERFACE (iface), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GsdAccountsUserIface, changed), - NULL, - NULL, - g_cclosure_marshal_generic, - G_TYPE_NONE, - 0); - - /* GObject properties for D-Bus properties: */ - /** - * GsdAccountsUser:uid: - * - * Represents the D-Bus property "Uid". - * - * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. - */ - g_object_interface_install_property (iface, - g_param_spec_uint64 ("uid", "Uid", "Uid", 0, G_MAXUINT64, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - /** - * GsdAccountsUser:user-name: - * - * Represents the D-Bus property "UserName". - * - * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. - */ - g_object_interface_install_property (iface, - g_param_spec_string ("user-name", "UserName", "UserName", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - /** - * GsdAccountsUser:real-name: - * - * Represents the D-Bus property "RealName". - * - * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. - */ - g_object_interface_install_property (iface, - g_param_spec_string ("real-name", "RealName", "RealName", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - /** - * GsdAccountsUser:account-type: - * - * Represents the D-Bus property "AccountType". - * - * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. - */ - g_object_interface_install_property (iface, - g_param_spec_int ("account-type", "AccountType", "AccountType", G_MININT32, G_MAXINT32, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - /** - * GsdAccountsUser:home-directory: - * - * Represents the D-Bus property "HomeDirectory". - * - * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. - */ - g_object_interface_install_property (iface, - g_param_spec_string ("home-directory", "HomeDirectory", "HomeDirectory", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - /** - * GsdAccountsUser:shell: - * - * Represents the D-Bus property "Shell". - * - * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. - */ - g_object_interface_install_property (iface, - g_param_spec_string ("shell", "Shell", "Shell", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - /** - * GsdAccountsUser:email: - * - * Represents the D-Bus property "Email". - * - * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. - */ - g_object_interface_install_property (iface, - g_param_spec_string ("email", "Email", "Email", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - /** - * GsdAccountsUser:language: - * - * Represents the D-Bus property "Language". - * - * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. - */ - g_object_interface_install_property (iface, - g_param_spec_string ("language", "Language", "Language", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - /** - * GsdAccountsUser:xsession: - * - * Represents the D-Bus property "XSession". - * - * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. - */ - g_object_interface_install_property (iface, - g_param_spec_string ("xsession", "XSession", "XSession", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - /** - * GsdAccountsUser:location: - * - * Represents the D-Bus property "Location". - * - * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. - */ - g_object_interface_install_property (iface, - g_param_spec_string ("location", "Location", "Location", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - /** - * GsdAccountsUser:login-frequency: - * - * Represents the D-Bus property "LoginFrequency". - * - * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. - */ - g_object_interface_install_property (iface, - g_param_spec_uint64 ("login-frequency", "LoginFrequency", "LoginFrequency", 0, G_MAXUINT64, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - /** - * GsdAccountsUser:login-time: - * - * Represents the D-Bus property "LoginTime". - * - * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. - */ - g_object_interface_install_property (iface, - g_param_spec_int64 ("login-time", "LoginTime", "LoginTime", G_MININT64, G_MAXINT64, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - /** - * GsdAccountsUser:login-history: - * - * Represents the D-Bus property "LoginHistory". - * - * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. - */ - g_object_interface_install_property (iface, - g_param_spec_variant ("login-history", "LoginHistory", "LoginHistory", G_VARIANT_TYPE ("a(xxa{sv})"), NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - /** - * GsdAccountsUser:icon-file: - * - * Represents the D-Bus property "IconFile". - * - * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. - */ - g_object_interface_install_property (iface, - g_param_spec_string ("icon-file", "IconFile", "IconFile", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - /** - * GsdAccountsUser:locked: - * - * Represents the D-Bus property "Locked". - * - * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. - */ - g_object_interface_install_property (iface, - g_param_spec_boolean ("locked", "Locked", "Locked", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - /** - * GsdAccountsUser:password-mode: - * - * Represents the D-Bus property "PasswordMode". - * - * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. - */ - g_object_interface_install_property (iface, - g_param_spec_int ("password-mode", "PasswordMode", "PasswordMode", G_MININT32, G_MAXINT32, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - /** - * GsdAccountsUser:password-hint: - * - * Represents the D-Bus property "PasswordHint". - * - * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. - */ - g_object_interface_install_property (iface, - g_param_spec_string ("password-hint", "PasswordHint", "PasswordHint", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - /** - * GsdAccountsUser:automatic-login: - * - * Represents the D-Bus property "AutomaticLogin". - * - * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. - */ - g_object_interface_install_property (iface, - g_param_spec_boolean ("automatic-login", "AutomaticLogin", "AutomaticLogin", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - /** - * GsdAccountsUser:system-account: - * - * Represents the D-Bus property "SystemAccount". - * - * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. - */ - g_object_interface_install_property (iface, - g_param_spec_boolean ("system-account", "SystemAccount", "SystemAccount", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - /** - * GsdAccountsUser:local-account: - * - * Represents the D-Bus property "LocalAccount". - * - * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. - */ - g_object_interface_install_property (iface, - g_param_spec_boolean ("local-account", "LocalAccount", "LocalAccount", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); -} - -/** - * gsd_accounts_user_get_uid: (skip) - * @object: A #GsdAccountsUser. - * - * Gets the value of the "Uid" D-Bus property. - * - * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - * - * Returns: The property value. - */ -guint64 -gsd_accounts_user_get_uid (GsdAccountsUser *object) -{ - return GSD_ACCOUNTS_USER_GET_IFACE (object)->get_uid (object); -} - -/** - * gsd_accounts_user_set_uid: (skip) - * @object: A #GsdAccountsUser. - * @value: The value to set. - * - * Sets the "Uid" D-Bus property to @value. - * - * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. - */ -void -gsd_accounts_user_set_uid (GsdAccountsUser *object, guint64 value) -{ - g_object_set (G_OBJECT (object), "uid", value, NULL); -} - -/** - * gsd_accounts_user_get_user_name: (skip) - * @object: A #GsdAccountsUser. - * - * Gets the value of the "UserName" D-Bus property. - * - * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - * - * The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use gsd_accounts_user_dup_user_name() if on another thread. - * - * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. - */ -const gchar * -gsd_accounts_user_get_user_name (GsdAccountsUser *object) -{ - return GSD_ACCOUNTS_USER_GET_IFACE (object)->get_user_name (object); -} - -/** - * gsd_accounts_user_dup_user_name: (skip) - * @object: A #GsdAccountsUser. - * - * Gets a copy of the "UserName" D-Bus property. - * - * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - * - * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free(). - */ -gchar * -gsd_accounts_user_dup_user_name (GsdAccountsUser *object) -{ - gchar *value; - g_object_get (G_OBJECT (object), "user-name", &value, NULL); - return value; -} - -/** - * gsd_accounts_user_set_user_name: (skip) - * @object: A #GsdAccountsUser. - * @value: The value to set. - * - * Sets the "UserName" D-Bus property to @value. - * - * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. - */ -void -gsd_accounts_user_set_user_name (GsdAccountsUser *object, const gchar *value) -{ - g_object_set (G_OBJECT (object), "user-name", value, NULL); -} - -/** - * gsd_accounts_user_get_real_name: (skip) - * @object: A #GsdAccountsUser. - * - * Gets the value of the "RealName" D-Bus property. - * - * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - * - * The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use gsd_accounts_user_dup_real_name() if on another thread. - * - * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. - */ -const gchar * -gsd_accounts_user_get_real_name (GsdAccountsUser *object) -{ - return GSD_ACCOUNTS_USER_GET_IFACE (object)->get_real_name (object); -} - -/** - * gsd_accounts_user_dup_real_name: (skip) - * @object: A #GsdAccountsUser. - * - * Gets a copy of the "RealName" D-Bus property. - * - * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - * - * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free(). - */ -gchar * -gsd_accounts_user_dup_real_name (GsdAccountsUser *object) -{ - gchar *value; - g_object_get (G_OBJECT (object), "real-name", &value, NULL); - return value; -} - -/** - * gsd_accounts_user_set_real_name: (skip) - * @object: A #GsdAccountsUser. - * @value: The value to set. - * - * Sets the "RealName" D-Bus property to @value. - * - * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. - */ -void -gsd_accounts_user_set_real_name (GsdAccountsUser *object, const gchar *value) -{ - g_object_set (G_OBJECT (object), "real-name", value, NULL); -} - -/** - * gsd_accounts_user_get_account_type: (skip) - * @object: A #GsdAccountsUser. - * - * Gets the value of the "AccountType" D-Bus property. - * - * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - * - * Returns: The property value. - */ -gint -gsd_accounts_user_get_account_type (GsdAccountsUser *object) -{ - return GSD_ACCOUNTS_USER_GET_IFACE (object)->get_account_type (object); -} - -/** - * gsd_accounts_user_set_account_type: (skip) - * @object: A #GsdAccountsUser. - * @value: The value to set. - * - * Sets the "AccountType" D-Bus property to @value. - * - * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. - */ -void -gsd_accounts_user_set_account_type (GsdAccountsUser *object, gint value) -{ - g_object_set (G_OBJECT (object), "account-type", value, NULL); -} - -/** - * gsd_accounts_user_get_home_directory: (skip) - * @object: A #GsdAccountsUser. - * - * Gets the value of the "HomeDirectory" D-Bus property. - * - * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - * - * The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use gsd_accounts_user_dup_home_directory() if on another thread. - * - * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. - */ -const gchar * -gsd_accounts_user_get_home_directory (GsdAccountsUser *object) -{ - return GSD_ACCOUNTS_USER_GET_IFACE (object)->get_home_directory (object); -} - -/** - * gsd_accounts_user_dup_home_directory: (skip) - * @object: A #GsdAccountsUser. - * - * Gets a copy of the "HomeDirectory" D-Bus property. - * - * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - * - * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free(). - */ -gchar * -gsd_accounts_user_dup_home_directory (GsdAccountsUser *object) -{ - gchar *value; - g_object_get (G_OBJECT (object), "home-directory", &value, NULL); - return value; -} - -/** - * gsd_accounts_user_set_home_directory: (skip) - * @object: A #GsdAccountsUser. - * @value: The value to set. - * - * Sets the "HomeDirectory" D-Bus property to @value. - * - * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. - */ -void -gsd_accounts_user_set_home_directory (GsdAccountsUser *object, const gchar *value) -{ - g_object_set (G_OBJECT (object), "home-directory", value, NULL); -} - -/** - * gsd_accounts_user_get_shell: (skip) - * @object: A #GsdAccountsUser. - * - * Gets the value of the "Shell" D-Bus property. - * - * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - * - * The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use gsd_accounts_user_dup_shell() if on another thread. - * - * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. - */ -const gchar * -gsd_accounts_user_get_shell (GsdAccountsUser *object) -{ - return GSD_ACCOUNTS_USER_GET_IFACE (object)->get_shell (object); -} - -/** - * gsd_accounts_user_dup_shell: (skip) - * @object: A #GsdAccountsUser. - * - * Gets a copy of the "Shell" D-Bus property. - * - * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - * - * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free(). - */ -gchar * -gsd_accounts_user_dup_shell (GsdAccountsUser *object) -{ - gchar *value; - g_object_get (G_OBJECT (object), "shell", &value, NULL); - return value; -} - -/** - * gsd_accounts_user_set_shell: (skip) - * @object: A #GsdAccountsUser. - * @value: The value to set. - * - * Sets the "Shell" D-Bus property to @value. - * - * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. - */ -void -gsd_accounts_user_set_shell (GsdAccountsUser *object, const gchar *value) -{ - g_object_set (G_OBJECT (object), "shell", value, NULL); -} - -/** - * gsd_accounts_user_get_email: (skip) - * @object: A #GsdAccountsUser. - * - * Gets the value of the "Email" D-Bus property. - * - * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - * - * The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use gsd_accounts_user_dup_email() if on another thread. - * - * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. - */ -const gchar * -gsd_accounts_user_get_email (GsdAccountsUser *object) -{ - return GSD_ACCOUNTS_USER_GET_IFACE (object)->get_email (object); -} - -/** - * gsd_accounts_user_dup_email: (skip) - * @object: A #GsdAccountsUser. - * - * Gets a copy of the "Email" D-Bus property. - * - * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - * - * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free(). - */ -gchar * -gsd_accounts_user_dup_email (GsdAccountsUser *object) -{ - gchar *value; - g_object_get (G_OBJECT (object), "email", &value, NULL); - return value; -} - -/** - * gsd_accounts_user_set_email: (skip) - * @object: A #GsdAccountsUser. - * @value: The value to set. - * - * Sets the "Email" D-Bus property to @value. - * - * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. - */ -void -gsd_accounts_user_set_email (GsdAccountsUser *object, const gchar *value) -{ - g_object_set (G_OBJECT (object), "email", value, NULL); -} - -/** - * gsd_accounts_user_get_language: (skip) - * @object: A #GsdAccountsUser. - * - * Gets the value of the "Language" D-Bus property. - * - * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - * - * The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use gsd_accounts_user_dup_language() if on another thread. - * - * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. - */ -const gchar * -gsd_accounts_user_get_language (GsdAccountsUser *object) -{ - return GSD_ACCOUNTS_USER_GET_IFACE (object)->get_language (object); -} - -/** - * gsd_accounts_user_dup_language: (skip) - * @object: A #GsdAccountsUser. - * - * Gets a copy of the "Language" D-Bus property. - * - * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - * - * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free(). - */ -gchar * -gsd_accounts_user_dup_language (GsdAccountsUser *object) -{ - gchar *value; - g_object_get (G_OBJECT (object), "language", &value, NULL); - return value; -} - -/** - * gsd_accounts_user_set_language: (skip) - * @object: A #GsdAccountsUser. - * @value: The value to set. - * - * Sets the "Language" D-Bus property to @value. - * - * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. - */ -void -gsd_accounts_user_set_language (GsdAccountsUser *object, const gchar *value) -{ - g_object_set (G_OBJECT (object), "language", value, NULL); -} - -/** - * gsd_accounts_user_get_xsession: (skip) - * @object: A #GsdAccountsUser. - * - * Gets the value of the "XSession" D-Bus property. - * - * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - * - * The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use gsd_accounts_user_dup_xsession() if on another thread. - * - * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. - */ -const gchar * -gsd_accounts_user_get_xsession (GsdAccountsUser *object) -{ - return GSD_ACCOUNTS_USER_GET_IFACE (object)->get_xsession (object); -} - -/** - * gsd_accounts_user_dup_xsession: (skip) - * @object: A #GsdAccountsUser. - * - * Gets a copy of the "XSession" D-Bus property. - * - * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - * - * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free(). - */ -gchar * -gsd_accounts_user_dup_xsession (GsdAccountsUser *object) -{ - gchar *value; - g_object_get (G_OBJECT (object), "xsession", &value, NULL); - return value; -} - -/** - * gsd_accounts_user_set_xsession: (skip) - * @object: A #GsdAccountsUser. - * @value: The value to set. - * - * Sets the "XSession" D-Bus property to @value. - * - * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. - */ -void -gsd_accounts_user_set_xsession (GsdAccountsUser *object, const gchar *value) -{ - g_object_set (G_OBJECT (object), "xsession", value, NULL); -} - -/** - * gsd_accounts_user_get_location: (skip) - * @object: A #GsdAccountsUser. - * - * Gets the value of the "Location" D-Bus property. - * - * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - * - * The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use gsd_accounts_user_dup_location() if on another thread. - * - * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. - */ -const gchar * -gsd_accounts_user_get_location (GsdAccountsUser *object) -{ - return GSD_ACCOUNTS_USER_GET_IFACE (object)->get_location (object); -} - -/** - * gsd_accounts_user_dup_location: (skip) - * @object: A #GsdAccountsUser. - * - * Gets a copy of the "Location" D-Bus property. - * - * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - * - * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free(). - */ -gchar * -gsd_accounts_user_dup_location (GsdAccountsUser *object) -{ - gchar *value; - g_object_get (G_OBJECT (object), "location", &value, NULL); - return value; -} - -/** - * gsd_accounts_user_set_location: (skip) - * @object: A #GsdAccountsUser. - * @value: The value to set. - * - * Sets the "Location" D-Bus property to @value. - * - * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. - */ -void -gsd_accounts_user_set_location (GsdAccountsUser *object, const gchar *value) -{ - g_object_set (G_OBJECT (object), "location", value, NULL); -} - -/** - * gsd_accounts_user_get_login_frequency: (skip) - * @object: A #GsdAccountsUser. - * - * Gets the value of the "LoginFrequency" D-Bus property. - * - * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - * - * Returns: The property value. - */ -guint64 -gsd_accounts_user_get_login_frequency (GsdAccountsUser *object) -{ - return GSD_ACCOUNTS_USER_GET_IFACE (object)->get_login_frequency (object); -} - -/** - * gsd_accounts_user_set_login_frequency: (skip) - * @object: A #GsdAccountsUser. - * @value: The value to set. - * - * Sets the "LoginFrequency" D-Bus property to @value. - * - * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. - */ -void -gsd_accounts_user_set_login_frequency (GsdAccountsUser *object, guint64 value) -{ - g_object_set (G_OBJECT (object), "login-frequency", value, NULL); -} - -/** - * gsd_accounts_user_get_login_time: (skip) - * @object: A #GsdAccountsUser. - * - * Gets the value of the "LoginTime" D-Bus property. - * - * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - * - * Returns: The property value. - */ -gint64 -gsd_accounts_user_get_login_time (GsdAccountsUser *object) -{ - return GSD_ACCOUNTS_USER_GET_IFACE (object)->get_login_time (object); -} - -/** - * gsd_accounts_user_set_login_time: (skip) - * @object: A #GsdAccountsUser. - * @value: The value to set. - * - * Sets the "LoginTime" D-Bus property to @value. - * - * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. - */ -void -gsd_accounts_user_set_login_time (GsdAccountsUser *object, gint64 value) -{ - g_object_set (G_OBJECT (object), "login-time", value, NULL); -} - -/** - * gsd_accounts_user_get_login_history: (skip) - * @object: A #GsdAccountsUser. - * - * Gets the value of the "LoginHistory" D-Bus property. - * - * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - * - * The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use gsd_accounts_user_dup_login_history() if on another thread. - * - * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. - */ -GVariant * -gsd_accounts_user_get_login_history (GsdAccountsUser *object) -{ - return GSD_ACCOUNTS_USER_GET_IFACE (object)->get_login_history (object); -} - -/** - * gsd_accounts_user_dup_login_history: (skip) - * @object: A #GsdAccountsUser. - * - * Gets a copy of the "LoginHistory" D-Bus property. - * - * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - * - * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_variant_unref(). - */ -GVariant * -gsd_accounts_user_dup_login_history (GsdAccountsUser *object) -{ - GVariant *value; - g_object_get (G_OBJECT (object), "login-history", &value, NULL); - return value; -} - -/** - * gsd_accounts_user_set_login_history: (skip) - * @object: A #GsdAccountsUser. - * @value: The value to set. - * - * Sets the "LoginHistory" D-Bus property to @value. - * - * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. - */ -void -gsd_accounts_user_set_login_history (GsdAccountsUser *object, GVariant *value) -{ - g_object_set (G_OBJECT (object), "login-history", value, NULL); -} - -/** - * gsd_accounts_user_get_icon_file: (skip) - * @object: A #GsdAccountsUser. - * - * Gets the value of the "IconFile" D-Bus property. - * - * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - * - * The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use gsd_accounts_user_dup_icon_file() if on another thread. - * - * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. - */ -const gchar * -gsd_accounts_user_get_icon_file (GsdAccountsUser *object) -{ - return GSD_ACCOUNTS_USER_GET_IFACE (object)->get_icon_file (object); -} - -/** - * gsd_accounts_user_dup_icon_file: (skip) - * @object: A #GsdAccountsUser. - * - * Gets a copy of the "IconFile" D-Bus property. - * - * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - * - * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free(). - */ -gchar * -gsd_accounts_user_dup_icon_file (GsdAccountsUser *object) -{ - gchar *value; - g_object_get (G_OBJECT (object), "icon-file", &value, NULL); - return value; -} - -/** - * gsd_accounts_user_set_icon_file: (skip) - * @object: A #GsdAccountsUser. - * @value: The value to set. - * - * Sets the "IconFile" D-Bus property to @value. - * - * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. - */ -void -gsd_accounts_user_set_icon_file (GsdAccountsUser *object, const gchar *value) -{ - g_object_set (G_OBJECT (object), "icon-file", value, NULL); -} - -/** - * gsd_accounts_user_get_locked: (skip) - * @object: A #GsdAccountsUser. - * - * Gets the value of the "Locked" D-Bus property. - * - * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - * - * Returns: The property value. - */ -gboolean -gsd_accounts_user_get_locked (GsdAccountsUser *object) -{ - return GSD_ACCOUNTS_USER_GET_IFACE (object)->get_locked (object); -} - -/** - * gsd_accounts_user_set_locked: (skip) - * @object: A #GsdAccountsUser. - * @value: The value to set. - * - * Sets the "Locked" D-Bus property to @value. - * - * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. - */ -void -gsd_accounts_user_set_locked (GsdAccountsUser *object, gboolean value) -{ - g_object_set (G_OBJECT (object), "locked", value, NULL); -} - -/** - * gsd_accounts_user_get_password_mode: (skip) - * @object: A #GsdAccountsUser. - * - * Gets the value of the "PasswordMode" D-Bus property. - * - * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - * - * Returns: The property value. - */ -gint -gsd_accounts_user_get_password_mode (GsdAccountsUser *object) -{ - return GSD_ACCOUNTS_USER_GET_IFACE (object)->get_password_mode (object); -} - -/** - * gsd_accounts_user_set_password_mode: (skip) - * @object: A #GsdAccountsUser. - * @value: The value to set. - * - * Sets the "PasswordMode" D-Bus property to @value. - * - * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. - */ -void -gsd_accounts_user_set_password_mode (GsdAccountsUser *object, gint value) -{ - g_object_set (G_OBJECT (object), "password-mode", value, NULL); -} - -/** - * gsd_accounts_user_get_password_hint: (skip) - * @object: A #GsdAccountsUser. - * - * Gets the value of the "PasswordHint" D-Bus property. - * - * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - * - * The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use gsd_accounts_user_dup_password_hint() if on another thread. - * - * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. - */ -const gchar * -gsd_accounts_user_get_password_hint (GsdAccountsUser *object) -{ - return GSD_ACCOUNTS_USER_GET_IFACE (object)->get_password_hint (object); -} - -/** - * gsd_accounts_user_dup_password_hint: (skip) - * @object: A #GsdAccountsUser. - * - * Gets a copy of the "PasswordHint" D-Bus property. - * - * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - * - * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free(). - */ -gchar * -gsd_accounts_user_dup_password_hint (GsdAccountsUser *object) -{ - gchar *value; - g_object_get (G_OBJECT (object), "password-hint", &value, NULL); - return value; -} - -/** - * gsd_accounts_user_set_password_hint: (skip) - * @object: A #GsdAccountsUser. - * @value: The value to set. - * - * Sets the "PasswordHint" D-Bus property to @value. - * - * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. - */ -void -gsd_accounts_user_set_password_hint (GsdAccountsUser *object, const gchar *value) -{ - g_object_set (G_OBJECT (object), "password-hint", value, NULL); -} - -/** - * gsd_accounts_user_get_automatic_login: (skip) - * @object: A #GsdAccountsUser. - * - * Gets the value of the "AutomaticLogin" D-Bus property. - * - * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - * - * Returns: The property value. - */ -gboolean -gsd_accounts_user_get_automatic_login (GsdAccountsUser *object) -{ - return GSD_ACCOUNTS_USER_GET_IFACE (object)->get_automatic_login (object); -} - -/** - * gsd_accounts_user_set_automatic_login: (skip) - * @object: A #GsdAccountsUser. - * @value: The value to set. - * - * Sets the "AutomaticLogin" D-Bus property to @value. - * - * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. - */ -void -gsd_accounts_user_set_automatic_login (GsdAccountsUser *object, gboolean value) -{ - g_object_set (G_OBJECT (object), "automatic-login", value, NULL); -} - -/** - * gsd_accounts_user_get_system_account: (skip) - * @object: A #GsdAccountsUser. - * - * Gets the value of the "SystemAccount" D-Bus property. - * - * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - * - * Returns: The property value. - */ -gboolean -gsd_accounts_user_get_system_account (GsdAccountsUser *object) -{ - return GSD_ACCOUNTS_USER_GET_IFACE (object)->get_system_account (object); -} - -/** - * gsd_accounts_user_set_system_account: (skip) - * @object: A #GsdAccountsUser. - * @value: The value to set. - * - * Sets the "SystemAccount" D-Bus property to @value. - * - * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. - */ -void -gsd_accounts_user_set_system_account (GsdAccountsUser *object, gboolean value) -{ - g_object_set (G_OBJECT (object), "system-account", value, NULL); -} - -/** - * gsd_accounts_user_get_local_account: (skip) - * @object: A #GsdAccountsUser. - * - * Gets the value of the "LocalAccount" D-Bus property. - * - * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - * - * Returns: The property value. - */ -gboolean -gsd_accounts_user_get_local_account (GsdAccountsUser *object) -{ - return GSD_ACCOUNTS_USER_GET_IFACE (object)->get_local_account (object); -} - -/** - * gsd_accounts_user_set_local_account: (skip) - * @object: A #GsdAccountsUser. - * @value: The value to set. - * - * Sets the "LocalAccount" D-Bus property to @value. - * - * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. - */ -void -gsd_accounts_user_set_local_account (GsdAccountsUser *object, gboolean value) -{ - g_object_set (G_OBJECT (object), "local-account", value, NULL); -} - -/** - * gsd_accounts_user_emit_changed: - * @object: A #GsdAccountsUser. - * - * Emits the "Changed" D-Bus signal. - */ -void -gsd_accounts_user_emit_changed ( - GsdAccountsUser *object) -{ - g_signal_emit_by_name (object, "changed"); -} - -/** - * gsd_accounts_user_call_set_user_name: - * @proxy: A #GsdAccountsUserProxy. - * @arg_name: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. - * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. - * @user_data: User data to pass to @callback. - * - * Asynchronously invokes the SetUserName() D-Bus method on @proxy. - * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. - * You can then call gsd_accounts_user_call_set_user_name_finish() to get the result of the operation. - * - * See gsd_accounts_user_call_set_user_name_sync() for the synchronous, blocking version of this method. - */ -void -gsd_accounts_user_call_set_user_name ( - GsdAccountsUser *proxy, - const gchar *arg_name, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) -{ - g_dbus_proxy_call (G_DBUS_PROXY (proxy), - "SetUserName", - g_variant_new ("(s)", - arg_name), - G_DBUS_CALL_FLAGS_NONE, - -1, - cancellable, - callback, - user_data); -} - -/** - * gsd_accounts_user_call_set_user_name_finish: - * @proxy: A #GsdAccountsUserProxy. - * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_accounts_user_call_set_user_name(). - * @error: Return location for error or %NULL. - * - * Finishes an operation started with gsd_accounts_user_call_set_user_name(). - * - * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. - */ -gboolean -gsd_accounts_user_call_set_user_name_finish ( - GsdAccountsUser *proxy, - GAsyncResult *res, - GError **error) -{ - GVariant *_ret; - _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); - if (_ret == NULL) - goto _out; - g_variant_get (_ret, - "()"); - g_variant_unref (_ret); -_out: - return _ret != NULL; -} - -/** - * gsd_accounts_user_call_set_user_name_sync: - * @proxy: A #GsdAccountsUserProxy. - * @arg_name: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. - * @error: Return location for error or %NULL. - * - * Synchronously invokes the SetUserName() D-Bus method on @proxy. The calling thread is blocked until a reply is received. - * - * See gsd_accounts_user_call_set_user_name() for the asynchronous version of this method. - * - * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. - */ -gboolean -gsd_accounts_user_call_set_user_name_sync ( - GsdAccountsUser *proxy, - const gchar *arg_name, - GCancellable *cancellable, - GError **error) -{ - GVariant *_ret; - _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), - "SetUserName", - g_variant_new ("(s)", - arg_name), - G_DBUS_CALL_FLAGS_NONE, - -1, - cancellable, - error); - if (_ret == NULL) - goto _out; - g_variant_get (_ret, - "()"); - g_variant_unref (_ret); -_out: - return _ret != NULL; -} - -/** - * gsd_accounts_user_call_set_real_name: - * @proxy: A #GsdAccountsUserProxy. - * @arg_name: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. - * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. - * @user_data: User data to pass to @callback. - * - * Asynchronously invokes the SetRealName() D-Bus method on @proxy. - * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. - * You can then call gsd_accounts_user_call_set_real_name_finish() to get the result of the operation. - * - * See gsd_accounts_user_call_set_real_name_sync() for the synchronous, blocking version of this method. - */ -void -gsd_accounts_user_call_set_real_name ( - GsdAccountsUser *proxy, - const gchar *arg_name, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) -{ - g_dbus_proxy_call (G_DBUS_PROXY (proxy), - "SetRealName", - g_variant_new ("(s)", - arg_name), - G_DBUS_CALL_FLAGS_NONE, - -1, - cancellable, - callback, - user_data); -} - -/** - * gsd_accounts_user_call_set_real_name_finish: - * @proxy: A #GsdAccountsUserProxy. - * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_accounts_user_call_set_real_name(). - * @error: Return location for error or %NULL. - * - * Finishes an operation started with gsd_accounts_user_call_set_real_name(). - * - * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. - */ -gboolean -gsd_accounts_user_call_set_real_name_finish ( - GsdAccountsUser *proxy, - GAsyncResult *res, - GError **error) -{ - GVariant *_ret; - _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); - if (_ret == NULL) - goto _out; - g_variant_get (_ret, - "()"); - g_variant_unref (_ret); -_out: - return _ret != NULL; -} - -/** - * gsd_accounts_user_call_set_real_name_sync: - * @proxy: A #GsdAccountsUserProxy. - * @arg_name: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. - * @error: Return location for error or %NULL. - * - * Synchronously invokes the SetRealName() D-Bus method on @proxy. The calling thread is blocked until a reply is received. - * - * See gsd_accounts_user_call_set_real_name() for the asynchronous version of this method. - * - * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. - */ -gboolean -gsd_accounts_user_call_set_real_name_sync ( - GsdAccountsUser *proxy, - const gchar *arg_name, - GCancellable *cancellable, - GError **error) -{ - GVariant *_ret; - _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), - "SetRealName", - g_variant_new ("(s)", - arg_name), - G_DBUS_CALL_FLAGS_NONE, - -1, - cancellable, - error); - if (_ret == NULL) - goto _out; - g_variant_get (_ret, - "()"); - g_variant_unref (_ret); -_out: - return _ret != NULL; -} - -/** - * gsd_accounts_user_call_set_email: - * @proxy: A #GsdAccountsUserProxy. - * @arg_email: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. - * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. - * @user_data: User data to pass to @callback. - * - * Asynchronously invokes the SetEmail() D-Bus method on @proxy. - * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. - * You can then call gsd_accounts_user_call_set_email_finish() to get the result of the operation. - * - * See gsd_accounts_user_call_set_email_sync() for the synchronous, blocking version of this method. - */ -void -gsd_accounts_user_call_set_email ( - GsdAccountsUser *proxy, - const gchar *arg_email, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) -{ - g_dbus_proxy_call (G_DBUS_PROXY (proxy), - "SetEmail", - g_variant_new ("(s)", - arg_email), - G_DBUS_CALL_FLAGS_NONE, - -1, - cancellable, - callback, - user_data); -} - -/** - * gsd_accounts_user_call_set_email_finish: - * @proxy: A #GsdAccountsUserProxy. - * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_accounts_user_call_set_email(). - * @error: Return location for error or %NULL. - * - * Finishes an operation started with gsd_accounts_user_call_set_email(). - * - * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. - */ -gboolean -gsd_accounts_user_call_set_email_finish ( - GsdAccountsUser *proxy, - GAsyncResult *res, - GError **error) -{ - GVariant *_ret; - _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); - if (_ret == NULL) - goto _out; - g_variant_get (_ret, - "()"); - g_variant_unref (_ret); -_out: - return _ret != NULL; -} - -/** - * gsd_accounts_user_call_set_email_sync: - * @proxy: A #GsdAccountsUserProxy. - * @arg_email: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. - * @error: Return location for error or %NULL. - * - * Synchronously invokes the SetEmail() D-Bus method on @proxy. The calling thread is blocked until a reply is received. - * - * See gsd_accounts_user_call_set_email() for the asynchronous version of this method. - * - * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. - */ -gboolean -gsd_accounts_user_call_set_email_sync ( - GsdAccountsUser *proxy, - const gchar *arg_email, - GCancellable *cancellable, - GError **error) -{ - GVariant *_ret; - _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), - "SetEmail", - g_variant_new ("(s)", - arg_email), - G_DBUS_CALL_FLAGS_NONE, - -1, - cancellable, - error); - if (_ret == NULL) - goto _out; - g_variant_get (_ret, - "()"); - g_variant_unref (_ret); -_out: - return _ret != NULL; -} - -/** - * gsd_accounts_user_call_set_language: - * @proxy: A #GsdAccountsUserProxy. - * @arg_language: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. - * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. - * @user_data: User data to pass to @callback. - * - * Asynchronously invokes the SetLanguage() D-Bus method on @proxy. - * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. - * You can then call gsd_accounts_user_call_set_language_finish() to get the result of the operation. - * - * See gsd_accounts_user_call_set_language_sync() for the synchronous, blocking version of this method. - */ -void -gsd_accounts_user_call_set_language ( - GsdAccountsUser *proxy, - const gchar *arg_language, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) -{ - g_dbus_proxy_call (G_DBUS_PROXY (proxy), - "SetLanguage", - g_variant_new ("(s)", - arg_language), - G_DBUS_CALL_FLAGS_NONE, - -1, - cancellable, - callback, - user_data); -} - -/** - * gsd_accounts_user_call_set_language_finish: - * @proxy: A #GsdAccountsUserProxy. - * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_accounts_user_call_set_language(). - * @error: Return location for error or %NULL. - * - * Finishes an operation started with gsd_accounts_user_call_set_language(). - * - * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. - */ -gboolean -gsd_accounts_user_call_set_language_finish ( - GsdAccountsUser *proxy, - GAsyncResult *res, - GError **error) -{ - GVariant *_ret; - _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); - if (_ret == NULL) - goto _out; - g_variant_get (_ret, - "()"); - g_variant_unref (_ret); -_out: - return _ret != NULL; -} - -/** - * gsd_accounts_user_call_set_language_sync: - * @proxy: A #GsdAccountsUserProxy. - * @arg_language: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. - * @error: Return location for error or %NULL. - * - * Synchronously invokes the SetLanguage() D-Bus method on @proxy. The calling thread is blocked until a reply is received. - * - * See gsd_accounts_user_call_set_language() for the asynchronous version of this method. - * - * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. - */ -gboolean -gsd_accounts_user_call_set_language_sync ( - GsdAccountsUser *proxy, - const gchar *arg_language, - GCancellable *cancellable, - GError **error) -{ - GVariant *_ret; - _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), - "SetLanguage", - g_variant_new ("(s)", - arg_language), - G_DBUS_CALL_FLAGS_NONE, - -1, - cancellable, - error); - if (_ret == NULL) - goto _out; - g_variant_get (_ret, - "()"); - g_variant_unref (_ret); -_out: - return _ret != NULL; -} - -/** - * gsd_accounts_user_call_set_xsession: - * @proxy: A #GsdAccountsUserProxy. - * @arg_x_session: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. - * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. - * @user_data: User data to pass to @callback. - * - * Asynchronously invokes the SetXSession() D-Bus method on @proxy. - * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. - * You can then call gsd_accounts_user_call_set_xsession_finish() to get the result of the operation. - * - * See gsd_accounts_user_call_set_xsession_sync() for the synchronous, blocking version of this method. - */ -void -gsd_accounts_user_call_set_xsession ( - GsdAccountsUser *proxy, - const gchar *arg_x_session, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) -{ - g_dbus_proxy_call (G_DBUS_PROXY (proxy), - "SetXSession", - g_variant_new ("(s)", - arg_x_session), - G_DBUS_CALL_FLAGS_NONE, - -1, - cancellable, - callback, - user_data); -} - -/** - * gsd_accounts_user_call_set_xsession_finish: - * @proxy: A #GsdAccountsUserProxy. - * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_accounts_user_call_set_xsession(). - * @error: Return location for error or %NULL. - * - * Finishes an operation started with gsd_accounts_user_call_set_xsession(). - * - * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. - */ -gboolean -gsd_accounts_user_call_set_xsession_finish ( - GsdAccountsUser *proxy, - GAsyncResult *res, - GError **error) -{ - GVariant *_ret; - _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); - if (_ret == NULL) - goto _out; - g_variant_get (_ret, - "()"); - g_variant_unref (_ret); -_out: - return _ret != NULL; -} - -/** - * gsd_accounts_user_call_set_xsession_sync: - * @proxy: A #GsdAccountsUserProxy. - * @arg_x_session: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. - * @error: Return location for error or %NULL. - * - * Synchronously invokes the SetXSession() D-Bus method on @proxy. The calling thread is blocked until a reply is received. - * - * See gsd_accounts_user_call_set_xsession() for the asynchronous version of this method. - * - * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. - */ -gboolean -gsd_accounts_user_call_set_xsession_sync ( - GsdAccountsUser *proxy, - const gchar *arg_x_session, - GCancellable *cancellable, - GError **error) -{ - GVariant *_ret; - _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), - "SetXSession", - g_variant_new ("(s)", - arg_x_session), - G_DBUS_CALL_FLAGS_NONE, - -1, - cancellable, - error); - if (_ret == NULL) - goto _out; - g_variant_get (_ret, - "()"); - g_variant_unref (_ret); -_out: - return _ret != NULL; -} - -/** - * gsd_accounts_user_call_set_location: - * @proxy: A #GsdAccountsUserProxy. - * @arg_location: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. - * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. - * @user_data: User data to pass to @callback. - * - * Asynchronously invokes the SetLocation() D-Bus method on @proxy. - * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. - * You can then call gsd_accounts_user_call_set_location_finish() to get the result of the operation. - * - * See gsd_accounts_user_call_set_location_sync() for the synchronous, blocking version of this method. - */ -void -gsd_accounts_user_call_set_location ( - GsdAccountsUser *proxy, - const gchar *arg_location, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) -{ - g_dbus_proxy_call (G_DBUS_PROXY (proxy), - "SetLocation", - g_variant_new ("(s)", - arg_location), - G_DBUS_CALL_FLAGS_NONE, - -1, - cancellable, - callback, - user_data); -} - -/** - * gsd_accounts_user_call_set_location_finish: - * @proxy: A #GsdAccountsUserProxy. - * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_accounts_user_call_set_location(). - * @error: Return location for error or %NULL. - * - * Finishes an operation started with gsd_accounts_user_call_set_location(). - * - * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. - */ -gboolean -gsd_accounts_user_call_set_location_finish ( - GsdAccountsUser *proxy, - GAsyncResult *res, - GError **error) -{ - GVariant *_ret; - _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); - if (_ret == NULL) - goto _out; - g_variant_get (_ret, - "()"); - g_variant_unref (_ret); -_out: - return _ret != NULL; -} - -/** - * gsd_accounts_user_call_set_location_sync: - * @proxy: A #GsdAccountsUserProxy. - * @arg_location: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. - * @error: Return location for error or %NULL. - * - * Synchronously invokes the SetLocation() D-Bus method on @proxy. The calling thread is blocked until a reply is received. - * - * See gsd_accounts_user_call_set_location() for the asynchronous version of this method. - * - * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. - */ -gboolean -gsd_accounts_user_call_set_location_sync ( - GsdAccountsUser *proxy, - const gchar *arg_location, - GCancellable *cancellable, - GError **error) -{ - GVariant *_ret; - _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), - "SetLocation", - g_variant_new ("(s)", - arg_location), - G_DBUS_CALL_FLAGS_NONE, - -1, - cancellable, - error); - if (_ret == NULL) - goto _out; - g_variant_get (_ret, - "()"); - g_variant_unref (_ret); -_out: - return _ret != NULL; -} - -/** - * gsd_accounts_user_call_set_home_directory: - * @proxy: A #GsdAccountsUserProxy. - * @arg_homedir: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. - * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. - * @user_data: User data to pass to @callback. - * - * Asynchronously invokes the SetHomeDirectory() D-Bus method on @proxy. - * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. - * You can then call gsd_accounts_user_call_set_home_directory_finish() to get the result of the operation. - * - * See gsd_accounts_user_call_set_home_directory_sync() for the synchronous, blocking version of this method. - */ -void -gsd_accounts_user_call_set_home_directory ( - GsdAccountsUser *proxy, - const gchar *arg_homedir, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) -{ - g_dbus_proxy_call (G_DBUS_PROXY (proxy), - "SetHomeDirectory", - g_variant_new ("(s)", - arg_homedir), - G_DBUS_CALL_FLAGS_NONE, - -1, - cancellable, - callback, - user_data); -} - -/** - * gsd_accounts_user_call_set_home_directory_finish: - * @proxy: A #GsdAccountsUserProxy. - * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_accounts_user_call_set_home_directory(). - * @error: Return location for error or %NULL. - * - * Finishes an operation started with gsd_accounts_user_call_set_home_directory(). - * - * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. - */ -gboolean -gsd_accounts_user_call_set_home_directory_finish ( - GsdAccountsUser *proxy, - GAsyncResult *res, - GError **error) -{ - GVariant *_ret; - _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); - if (_ret == NULL) - goto _out; - g_variant_get (_ret, - "()"); - g_variant_unref (_ret); -_out: - return _ret != NULL; -} - -/** - * gsd_accounts_user_call_set_home_directory_sync: - * @proxy: A #GsdAccountsUserProxy. - * @arg_homedir: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. - * @error: Return location for error or %NULL. - * - * Synchronously invokes the SetHomeDirectory() D-Bus method on @proxy. The calling thread is blocked until a reply is received. - * - * See gsd_accounts_user_call_set_home_directory() for the asynchronous version of this method. - * - * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. - */ -gboolean -gsd_accounts_user_call_set_home_directory_sync ( - GsdAccountsUser *proxy, - const gchar *arg_homedir, - GCancellable *cancellable, - GError **error) -{ - GVariant *_ret; - _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), - "SetHomeDirectory", - g_variant_new ("(s)", - arg_homedir), - G_DBUS_CALL_FLAGS_NONE, - -1, - cancellable, - error); - if (_ret == NULL) - goto _out; - g_variant_get (_ret, - "()"); - g_variant_unref (_ret); -_out: - return _ret != NULL; -} - -/** - * gsd_accounts_user_call_set_shell: - * @proxy: A #GsdAccountsUserProxy. - * @arg_shell: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. - * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. - * @user_data: User data to pass to @callback. - * - * Asynchronously invokes the SetShell() D-Bus method on @proxy. - * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. - * You can then call gsd_accounts_user_call_set_shell_finish() to get the result of the operation. - * - * See gsd_accounts_user_call_set_shell_sync() for the synchronous, blocking version of this method. - */ -void -gsd_accounts_user_call_set_shell ( - GsdAccountsUser *proxy, - const gchar *arg_shell, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) -{ - g_dbus_proxy_call (G_DBUS_PROXY (proxy), - "SetShell", - g_variant_new ("(s)", - arg_shell), - G_DBUS_CALL_FLAGS_NONE, - -1, - cancellable, - callback, - user_data); -} - -/** - * gsd_accounts_user_call_set_shell_finish: - * @proxy: A #GsdAccountsUserProxy. - * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_accounts_user_call_set_shell(). - * @error: Return location for error or %NULL. - * - * Finishes an operation started with gsd_accounts_user_call_set_shell(). - * - * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. - */ -gboolean -gsd_accounts_user_call_set_shell_finish ( - GsdAccountsUser *proxy, - GAsyncResult *res, - GError **error) -{ - GVariant *_ret; - _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); - if (_ret == NULL) - goto _out; - g_variant_get (_ret, - "()"); - g_variant_unref (_ret); -_out: - return _ret != NULL; -} - -/** - * gsd_accounts_user_call_set_shell_sync: - * @proxy: A #GsdAccountsUserProxy. - * @arg_shell: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. - * @error: Return location for error or %NULL. - * - * Synchronously invokes the SetShell() D-Bus method on @proxy. The calling thread is blocked until a reply is received. - * - * See gsd_accounts_user_call_set_shell() for the asynchronous version of this method. - * - * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. - */ -gboolean -gsd_accounts_user_call_set_shell_sync ( - GsdAccountsUser *proxy, - const gchar *arg_shell, - GCancellable *cancellable, - GError **error) -{ - GVariant *_ret; - _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), - "SetShell", - g_variant_new ("(s)", - arg_shell), - G_DBUS_CALL_FLAGS_NONE, - -1, - cancellable, - error); - if (_ret == NULL) - goto _out; - g_variant_get (_ret, - "()"); - g_variant_unref (_ret); -_out: - return _ret != NULL; -} - -/** - * gsd_accounts_user_call_set_icon_file: - * @proxy: A #GsdAccountsUserProxy. - * @arg_filename: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. - * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. - * @user_data: User data to pass to @callback. - * - * Asynchronously invokes the SetIconFile() D-Bus method on @proxy. - * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. - * You can then call gsd_accounts_user_call_set_icon_file_finish() to get the result of the operation. - * - * See gsd_accounts_user_call_set_icon_file_sync() for the synchronous, blocking version of this method. - */ -void -gsd_accounts_user_call_set_icon_file ( - GsdAccountsUser *proxy, - const gchar *arg_filename, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) -{ - g_dbus_proxy_call (G_DBUS_PROXY (proxy), - "SetIconFile", - g_variant_new ("(s)", - arg_filename), - G_DBUS_CALL_FLAGS_NONE, - -1, - cancellable, - callback, - user_data); -} - -/** - * gsd_accounts_user_call_set_icon_file_finish: - * @proxy: A #GsdAccountsUserProxy. - * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_accounts_user_call_set_icon_file(). - * @error: Return location for error or %NULL. - * - * Finishes an operation started with gsd_accounts_user_call_set_icon_file(). - * - * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. - */ -gboolean -gsd_accounts_user_call_set_icon_file_finish ( - GsdAccountsUser *proxy, - GAsyncResult *res, - GError **error) -{ - GVariant *_ret; - _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); - if (_ret == NULL) - goto _out; - g_variant_get (_ret, - "()"); - g_variant_unref (_ret); -_out: - return _ret != NULL; -} - -/** - * gsd_accounts_user_call_set_icon_file_sync: - * @proxy: A #GsdAccountsUserProxy. - * @arg_filename: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. - * @error: Return location for error or %NULL. - * - * Synchronously invokes the SetIconFile() D-Bus method on @proxy. The calling thread is blocked until a reply is received. - * - * See gsd_accounts_user_call_set_icon_file() for the asynchronous version of this method. - * - * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. - */ -gboolean -gsd_accounts_user_call_set_icon_file_sync ( - GsdAccountsUser *proxy, - const gchar *arg_filename, - GCancellable *cancellable, - GError **error) -{ - GVariant *_ret; - _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), - "SetIconFile", - g_variant_new ("(s)", - arg_filename), - G_DBUS_CALL_FLAGS_NONE, - -1, - cancellable, - error); - if (_ret == NULL) - goto _out; - g_variant_get (_ret, - "()"); - g_variant_unref (_ret); -_out: - return _ret != NULL; -} - -/** - * gsd_accounts_user_call_set_locked: - * @proxy: A #GsdAccountsUserProxy. - * @arg_locked: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. - * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. - * @user_data: User data to pass to @callback. - * - * Asynchronously invokes the SetLocked() D-Bus method on @proxy. - * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. - * You can then call gsd_accounts_user_call_set_locked_finish() to get the result of the operation. - * - * See gsd_accounts_user_call_set_locked_sync() for the synchronous, blocking version of this method. - */ -void -gsd_accounts_user_call_set_locked ( - GsdAccountsUser *proxy, - gboolean arg_locked, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) -{ - g_dbus_proxy_call (G_DBUS_PROXY (proxy), - "SetLocked", - g_variant_new ("(b)", - arg_locked), - G_DBUS_CALL_FLAGS_NONE, - -1, - cancellable, - callback, - user_data); -} - -/** - * gsd_accounts_user_call_set_locked_finish: - * @proxy: A #GsdAccountsUserProxy. - * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_accounts_user_call_set_locked(). - * @error: Return location for error or %NULL. - * - * Finishes an operation started with gsd_accounts_user_call_set_locked(). - * - * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. - */ -gboolean -gsd_accounts_user_call_set_locked_finish ( - GsdAccountsUser *proxy, - GAsyncResult *res, - GError **error) -{ - GVariant *_ret; - _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); - if (_ret == NULL) - goto _out; - g_variant_get (_ret, - "()"); - g_variant_unref (_ret); -_out: - return _ret != NULL; -} - -/** - * gsd_accounts_user_call_set_locked_sync: - * @proxy: A #GsdAccountsUserProxy. - * @arg_locked: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. - * @error: Return location for error or %NULL. - * - * Synchronously invokes the SetLocked() D-Bus method on @proxy. The calling thread is blocked until a reply is received. - * - * See gsd_accounts_user_call_set_locked() for the asynchronous version of this method. - * - * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. - */ -gboolean -gsd_accounts_user_call_set_locked_sync ( - GsdAccountsUser *proxy, - gboolean arg_locked, - GCancellable *cancellable, - GError **error) -{ - GVariant *_ret; - _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), - "SetLocked", - g_variant_new ("(b)", - arg_locked), - G_DBUS_CALL_FLAGS_NONE, - -1, - cancellable, - error); - if (_ret == NULL) - goto _out; - g_variant_get (_ret, - "()"); - g_variant_unref (_ret); -_out: - return _ret != NULL; -} - -/** - * gsd_accounts_user_call_set_account_type: - * @proxy: A #GsdAccountsUserProxy. - * @arg_accountType: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. - * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. - * @user_data: User data to pass to @callback. - * - * Asynchronously invokes the SetAccountType() D-Bus method on @proxy. - * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. - * You can then call gsd_accounts_user_call_set_account_type_finish() to get the result of the operation. - * - * See gsd_accounts_user_call_set_account_type_sync() for the synchronous, blocking version of this method. - */ -void -gsd_accounts_user_call_set_account_type ( - GsdAccountsUser *proxy, - gint arg_accountType, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) -{ - g_dbus_proxy_call (G_DBUS_PROXY (proxy), - "SetAccountType", - g_variant_new ("(i)", - arg_accountType), - G_DBUS_CALL_FLAGS_NONE, - -1, - cancellable, - callback, - user_data); -} - -/** - * gsd_accounts_user_call_set_account_type_finish: - * @proxy: A #GsdAccountsUserProxy. - * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_accounts_user_call_set_account_type(). - * @error: Return location for error or %NULL. - * - * Finishes an operation started with gsd_accounts_user_call_set_account_type(). - * - * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. - */ -gboolean -gsd_accounts_user_call_set_account_type_finish ( - GsdAccountsUser *proxy, - GAsyncResult *res, - GError **error) -{ - GVariant *_ret; - _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); - if (_ret == NULL) - goto _out; - g_variant_get (_ret, - "()"); - g_variant_unref (_ret); -_out: - return _ret != NULL; -} - -/** - * gsd_accounts_user_call_set_account_type_sync: - * @proxy: A #GsdAccountsUserProxy. - * @arg_accountType: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. - * @error: Return location for error or %NULL. - * - * Synchronously invokes the SetAccountType() D-Bus method on @proxy. The calling thread is blocked until a reply is received. - * - * See gsd_accounts_user_call_set_account_type() for the asynchronous version of this method. - * - * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. - */ -gboolean -gsd_accounts_user_call_set_account_type_sync ( - GsdAccountsUser *proxy, - gint arg_accountType, - GCancellable *cancellable, - GError **error) -{ - GVariant *_ret; - _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), - "SetAccountType", - g_variant_new ("(i)", - arg_accountType), - G_DBUS_CALL_FLAGS_NONE, - -1, - cancellable, - error); - if (_ret == NULL) - goto _out; - g_variant_get (_ret, - "()"); - g_variant_unref (_ret); -_out: - return _ret != NULL; -} - -/** - * gsd_accounts_user_call_set_password_mode: - * @proxy: A #GsdAccountsUserProxy. - * @arg_mode: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. - * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. - * @user_data: User data to pass to @callback. - * - * Asynchronously invokes the SetPasswordMode() D-Bus method on @proxy. - * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. - * You can then call gsd_accounts_user_call_set_password_mode_finish() to get the result of the operation. - * - * See gsd_accounts_user_call_set_password_mode_sync() for the synchronous, blocking version of this method. - */ -void -gsd_accounts_user_call_set_password_mode ( - GsdAccountsUser *proxy, - gint arg_mode, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) -{ - g_dbus_proxy_call (G_DBUS_PROXY (proxy), - "SetPasswordMode", - g_variant_new ("(i)", - arg_mode), - G_DBUS_CALL_FLAGS_NONE, - -1, - cancellable, - callback, - user_data); -} - -/** - * gsd_accounts_user_call_set_password_mode_finish: - * @proxy: A #GsdAccountsUserProxy. - * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_accounts_user_call_set_password_mode(). - * @error: Return location for error or %NULL. - * - * Finishes an operation started with gsd_accounts_user_call_set_password_mode(). - * - * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. - */ -gboolean -gsd_accounts_user_call_set_password_mode_finish ( - GsdAccountsUser *proxy, - GAsyncResult *res, - GError **error) -{ - GVariant *_ret; - _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); - if (_ret == NULL) - goto _out; - g_variant_get (_ret, - "()"); - g_variant_unref (_ret); -_out: - return _ret != NULL; -} - -/** - * gsd_accounts_user_call_set_password_mode_sync: - * @proxy: A #GsdAccountsUserProxy. - * @arg_mode: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. - * @error: Return location for error or %NULL. - * - * Synchronously invokes the SetPasswordMode() D-Bus method on @proxy. The calling thread is blocked until a reply is received. - * - * See gsd_accounts_user_call_set_password_mode() for the asynchronous version of this method. - * - * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. - */ -gboolean -gsd_accounts_user_call_set_password_mode_sync ( - GsdAccountsUser *proxy, - gint arg_mode, - GCancellable *cancellable, - GError **error) -{ - GVariant *_ret; - _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), - "SetPasswordMode", - g_variant_new ("(i)", - arg_mode), - G_DBUS_CALL_FLAGS_NONE, - -1, - cancellable, - error); - if (_ret == NULL) - goto _out; - g_variant_get (_ret, - "()"); - g_variant_unref (_ret); -_out: - return _ret != NULL; -} - -/** - * gsd_accounts_user_call_set_password: - * @proxy: A #GsdAccountsUserProxy. - * @arg_password: Argument to pass with the method invocation. - * @arg_hint: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. - * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. - * @user_data: User data to pass to @callback. - * - * Asynchronously invokes the SetPassword() D-Bus method on @proxy. - * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. - * You can then call gsd_accounts_user_call_set_password_finish() to get the result of the operation. - * - * See gsd_accounts_user_call_set_password_sync() for the synchronous, blocking version of this method. - */ -void -gsd_accounts_user_call_set_password ( - GsdAccountsUser *proxy, - const gchar *arg_password, - const gchar *arg_hint, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) -{ - g_dbus_proxy_call (G_DBUS_PROXY (proxy), - "SetPassword", - g_variant_new ("(ss)", - arg_password, - arg_hint), - G_DBUS_CALL_FLAGS_NONE, - -1, - cancellable, - callback, - user_data); -} - -/** - * gsd_accounts_user_call_set_password_finish: - * @proxy: A #GsdAccountsUserProxy. - * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_accounts_user_call_set_password(). - * @error: Return location for error or %NULL. - * - * Finishes an operation started with gsd_accounts_user_call_set_password(). - * - * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. - */ -gboolean -gsd_accounts_user_call_set_password_finish ( - GsdAccountsUser *proxy, - GAsyncResult *res, - GError **error) -{ - GVariant *_ret; - _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); - if (_ret == NULL) - goto _out; - g_variant_get (_ret, - "()"); - g_variant_unref (_ret); -_out: - return _ret != NULL; -} - -/** - * gsd_accounts_user_call_set_password_sync: - * @proxy: A #GsdAccountsUserProxy. - * @arg_password: Argument to pass with the method invocation. - * @arg_hint: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. - * @error: Return location for error or %NULL. - * - * Synchronously invokes the SetPassword() D-Bus method on @proxy. The calling thread is blocked until a reply is received. - * - * See gsd_accounts_user_call_set_password() for the asynchronous version of this method. - * - * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. - */ -gboolean -gsd_accounts_user_call_set_password_sync ( - GsdAccountsUser *proxy, - const gchar *arg_password, - const gchar *arg_hint, - GCancellable *cancellable, - GError **error) -{ - GVariant *_ret; - _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), - "SetPassword", - g_variant_new ("(ss)", - arg_password, - arg_hint), - G_DBUS_CALL_FLAGS_NONE, - -1, - cancellable, - error); - if (_ret == NULL) - goto _out; - g_variant_get (_ret, - "()"); - g_variant_unref (_ret); -_out: - return _ret != NULL; -} - -/** - * gsd_accounts_user_call_set_password_hint: - * @proxy: A #GsdAccountsUserProxy. - * @arg_hint: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. - * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. - * @user_data: User data to pass to @callback. - * - * Asynchronously invokes the SetPasswordHint() D-Bus method on @proxy. - * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. - * You can then call gsd_accounts_user_call_set_password_hint_finish() to get the result of the operation. - * - * See gsd_accounts_user_call_set_password_hint_sync() for the synchronous, blocking version of this method. - */ -void -gsd_accounts_user_call_set_password_hint ( - GsdAccountsUser *proxy, - const gchar *arg_hint, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) -{ - g_dbus_proxy_call (G_DBUS_PROXY (proxy), - "SetPasswordHint", - g_variant_new ("(s)", - arg_hint), - G_DBUS_CALL_FLAGS_NONE, - -1, - cancellable, - callback, - user_data); -} - -/** - * gsd_accounts_user_call_set_password_hint_finish: - * @proxy: A #GsdAccountsUserProxy. - * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_accounts_user_call_set_password_hint(). - * @error: Return location for error or %NULL. - * - * Finishes an operation started with gsd_accounts_user_call_set_password_hint(). - * - * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. - */ -gboolean -gsd_accounts_user_call_set_password_hint_finish ( - GsdAccountsUser *proxy, - GAsyncResult *res, - GError **error) -{ - GVariant *_ret; - _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); - if (_ret == NULL) - goto _out; - g_variant_get (_ret, - "()"); - g_variant_unref (_ret); -_out: - return _ret != NULL; -} - -/** - * gsd_accounts_user_call_set_password_hint_sync: - * @proxy: A #GsdAccountsUserProxy. - * @arg_hint: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. - * @error: Return location for error or %NULL. - * - * Synchronously invokes the SetPasswordHint() D-Bus method on @proxy. The calling thread is blocked until a reply is received. - * - * See gsd_accounts_user_call_set_password_hint() for the asynchronous version of this method. - * - * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. - */ -gboolean -gsd_accounts_user_call_set_password_hint_sync ( - GsdAccountsUser *proxy, - const gchar *arg_hint, - GCancellable *cancellable, - GError **error) -{ - GVariant *_ret; - _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), - "SetPasswordHint", - g_variant_new ("(s)", - arg_hint), - G_DBUS_CALL_FLAGS_NONE, - -1, - cancellable, - error); - if (_ret == NULL) - goto _out; - g_variant_get (_ret, - "()"); - g_variant_unref (_ret); -_out: - return _ret != NULL; -} - -/** - * gsd_accounts_user_call_set_automatic_login: - * @proxy: A #GsdAccountsUserProxy. - * @arg_enabled: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. - * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. - * @user_data: User data to pass to @callback. - * - * Asynchronously invokes the SetAutomaticLogin() D-Bus method on @proxy. - * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. - * You can then call gsd_accounts_user_call_set_automatic_login_finish() to get the result of the operation. - * - * See gsd_accounts_user_call_set_automatic_login_sync() for the synchronous, blocking version of this method. - */ -void -gsd_accounts_user_call_set_automatic_login ( - GsdAccountsUser *proxy, - gboolean arg_enabled, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) -{ - g_dbus_proxy_call (G_DBUS_PROXY (proxy), - "SetAutomaticLogin", - g_variant_new ("(b)", - arg_enabled), - G_DBUS_CALL_FLAGS_NONE, - -1, - cancellable, - callback, - user_data); -} - -/** - * gsd_accounts_user_call_set_automatic_login_finish: - * @proxy: A #GsdAccountsUserProxy. - * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_accounts_user_call_set_automatic_login(). - * @error: Return location for error or %NULL. - * - * Finishes an operation started with gsd_accounts_user_call_set_automatic_login(). - * - * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. - */ -gboolean -gsd_accounts_user_call_set_automatic_login_finish ( - GsdAccountsUser *proxy, - GAsyncResult *res, - GError **error) -{ - GVariant *_ret; - _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); - if (_ret == NULL) - goto _out; - g_variant_get (_ret, - "()"); - g_variant_unref (_ret); -_out: - return _ret != NULL; -} - -/** - * gsd_accounts_user_call_set_automatic_login_sync: - * @proxy: A #GsdAccountsUserProxy. - * @arg_enabled: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. - * @error: Return location for error or %NULL. - * - * Synchronously invokes the SetAutomaticLogin() D-Bus method on @proxy. The calling thread is blocked until a reply is received. - * - * See gsd_accounts_user_call_set_automatic_login() for the asynchronous version of this method. - * - * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. - */ -gboolean -gsd_accounts_user_call_set_automatic_login_sync ( - GsdAccountsUser *proxy, - gboolean arg_enabled, - GCancellable *cancellable, - GError **error) -{ - GVariant *_ret; - _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), - "SetAutomaticLogin", - g_variant_new ("(b)", - arg_enabled), - G_DBUS_CALL_FLAGS_NONE, - -1, - cancellable, - error); - if (_ret == NULL) - goto _out; - g_variant_get (_ret, - "()"); - g_variant_unref (_ret); -_out: - return _ret != NULL; -} - -/** - * gsd_accounts_user_call_get_password_expiration_policy: - * @proxy: A #GsdAccountsUserProxy. - * @cancellable: (allow-none): A #GCancellable or %NULL. - * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. - * @user_data: User data to pass to @callback. - * - * Asynchronously invokes the GetPasswordExpirationPolicy() D-Bus method on @proxy. - * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. - * You can then call gsd_accounts_user_call_get_password_expiration_policy_finish() to get the result of the operation. - * - * See gsd_accounts_user_call_get_password_expiration_policy_sync() for the synchronous, blocking version of this method. - */ -void -gsd_accounts_user_call_get_password_expiration_policy ( - GsdAccountsUser *proxy, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) -{ - g_dbus_proxy_call (G_DBUS_PROXY (proxy), - "GetPasswordExpirationPolicy", - g_variant_new ("()"), - G_DBUS_CALL_FLAGS_NONE, - -1, - cancellable, - callback, - user_data); -} - -/** - * gsd_accounts_user_call_get_password_expiration_policy_finish: - * @proxy: A #GsdAccountsUserProxy. - * @out_expiration_time: (out): Return location for return parameter or %NULL to ignore. - * @out_last_change_time: (out): Return location for return parameter or %NULL to ignore. - * @out_min_days_between_changes: (out): Return location for return parameter or %NULL to ignore. - * @out_max_days_between_changes: (out): Return location for return parameter or %NULL to ignore. - * @out_days_to_warn: (out): Return location for return parameter or %NULL to ignore. - * @out_days_after_expiration_until_lock: (out): Return location for return parameter or %NULL to ignore. - * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_accounts_user_call_get_password_expiration_policy(). - * @error: Return location for error or %NULL. - * - * Finishes an operation started with gsd_accounts_user_call_get_password_expiration_policy(). - * - * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. - */ -gboolean -gsd_accounts_user_call_get_password_expiration_policy_finish ( - GsdAccountsUser *proxy, - gint64 *out_expiration_time, - gint64 *out_last_change_time, - gint64 *out_min_days_between_changes, - gint64 *out_max_days_between_changes, - gint64 *out_days_to_warn, - gint64 *out_days_after_expiration_until_lock, - GAsyncResult *res, - GError **error) -{ - GVariant *_ret; - _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); - if (_ret == NULL) - goto _out; - g_variant_get (_ret, - "(xxxxxx)", - out_expiration_time, - out_last_change_time, - out_min_days_between_changes, - out_max_days_between_changes, - out_days_to_warn, - out_days_after_expiration_until_lock); - g_variant_unref (_ret); -_out: - return _ret != NULL; -} - -/** - * gsd_accounts_user_call_get_password_expiration_policy_sync: - * @proxy: A #GsdAccountsUserProxy. - * @out_expiration_time: (out): Return location for return parameter or %NULL to ignore. - * @out_last_change_time: (out): Return location for return parameter or %NULL to ignore. - * @out_min_days_between_changes: (out): Return location for return parameter or %NULL to ignore. - * @out_max_days_between_changes: (out): Return location for return parameter or %NULL to ignore. - * @out_days_to_warn: (out): Return location for return parameter or %NULL to ignore. - * @out_days_after_expiration_until_lock: (out): Return location for return parameter or %NULL to ignore. - * @cancellable: (allow-none): A #GCancellable or %NULL. - * @error: Return location for error or %NULL. - * - * Synchronously invokes the GetPasswordExpirationPolicy() D-Bus method on @proxy. The calling thread is blocked until a reply is received. - * - * See gsd_accounts_user_call_get_password_expiration_policy() for the asynchronous version of this method. - * - * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. - */ -gboolean -gsd_accounts_user_call_get_password_expiration_policy_sync ( - GsdAccountsUser *proxy, - gint64 *out_expiration_time, - gint64 *out_last_change_time, - gint64 *out_min_days_between_changes, - gint64 *out_max_days_between_changes, - gint64 *out_days_to_warn, - gint64 *out_days_after_expiration_until_lock, - GCancellable *cancellable, - GError **error) -{ - GVariant *_ret; - _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), - "GetPasswordExpirationPolicy", - g_variant_new ("()"), - G_DBUS_CALL_FLAGS_NONE, - -1, - cancellable, - error); - if (_ret == NULL) - goto _out; - g_variant_get (_ret, - "(xxxxxx)", - out_expiration_time, - out_last_change_time, - out_min_days_between_changes, - out_max_days_between_changes, - out_days_to_warn, - out_days_after_expiration_until_lock); - g_variant_unref (_ret); -_out: - return _ret != NULL; -} - -/** - * gsd_accounts_user_complete_set_user_name: - * @object: A #GsdAccountsUser. - * @invocation: (transfer full): A #GDBusMethodInvocation. - * - * Helper function used in service implementations to finish handling invocations of the SetUserName() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. - * - * This method will free @invocation, you cannot use it afterwards. - */ -void -gsd_accounts_user_complete_set_user_name ( - GsdAccountsUser *object, - GDBusMethodInvocation *invocation) -{ - g_dbus_method_invocation_return_value (invocation, - g_variant_new ("()")); -} - -/** - * gsd_accounts_user_complete_set_real_name: - * @object: A #GsdAccountsUser. - * @invocation: (transfer full): A #GDBusMethodInvocation. - * - * Helper function used in service implementations to finish handling invocations of the SetRealName() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. - * - * This method will free @invocation, you cannot use it afterwards. - */ -void -gsd_accounts_user_complete_set_real_name ( - GsdAccountsUser *object, - GDBusMethodInvocation *invocation) -{ - g_dbus_method_invocation_return_value (invocation, - g_variant_new ("()")); -} - -/** - * gsd_accounts_user_complete_set_email: - * @object: A #GsdAccountsUser. - * @invocation: (transfer full): A #GDBusMethodInvocation. - * - * Helper function used in service implementations to finish handling invocations of the SetEmail() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. - * - * This method will free @invocation, you cannot use it afterwards. - */ -void -gsd_accounts_user_complete_set_email ( - GsdAccountsUser *object, - GDBusMethodInvocation *invocation) -{ - g_dbus_method_invocation_return_value (invocation, - g_variant_new ("()")); -} - -/** - * gsd_accounts_user_complete_set_language: - * @object: A #GsdAccountsUser. - * @invocation: (transfer full): A #GDBusMethodInvocation. - * - * Helper function used in service implementations to finish handling invocations of the SetLanguage() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. - * - * This method will free @invocation, you cannot use it afterwards. - */ -void -gsd_accounts_user_complete_set_language ( - GsdAccountsUser *object, - GDBusMethodInvocation *invocation) -{ - g_dbus_method_invocation_return_value (invocation, - g_variant_new ("()")); -} - -/** - * gsd_accounts_user_complete_set_xsession: - * @object: A #GsdAccountsUser. - * @invocation: (transfer full): A #GDBusMethodInvocation. - * - * Helper function used in service implementations to finish handling invocations of the SetXSession() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. - * - * This method will free @invocation, you cannot use it afterwards. - */ -void -gsd_accounts_user_complete_set_xsession ( - GsdAccountsUser *object, - GDBusMethodInvocation *invocation) -{ - g_dbus_method_invocation_return_value (invocation, - g_variant_new ("()")); -} - -/** - * gsd_accounts_user_complete_set_location: - * @object: A #GsdAccountsUser. - * @invocation: (transfer full): A #GDBusMethodInvocation. - * - * Helper function used in service implementations to finish handling invocations of the SetLocation() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. - * - * This method will free @invocation, you cannot use it afterwards. - */ -void -gsd_accounts_user_complete_set_location ( - GsdAccountsUser *object, - GDBusMethodInvocation *invocation) -{ - g_dbus_method_invocation_return_value (invocation, - g_variant_new ("()")); -} - -/** - * gsd_accounts_user_complete_set_home_directory: - * @object: A #GsdAccountsUser. - * @invocation: (transfer full): A #GDBusMethodInvocation. - * - * Helper function used in service implementations to finish handling invocations of the SetHomeDirectory() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. - * - * This method will free @invocation, you cannot use it afterwards. - */ -void -gsd_accounts_user_complete_set_home_directory ( - GsdAccountsUser *object, - GDBusMethodInvocation *invocation) -{ - g_dbus_method_invocation_return_value (invocation, - g_variant_new ("()")); -} - -/** - * gsd_accounts_user_complete_set_shell: - * @object: A #GsdAccountsUser. - * @invocation: (transfer full): A #GDBusMethodInvocation. - * - * Helper function used in service implementations to finish handling invocations of the SetShell() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. - * - * This method will free @invocation, you cannot use it afterwards. - */ -void -gsd_accounts_user_complete_set_shell ( - GsdAccountsUser *object, - GDBusMethodInvocation *invocation) -{ - g_dbus_method_invocation_return_value (invocation, - g_variant_new ("()")); -} - -/** - * gsd_accounts_user_complete_set_icon_file: - * @object: A #GsdAccountsUser. - * @invocation: (transfer full): A #GDBusMethodInvocation. - * - * Helper function used in service implementations to finish handling invocations of the SetIconFile() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. - * - * This method will free @invocation, you cannot use it afterwards. - */ -void -gsd_accounts_user_complete_set_icon_file ( - GsdAccountsUser *object, - GDBusMethodInvocation *invocation) -{ - g_dbus_method_invocation_return_value (invocation, - g_variant_new ("()")); -} - -/** - * gsd_accounts_user_complete_set_locked: - * @object: A #GsdAccountsUser. - * @invocation: (transfer full): A #GDBusMethodInvocation. - * - * Helper function used in service implementations to finish handling invocations of the SetLocked() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. - * - * This method will free @invocation, you cannot use it afterwards. - */ -void -gsd_accounts_user_complete_set_locked ( - GsdAccountsUser *object, - GDBusMethodInvocation *invocation) -{ - g_dbus_method_invocation_return_value (invocation, - g_variant_new ("()")); -} - -/** - * gsd_accounts_user_complete_set_account_type: - * @object: A #GsdAccountsUser. - * @invocation: (transfer full): A #GDBusMethodInvocation. - * - * Helper function used in service implementations to finish handling invocations of the SetAccountType() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. - * - * This method will free @invocation, you cannot use it afterwards. - */ -void -gsd_accounts_user_complete_set_account_type ( - GsdAccountsUser *object, - GDBusMethodInvocation *invocation) -{ - g_dbus_method_invocation_return_value (invocation, - g_variant_new ("()")); -} - -/** - * gsd_accounts_user_complete_set_password_mode: - * @object: A #GsdAccountsUser. - * @invocation: (transfer full): A #GDBusMethodInvocation. - * - * Helper function used in service implementations to finish handling invocations of the SetPasswordMode() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. - * - * This method will free @invocation, you cannot use it afterwards. - */ -void -gsd_accounts_user_complete_set_password_mode ( - GsdAccountsUser *object, - GDBusMethodInvocation *invocation) -{ - g_dbus_method_invocation_return_value (invocation, - g_variant_new ("()")); -} - -/** - * gsd_accounts_user_complete_set_password: - * @object: A #GsdAccountsUser. - * @invocation: (transfer full): A #GDBusMethodInvocation. - * - * Helper function used in service implementations to finish handling invocations of the SetPassword() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. - * - * This method will free @invocation, you cannot use it afterwards. - */ -void -gsd_accounts_user_complete_set_password ( - GsdAccountsUser *object, - GDBusMethodInvocation *invocation) -{ - g_dbus_method_invocation_return_value (invocation, - g_variant_new ("()")); -} - -/** - * gsd_accounts_user_complete_set_password_hint: - * @object: A #GsdAccountsUser. - * @invocation: (transfer full): A #GDBusMethodInvocation. - * - * Helper function used in service implementations to finish handling invocations of the SetPasswordHint() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. - * - * This method will free @invocation, you cannot use it afterwards. - */ -void -gsd_accounts_user_complete_set_password_hint ( - GsdAccountsUser *object, - GDBusMethodInvocation *invocation) -{ - g_dbus_method_invocation_return_value (invocation, - g_variant_new ("()")); -} - -/** - * gsd_accounts_user_complete_set_automatic_login: - * @object: A #GsdAccountsUser. - * @invocation: (transfer full): A #GDBusMethodInvocation. - * - * Helper function used in service implementations to finish handling invocations of the SetAutomaticLogin() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. - * - * This method will free @invocation, you cannot use it afterwards. - */ -void -gsd_accounts_user_complete_set_automatic_login ( - GsdAccountsUser *object, - GDBusMethodInvocation *invocation) -{ - g_dbus_method_invocation_return_value (invocation, - g_variant_new ("()")); -} - -/** - * gsd_accounts_user_complete_get_password_expiration_policy: - * @object: A #GsdAccountsUser. - * @invocation: (transfer full): A #GDBusMethodInvocation. - * @expiration_time: Parameter to return. - * @last_change_time: Parameter to return. - * @min_days_between_changes: Parameter to return. - * @max_days_between_changes: Parameter to return. - * @days_to_warn: Parameter to return. - * @days_after_expiration_until_lock: Parameter to return. - * - * Helper function used in service implementations to finish handling invocations of the GetPasswordExpirationPolicy() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. - * - * This method will free @invocation, you cannot use it afterwards. - */ -void -gsd_accounts_user_complete_get_password_expiration_policy ( - GsdAccountsUser *object, - GDBusMethodInvocation *invocation, - gint64 expiration_time, - gint64 last_change_time, - gint64 min_days_between_changes, - gint64 max_days_between_changes, - gint64 days_to_warn, - gint64 days_after_expiration_until_lock) -{ - g_dbus_method_invocation_return_value (invocation, - g_variant_new ("(xxxxxx)", - expiration_time, - last_change_time, - min_days_between_changes, - max_days_between_changes, - days_to_warn, - days_after_expiration_until_lock)); -} - -/* ------------------------------------------------------------------------ */ - -/** - * GsdAccountsUserProxy: - * - * The #GsdAccountsUserProxy structure contains only private data and should only be accessed using the provided API. - */ - -/** - * GsdAccountsUserProxyClass: - * @parent_class: The parent class. - * - * Class structure for #GsdAccountsUserProxy. - */ - -struct _GsdAccountsUserProxyPrivate -{ - GData *qdata; -}; - -static void gsd_accounts_user_proxy_iface_init (GsdAccountsUserIface *iface); - -#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 -G_DEFINE_TYPE_WITH_CODE (GsdAccountsUserProxy, gsd_accounts_user_proxy, G_TYPE_DBUS_PROXY, - G_ADD_PRIVATE (GsdAccountsUserProxy) - G_IMPLEMENT_INTERFACE (GSD_TYPE_ACCOUNTS_USER, gsd_accounts_user_proxy_iface_init)) - -#else -G_DEFINE_TYPE_WITH_CODE (GsdAccountsUserProxy, gsd_accounts_user_proxy, G_TYPE_DBUS_PROXY, - G_IMPLEMENT_INTERFACE (GSD_TYPE_ACCOUNTS_USER, gsd_accounts_user_proxy_iface_init)) - -#endif -static void -gsd_accounts_user_proxy_finalize (GObject *object) -{ - GsdAccountsUserProxy *proxy = GSD_ACCOUNTS_USER_PROXY (object); - g_datalist_clear (&proxy->priv->qdata); - G_OBJECT_CLASS (gsd_accounts_user_proxy_parent_class)->finalize (object); -} - -static void -gsd_accounts_user_proxy_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec G_GNUC_UNUSED) -{ - const _ExtendedGDBusPropertyInfo *info; - GVariant *variant; - g_assert (prop_id != 0 && prop_id - 1 < 20); - info = _gsd_accounts_user_property_info_pointers[prop_id - 1]; - variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (object), info->parent_struct.name); - if (info->use_gvariant) - { - g_value_set_variant (value, variant); - } - else - { - if (variant != NULL) - g_dbus_gvariant_to_gvalue (variant, value); - } - if (variant != NULL) - g_variant_unref (variant); -} - -static void -gsd_accounts_user_proxy_set_property_cb (GDBusProxy *proxy, - GAsyncResult *res, - gpointer user_data) -{ - const _ExtendedGDBusPropertyInfo *info = user_data; - GError *error; - GVariant *_ret; - error = NULL; - _ret = g_dbus_proxy_call_finish (proxy, res, &error); - if (!_ret) - { - g_warning ("Error setting property '%s' on interface org.freedesktop.Accounts.User: %s (%s, %d)", - info->parent_struct.name, - error->message, g_quark_to_string (error->domain), error->code); - g_error_free (error); - } - else - { - g_variant_unref (_ret); - } -} - -static void -gsd_accounts_user_proxy_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec G_GNUC_UNUSED) -{ - const _ExtendedGDBusPropertyInfo *info; - GVariant *variant; - g_assert (prop_id != 0 && prop_id - 1 < 20); - info = _gsd_accounts_user_property_info_pointers[prop_id - 1]; - variant = g_dbus_gvalue_to_gvariant (value, G_VARIANT_TYPE (info->parent_struct.signature)); - g_dbus_proxy_call (G_DBUS_PROXY (object), - "org.freedesktop.DBus.Properties.Set", - g_variant_new ("(ssv)", "org.freedesktop.Accounts.User", info->parent_struct.name, variant), - G_DBUS_CALL_FLAGS_NONE, - -1, - NULL, (GAsyncReadyCallback) gsd_accounts_user_proxy_set_property_cb, (GDBusPropertyInfo *) &info->parent_struct); - g_variant_unref (variant); -} - -static void -gsd_accounts_user_proxy_g_signal (GDBusProxy *proxy, - const gchar *sender_name G_GNUC_UNUSED, - const gchar *signal_name, - GVariant *parameters) -{ - _ExtendedGDBusSignalInfo *info; - GVariantIter iter; - GVariant *child; - GValue *paramv; - gsize num_params; - gsize n; - guint signal_id; - info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_gsd_accounts_user_interface_info.parent_struct, signal_name); - if (info == NULL) - return; - num_params = g_variant_n_children (parameters); - paramv = g_new0 (GValue, num_params + 1); - g_value_init (¶mv[0], GSD_TYPE_ACCOUNTS_USER); - g_value_set_object (¶mv[0], proxy); - g_variant_iter_init (&iter, parameters); - n = 1; - while ((child = g_variant_iter_next_value (&iter)) != NULL) - { - _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1]; - if (arg_info->use_gvariant) - { - g_value_init (¶mv[n], G_TYPE_VARIANT); - g_value_set_variant (¶mv[n], child); - n++; - } - else - g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); - g_variant_unref (child); - } - signal_id = g_signal_lookup (info->signal_name, GSD_TYPE_ACCOUNTS_USER); - g_signal_emitv (paramv, signal_id, 0, NULL); - for (n = 0; n < num_params + 1; n++) - g_value_unset (¶mv[n]); - g_free (paramv); -} - -static void -gsd_accounts_user_proxy_g_properties_changed (GDBusProxy *_proxy, - GVariant *changed_properties, - const gchar *const *invalidated_properties) -{ - GsdAccountsUserProxy *proxy = GSD_ACCOUNTS_USER_PROXY (_proxy); - guint n; - const gchar *key; - GVariantIter *iter; - _ExtendedGDBusPropertyInfo *info; - g_variant_get (changed_properties, "a{sv}", &iter); - while (g_variant_iter_next (iter, "{&sv}", &key, NULL)) - { - info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gsd_accounts_user_interface_info.parent_struct, key); - g_datalist_remove_data (&proxy->priv->qdata, key); - if (info != NULL) - g_object_notify (G_OBJECT (proxy), info->hyphen_name); - } - g_variant_iter_free (iter); - for (n = 0; invalidated_properties[n] != NULL; n++) - { - info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gsd_accounts_user_interface_info.parent_struct, invalidated_properties[n]); - g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]); - if (info != NULL) - g_object_notify (G_OBJECT (proxy), info->hyphen_name); - } -} - -static guint64 -gsd_accounts_user_proxy_get_uid (GsdAccountsUser *object) -{ - GsdAccountsUserProxy *proxy = GSD_ACCOUNTS_USER_PROXY (object); - GVariant *variant; - guint64 value = 0; - variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "Uid"); - if (variant != NULL) - { - value = g_variant_get_uint64 (variant); - g_variant_unref (variant); - } - return value; -} - -static const gchar * -gsd_accounts_user_proxy_get_user_name (GsdAccountsUser *object) -{ - GsdAccountsUserProxy *proxy = GSD_ACCOUNTS_USER_PROXY (object); - GVariant *variant; - const gchar *value = NULL; - variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "UserName"); - if (variant != NULL) - { - value = g_variant_get_string (variant, NULL); - g_variant_unref (variant); - } - return value; -} - -static const gchar * -gsd_accounts_user_proxy_get_real_name (GsdAccountsUser *object) -{ - GsdAccountsUserProxy *proxy = GSD_ACCOUNTS_USER_PROXY (object); - GVariant *variant; - const gchar *value = NULL; - variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "RealName"); - if (variant != NULL) - { - value = g_variant_get_string (variant, NULL); - g_variant_unref (variant); - } - return value; -} - -static gint -gsd_accounts_user_proxy_get_account_type (GsdAccountsUser *object) -{ - GsdAccountsUserProxy *proxy = GSD_ACCOUNTS_USER_PROXY (object); - GVariant *variant; - gint value = 0; - variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "AccountType"); - if (variant != NULL) - { - value = g_variant_get_int32 (variant); - g_variant_unref (variant); - } - return value; -} - -static const gchar * -gsd_accounts_user_proxy_get_home_directory (GsdAccountsUser *object) -{ - GsdAccountsUserProxy *proxy = GSD_ACCOUNTS_USER_PROXY (object); - GVariant *variant; - const gchar *value = NULL; - variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "HomeDirectory"); - if (variant != NULL) - { - value = g_variant_get_string (variant, NULL); - g_variant_unref (variant); - } - return value; -} - -static const gchar * -gsd_accounts_user_proxy_get_shell (GsdAccountsUser *object) -{ - GsdAccountsUserProxy *proxy = GSD_ACCOUNTS_USER_PROXY (object); - GVariant *variant; - const gchar *value = NULL; - variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "Shell"); - if (variant != NULL) - { - value = g_variant_get_string (variant, NULL); - g_variant_unref (variant); - } - return value; -} - -static const gchar * -gsd_accounts_user_proxy_get_email (GsdAccountsUser *object) -{ - GsdAccountsUserProxy *proxy = GSD_ACCOUNTS_USER_PROXY (object); - GVariant *variant; - const gchar *value = NULL; - variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "Email"); - if (variant != NULL) - { - value = g_variant_get_string (variant, NULL); - g_variant_unref (variant); - } - return value; -} - -static const gchar * -gsd_accounts_user_proxy_get_language (GsdAccountsUser *object) -{ - GsdAccountsUserProxy *proxy = GSD_ACCOUNTS_USER_PROXY (object); - GVariant *variant; - const gchar *value = NULL; - variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "Language"); - if (variant != NULL) - { - value = g_variant_get_string (variant, NULL); - g_variant_unref (variant); - } - return value; -} - -static const gchar * -gsd_accounts_user_proxy_get_xsession (GsdAccountsUser *object) -{ - GsdAccountsUserProxy *proxy = GSD_ACCOUNTS_USER_PROXY (object); - GVariant *variant; - const gchar *value = NULL; - variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "XSession"); - if (variant != NULL) - { - value = g_variant_get_string (variant, NULL); - g_variant_unref (variant); - } - return value; -} - -static const gchar * -gsd_accounts_user_proxy_get_location (GsdAccountsUser *object) -{ - GsdAccountsUserProxy *proxy = GSD_ACCOUNTS_USER_PROXY (object); - GVariant *variant; - const gchar *value = NULL; - variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "Location"); - if (variant != NULL) - { - value = g_variant_get_string (variant, NULL); - g_variant_unref (variant); - } - return value; -} - -static guint64 -gsd_accounts_user_proxy_get_login_frequency (GsdAccountsUser *object) -{ - GsdAccountsUserProxy *proxy = GSD_ACCOUNTS_USER_PROXY (object); - GVariant *variant; - guint64 value = 0; - variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "LoginFrequency"); - if (variant != NULL) - { - value = g_variant_get_uint64 (variant); - g_variant_unref (variant); - } - return value; -} - -static gint64 -gsd_accounts_user_proxy_get_login_time (GsdAccountsUser *object) -{ - GsdAccountsUserProxy *proxy = GSD_ACCOUNTS_USER_PROXY (object); - GVariant *variant; - gint64 value = 0; - variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "LoginTime"); - if (variant != NULL) - { - value = g_variant_get_int64 (variant); - g_variant_unref (variant); - } - return value; -} - -static GVariant * -gsd_accounts_user_proxy_get_login_history (GsdAccountsUser *object) -{ - GsdAccountsUserProxy *proxy = GSD_ACCOUNTS_USER_PROXY (object); - GVariant *variant; - GVariant *value = NULL; - variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "LoginHistory"); - value = variant; - if (variant != NULL) - g_variant_unref (variant); - return value; -} - -static const gchar * -gsd_accounts_user_proxy_get_icon_file (GsdAccountsUser *object) -{ - GsdAccountsUserProxy *proxy = GSD_ACCOUNTS_USER_PROXY (object); - GVariant *variant; - const gchar *value = NULL; - variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "IconFile"); - if (variant != NULL) - { - value = g_variant_get_string (variant, NULL); - g_variant_unref (variant); - } - return value; -} - -static gboolean -gsd_accounts_user_proxy_get_locked (GsdAccountsUser *object) -{ - GsdAccountsUserProxy *proxy = GSD_ACCOUNTS_USER_PROXY (object); - GVariant *variant; - gboolean value = 0; - variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "Locked"); - if (variant != NULL) - { - value = g_variant_get_boolean (variant); - g_variant_unref (variant); - } - return value; -} - -static gint -gsd_accounts_user_proxy_get_password_mode (GsdAccountsUser *object) -{ - GsdAccountsUserProxy *proxy = GSD_ACCOUNTS_USER_PROXY (object); - GVariant *variant; - gint value = 0; - variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "PasswordMode"); - if (variant != NULL) - { - value = g_variant_get_int32 (variant); - g_variant_unref (variant); - } - return value; -} - -static const gchar * -gsd_accounts_user_proxy_get_password_hint (GsdAccountsUser *object) -{ - GsdAccountsUserProxy *proxy = GSD_ACCOUNTS_USER_PROXY (object); - GVariant *variant; - const gchar *value = NULL; - variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "PasswordHint"); - if (variant != NULL) - { - value = g_variant_get_string (variant, NULL); - g_variant_unref (variant); - } - return value; -} - -static gboolean -gsd_accounts_user_proxy_get_automatic_login (GsdAccountsUser *object) -{ - GsdAccountsUserProxy *proxy = GSD_ACCOUNTS_USER_PROXY (object); - GVariant *variant; - gboolean value = 0; - variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "AutomaticLogin"); - if (variant != NULL) - { - value = g_variant_get_boolean (variant); - g_variant_unref (variant); - } - return value; -} - -static gboolean -gsd_accounts_user_proxy_get_system_account (GsdAccountsUser *object) -{ - GsdAccountsUserProxy *proxy = GSD_ACCOUNTS_USER_PROXY (object); - GVariant *variant; - gboolean value = 0; - variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "SystemAccount"); - if (variant != NULL) - { - value = g_variant_get_boolean (variant); - g_variant_unref (variant); - } - return value; -} - -static gboolean -gsd_accounts_user_proxy_get_local_account (GsdAccountsUser *object) -{ - GsdAccountsUserProxy *proxy = GSD_ACCOUNTS_USER_PROXY (object); - GVariant *variant; - gboolean value = 0; - variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "LocalAccount"); - if (variant != NULL) - { - value = g_variant_get_boolean (variant); - g_variant_unref (variant); - } - return value; -} - -static void -gsd_accounts_user_proxy_init (GsdAccountsUserProxy *proxy) -{ -#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 - proxy->priv = gsd_accounts_user_proxy_get_instance_private (proxy); -#else - proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, GSD_TYPE_ACCOUNTS_USER_PROXY, GsdAccountsUserProxyPrivate); -#endif - - g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), gsd_accounts_user_interface_info ()); -} - -static void -gsd_accounts_user_proxy_class_init (GsdAccountsUserProxyClass *klass) -{ - GObjectClass *gobject_class; - GDBusProxyClass *proxy_class; - - gobject_class = G_OBJECT_CLASS (klass); - gobject_class->finalize = gsd_accounts_user_proxy_finalize; - gobject_class->get_property = gsd_accounts_user_proxy_get_property; - gobject_class->set_property = gsd_accounts_user_proxy_set_property; - - proxy_class = G_DBUS_PROXY_CLASS (klass); - proxy_class->g_signal = gsd_accounts_user_proxy_g_signal; - proxy_class->g_properties_changed = gsd_accounts_user_proxy_g_properties_changed; - - gsd_accounts_user_override_properties (gobject_class, 1); - -#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 - g_type_class_add_private (klass, sizeof (GsdAccountsUserProxyPrivate)); -#endif -} - -static void -gsd_accounts_user_proxy_iface_init (GsdAccountsUserIface *iface) -{ - iface->get_uid = gsd_accounts_user_proxy_get_uid; - iface->get_user_name = gsd_accounts_user_proxy_get_user_name; - iface->get_real_name = gsd_accounts_user_proxy_get_real_name; - iface->get_account_type = gsd_accounts_user_proxy_get_account_type; - iface->get_home_directory = gsd_accounts_user_proxy_get_home_directory; - iface->get_shell = gsd_accounts_user_proxy_get_shell; - iface->get_email = gsd_accounts_user_proxy_get_email; - iface->get_language = gsd_accounts_user_proxy_get_language; - iface->get_xsession = gsd_accounts_user_proxy_get_xsession; - iface->get_location = gsd_accounts_user_proxy_get_location; - iface->get_login_frequency = gsd_accounts_user_proxy_get_login_frequency; - iface->get_login_time = gsd_accounts_user_proxy_get_login_time; - iface->get_login_history = gsd_accounts_user_proxy_get_login_history; - iface->get_icon_file = gsd_accounts_user_proxy_get_icon_file; - iface->get_locked = gsd_accounts_user_proxy_get_locked; - iface->get_password_mode = gsd_accounts_user_proxy_get_password_mode; - iface->get_password_hint = gsd_accounts_user_proxy_get_password_hint; - iface->get_automatic_login = gsd_accounts_user_proxy_get_automatic_login; - iface->get_system_account = gsd_accounts_user_proxy_get_system_account; - iface->get_local_account = gsd_accounts_user_proxy_get_local_account; -} - -/** - * gsd_accounts_user_proxy_new: - * @connection: A #GDBusConnection. - * @flags: Flags from the #GDBusProxyFlags enumeration. - * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. - * @object_path: An object path. - * @cancellable: (allow-none): A #GCancellable or %NULL. - * @callback: A #GAsyncReadyCallback to call when the request is satisfied. - * @user_data: User data to pass to @callback. - * - * Asynchronously creates a proxy for the D-Bus interface org.freedesktop.Accounts.User. See g_dbus_proxy_new() for more details. - * - * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. - * You can then call gsd_accounts_user_proxy_new_finish() to get the result of the operation. - * - * See gsd_accounts_user_proxy_new_sync() for the synchronous, blocking version of this constructor. - */ -void -gsd_accounts_user_proxy_new ( - GDBusConnection *connection, - GDBusProxyFlags flags, - const gchar *name, - const gchar *object_path, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) -{ - g_async_initable_new_async (GSD_TYPE_ACCOUNTS_USER_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.Accounts.User", NULL); -} - -/** - * gsd_accounts_user_proxy_new_finish: - * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_accounts_user_proxy_new(). - * @error: Return location for error or %NULL - * - * Finishes an operation started with gsd_accounts_user_proxy_new(). - * - * Returns: (transfer full) (type GsdAccountsUserProxy): The constructed proxy object or %NULL if @error is set. - */ -GsdAccountsUser * -gsd_accounts_user_proxy_new_finish ( - GAsyncResult *res, - GError **error) -{ - GObject *ret; - GObject *source_object; - source_object = g_async_result_get_source_object (res); - ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); - g_object_unref (source_object); - if (ret != NULL) - return GSD_ACCOUNTS_USER (ret); - else - return NULL; -} - -/** - * gsd_accounts_user_proxy_new_sync: - * @connection: A #GDBusConnection. - * @flags: Flags from the #GDBusProxyFlags enumeration. - * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. - * @object_path: An object path. - * @cancellable: (allow-none): A #GCancellable or %NULL. - * @error: Return location for error or %NULL - * - * Synchronously creates a proxy for the D-Bus interface org.freedesktop.Accounts.User. See g_dbus_proxy_new_sync() for more details. - * - * The calling thread is blocked until a reply is received. - * - * See gsd_accounts_user_proxy_new() for the asynchronous version of this constructor. - * - * Returns: (transfer full) (type GsdAccountsUserProxy): The constructed proxy object or %NULL if @error is set. - */ -GsdAccountsUser * -gsd_accounts_user_proxy_new_sync ( - GDBusConnection *connection, - GDBusProxyFlags flags, - const gchar *name, - const gchar *object_path, - GCancellable *cancellable, - GError **error) -{ - GInitable *ret; - ret = g_initable_new (GSD_TYPE_ACCOUNTS_USER_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.Accounts.User", NULL); - if (ret != NULL) - return GSD_ACCOUNTS_USER (ret); - else - return NULL; -} - - -/** - * gsd_accounts_user_proxy_new_for_bus: - * @bus_type: A #GBusType. - * @flags: Flags from the #GDBusProxyFlags enumeration. - * @name: A bus name (well-known or unique). - * @object_path: An object path. - * @cancellable: (allow-none): A #GCancellable or %NULL. - * @callback: A #GAsyncReadyCallback to call when the request is satisfied. - * @user_data: User data to pass to @callback. - * - * Like gsd_accounts_user_proxy_new() but takes a #GBusType instead of a #GDBusConnection. - * - * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. - * You can then call gsd_accounts_user_proxy_new_for_bus_finish() to get the result of the operation. - * - * See gsd_accounts_user_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. - */ -void -gsd_accounts_user_proxy_new_for_bus ( - GBusType bus_type, - GDBusProxyFlags flags, - const gchar *name, - const gchar *object_path, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) -{ - g_async_initable_new_async (GSD_TYPE_ACCOUNTS_USER_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.Accounts.User", NULL); -} - -/** - * gsd_accounts_user_proxy_new_for_bus_finish: - * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_accounts_user_proxy_new_for_bus(). - * @error: Return location for error or %NULL - * - * Finishes an operation started with gsd_accounts_user_proxy_new_for_bus(). - * - * Returns: (transfer full) (type GsdAccountsUserProxy): The constructed proxy object or %NULL if @error is set. - */ -GsdAccountsUser * -gsd_accounts_user_proxy_new_for_bus_finish ( - GAsyncResult *res, - GError **error) -{ - GObject *ret; - GObject *source_object; - source_object = g_async_result_get_source_object (res); - ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); - g_object_unref (source_object); - if (ret != NULL) - return GSD_ACCOUNTS_USER (ret); - else - return NULL; -} - -/** - * gsd_accounts_user_proxy_new_for_bus_sync: - * @bus_type: A #GBusType. - * @flags: Flags from the #GDBusProxyFlags enumeration. - * @name: A bus name (well-known or unique). - * @object_path: An object path. - * @cancellable: (allow-none): A #GCancellable or %NULL. - * @error: Return location for error or %NULL - * - * Like gsd_accounts_user_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. - * - * The calling thread is blocked until a reply is received. - * - * See gsd_accounts_user_proxy_new_for_bus() for the asynchronous version of this constructor. - * - * Returns: (transfer full) (type GsdAccountsUserProxy): The constructed proxy object or %NULL if @error is set. - */ -GsdAccountsUser * -gsd_accounts_user_proxy_new_for_bus_sync ( - GBusType bus_type, - GDBusProxyFlags flags, - const gchar *name, - const gchar *object_path, - GCancellable *cancellable, - GError **error) -{ - GInitable *ret; - ret = g_initable_new (GSD_TYPE_ACCOUNTS_USER_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.Accounts.User", NULL); - if (ret != NULL) - return GSD_ACCOUNTS_USER (ret); - else - return NULL; -} - - -/* ------------------------------------------------------------------------ */ - -/** - * GsdAccountsUserSkeleton: - * - * The #GsdAccountsUserSkeleton structure contains only private data and should only be accessed using the provided API. - */ - -/** - * GsdAccountsUserSkeletonClass: - * @parent_class: The parent class. - * - * Class structure for #GsdAccountsUserSkeleton. - */ - -struct _GsdAccountsUserSkeletonPrivate -{ - GValue *properties; - GList *changed_properties; - GSource *changed_properties_idle_source; - GMainContext *context; - GMutex lock; -}; - -static void -_gsd_accounts_user_skeleton_handle_method_call ( - GDBusConnection *connection G_GNUC_UNUSED, - const gchar *sender G_GNUC_UNUSED, - const gchar *object_path G_GNUC_UNUSED, - const gchar *interface_name, - const gchar *method_name, - GVariant *parameters, - GDBusMethodInvocation *invocation, - gpointer user_data) -{ - GsdAccountsUserSkeleton *skeleton = GSD_ACCOUNTS_USER_SKELETON (user_data); - _ExtendedGDBusMethodInfo *info; - GVariantIter iter; - GVariant *child; - GValue *paramv; - gsize num_params; - guint num_extra; - gsize n; - guint signal_id; - GValue return_value = G_VALUE_INIT; - info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation); - g_assert (info != NULL); - num_params = g_variant_n_children (parameters); - num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra); - n = 0; - g_value_init (¶mv[n], GSD_TYPE_ACCOUNTS_USER); - g_value_set_object (¶mv[n++], skeleton); - g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION); - g_value_set_object (¶mv[n++], invocation); - if (info->pass_fdlist) - { -#ifdef G_OS_UNIX - g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST); - g_value_set_object (¶mv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation))); -#else - g_assert_not_reached (); -#endif - } - g_variant_iter_init (&iter, parameters); - while ((child = g_variant_iter_next_value (&iter)) != NULL) - { - _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra]; - if (arg_info->use_gvariant) - { - g_value_init (¶mv[n], G_TYPE_VARIANT); - g_value_set_variant (¶mv[n], child); - n++; - } - else - g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); - g_variant_unref (child); - } - signal_id = g_signal_lookup (info->signal_name, GSD_TYPE_ACCOUNTS_USER); - g_value_init (&return_value, G_TYPE_BOOLEAN); - g_signal_emitv (paramv, signal_id, 0, &return_value); - if (!g_value_get_boolean (&return_value)) - g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name); - g_value_unset (&return_value); - for (n = 0; n < num_params + num_extra; n++) - g_value_unset (¶mv[n]); - g_free (paramv); -} - -static GVariant * -_gsd_accounts_user_skeleton_handle_get_property ( - GDBusConnection *connection G_GNUC_UNUSED, - const gchar *sender G_GNUC_UNUSED, - const gchar *object_path G_GNUC_UNUSED, - const gchar *interface_name G_GNUC_UNUSED, - const gchar *property_name, - GError **error, - gpointer user_data) -{ - GsdAccountsUserSkeleton *skeleton = GSD_ACCOUNTS_USER_SKELETON (user_data); - GValue value = G_VALUE_INIT; - GParamSpec *pspec; - _ExtendedGDBusPropertyInfo *info; - GVariant *ret; - ret = NULL; - info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gsd_accounts_user_interface_info.parent_struct, property_name); - g_assert (info != NULL); - pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); - if (pspec == NULL) - { - g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); - } - else - { - g_value_init (&value, pspec->value_type); - g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value); - ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature)); - g_value_unset (&value); - } - return ret; -} - -static gboolean -_gsd_accounts_user_skeleton_handle_set_property ( - GDBusConnection *connection G_GNUC_UNUSED, - const gchar *sender G_GNUC_UNUSED, - const gchar *object_path G_GNUC_UNUSED, - const gchar *interface_name G_GNUC_UNUSED, - const gchar *property_name, - GVariant *variant, - GError **error, - gpointer user_data) -{ - GsdAccountsUserSkeleton *skeleton = GSD_ACCOUNTS_USER_SKELETON (user_data); - GValue value = G_VALUE_INIT; - GParamSpec *pspec; - _ExtendedGDBusPropertyInfo *info; - gboolean ret; - ret = FALSE; - info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gsd_accounts_user_interface_info.parent_struct, property_name); - g_assert (info != NULL); - pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); - if (pspec == NULL) - { - g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); - } - else - { - if (info->use_gvariant) - g_value_set_variant (&value, variant); - else - g_dbus_gvariant_to_gvalue (variant, &value); - g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value); - g_value_unset (&value); - ret = TRUE; - } - return ret; -} - -static const GDBusInterfaceVTable _gsd_accounts_user_skeleton_vtable = -{ - _gsd_accounts_user_skeleton_handle_method_call, - _gsd_accounts_user_skeleton_handle_get_property, - _gsd_accounts_user_skeleton_handle_set_property, - {NULL} -}; - -static GDBusInterfaceInfo * -gsd_accounts_user_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) -{ - return gsd_accounts_user_interface_info (); -} - -static GDBusInterfaceVTable * -gsd_accounts_user_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) -{ - return (GDBusInterfaceVTable *) &_gsd_accounts_user_skeleton_vtable; -} - -static GVariant * -gsd_accounts_user_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton) -{ - GsdAccountsUserSkeleton *skeleton = GSD_ACCOUNTS_USER_SKELETON (_skeleton); - - GVariantBuilder builder; - guint n; - g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); - if (_gsd_accounts_user_interface_info.parent_struct.properties == NULL) - goto out; - for (n = 0; _gsd_accounts_user_interface_info.parent_struct.properties[n] != NULL; n++) - { - GDBusPropertyInfo *info = _gsd_accounts_user_interface_info.parent_struct.properties[n]; - if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE) - { - GVariant *value; - value = _gsd_accounts_user_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.freedesktop.Accounts.User", info->name, NULL, skeleton); - if (value != NULL) - { - g_variant_take_ref (value); - g_variant_builder_add (&builder, "{sv}", info->name, value); - g_variant_unref (value); - } - } - } -out: - return g_variant_builder_end (&builder); -} - -static gboolean _gsd_accounts_user_emit_changed (gpointer user_data); - -static void -gsd_accounts_user_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton) -{ - GsdAccountsUserSkeleton *skeleton = GSD_ACCOUNTS_USER_SKELETON (_skeleton); - gboolean emit_changed = FALSE; - - g_mutex_lock (&skeleton->priv->lock); - if (skeleton->priv->changed_properties_idle_source != NULL) - { - g_source_destroy (skeleton->priv->changed_properties_idle_source); - skeleton->priv->changed_properties_idle_source = NULL; - emit_changed = TRUE; - } - g_mutex_unlock (&skeleton->priv->lock); - - if (emit_changed) - _gsd_accounts_user_emit_changed (skeleton); -} - -static void -_gsd_accounts_user_on_signal_changed ( - GsdAccountsUser *object) -{ - GsdAccountsUserSkeleton *skeleton = GSD_ACCOUNTS_USER_SKELETON (object); - - GList *connections, *l; - GVariant *signal_variant; - connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); - - signal_variant = g_variant_ref_sink (g_variant_new ("()")); - for (l = connections; l != NULL; l = l->next) - { - GDBusConnection *connection = l->data; - g_dbus_connection_emit_signal (connection, - NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.freedesktop.Accounts.User", "Changed", - signal_variant, NULL); - } - g_variant_unref (signal_variant); - g_list_free_full (connections, g_object_unref); -} - -static void gsd_accounts_user_skeleton_iface_init (GsdAccountsUserIface *iface); -#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 -G_DEFINE_TYPE_WITH_CODE (GsdAccountsUserSkeleton, gsd_accounts_user_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, - G_ADD_PRIVATE (GsdAccountsUserSkeleton) - G_IMPLEMENT_INTERFACE (GSD_TYPE_ACCOUNTS_USER, gsd_accounts_user_skeleton_iface_init)) - -#else -G_DEFINE_TYPE_WITH_CODE (GsdAccountsUserSkeleton, gsd_accounts_user_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, - G_IMPLEMENT_INTERFACE (GSD_TYPE_ACCOUNTS_USER, gsd_accounts_user_skeleton_iface_init)) - -#endif -static void -gsd_accounts_user_skeleton_finalize (GObject *object) -{ - GsdAccountsUserSkeleton *skeleton = GSD_ACCOUNTS_USER_SKELETON (object); - guint n; - for (n = 0; n < 20; n++) - g_value_unset (&skeleton->priv->properties[n]); - g_free (skeleton->priv->properties); - g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free); - if (skeleton->priv->changed_properties_idle_source != NULL) - g_source_destroy (skeleton->priv->changed_properties_idle_source); - g_main_context_unref (skeleton->priv->context); - g_mutex_clear (&skeleton->priv->lock); - G_OBJECT_CLASS (gsd_accounts_user_skeleton_parent_class)->finalize (object); -} - -static void -gsd_accounts_user_skeleton_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec G_GNUC_UNUSED) -{ - GsdAccountsUserSkeleton *skeleton = GSD_ACCOUNTS_USER_SKELETON (object); - g_assert (prop_id != 0 && prop_id - 1 < 20); - g_mutex_lock (&skeleton->priv->lock); - g_value_copy (&skeleton->priv->properties[prop_id - 1], value); - g_mutex_unlock (&skeleton->priv->lock); -} - -static gboolean -_gsd_accounts_user_emit_changed (gpointer user_data) -{ - GsdAccountsUserSkeleton *skeleton = GSD_ACCOUNTS_USER_SKELETON (user_data); - GList *l; - GVariantBuilder builder; - GVariantBuilder invalidated_builder; - guint num_changes; - - g_mutex_lock (&skeleton->priv->lock); - g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); - g_variant_builder_init (&invalidated_builder, G_VARIANT_TYPE ("as")); - for (l = skeleton->priv->changed_properties, num_changes = 0; l != NULL; l = l->next) - { - ChangedProperty *cp = l->data; - GVariant *variant; - const GValue *cur_value; - - cur_value = &skeleton->priv->properties[cp->prop_id - 1]; - if (!_g_value_equal (cur_value, &cp->orig_value)) - { - variant = g_dbus_gvalue_to_gvariant (cur_value, G_VARIANT_TYPE (cp->info->parent_struct.signature)); - g_variant_builder_add (&builder, "{sv}", cp->info->parent_struct.name, variant); - g_variant_unref (variant); - num_changes++; - } - } - if (num_changes > 0) - { - GList *connections, *ll; - GVariant *signal_variant; - signal_variant = g_variant_ref_sink (g_variant_new ("(sa{sv}as)", "org.freedesktop.Accounts.User", - &builder, &invalidated_builder)); - connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); - for (ll = connections; ll != NULL; ll = ll->next) - { - GDBusConnection *connection = ll->data; - - g_dbus_connection_emit_signal (connection, - NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), - "org.freedesktop.DBus.Properties", - "PropertiesChanged", - signal_variant, - NULL); - } - g_variant_unref (signal_variant); - g_list_free_full (connections, g_object_unref); - } - else - { - g_variant_builder_clear (&builder); - g_variant_builder_clear (&invalidated_builder); - } - g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free); - skeleton->priv->changed_properties = NULL; - skeleton->priv->changed_properties_idle_source = NULL; - g_mutex_unlock (&skeleton->priv->lock); - return FALSE; -} - -static void -_gsd_accounts_user_schedule_emit_changed (GsdAccountsUserSkeleton *skeleton, const _ExtendedGDBusPropertyInfo *info, guint prop_id, const GValue *orig_value) -{ - ChangedProperty *cp; - GList *l; - cp = NULL; - for (l = skeleton->priv->changed_properties; l != NULL; l = l->next) - { - ChangedProperty *i_cp = l->data; - if (i_cp->info == info) - { - cp = i_cp; - break; - } - } - if (cp == NULL) - { - cp = g_new0 (ChangedProperty, 1); - cp->prop_id = prop_id; - cp->info = info; - skeleton->priv->changed_properties = g_list_prepend (skeleton->priv->changed_properties, cp); - g_value_init (&cp->orig_value, G_VALUE_TYPE (orig_value)); - g_value_copy (orig_value, &cp->orig_value); - } -} - -static void -gsd_accounts_user_skeleton_notify (GObject *object, - GParamSpec *pspec G_GNUC_UNUSED) -{ - GsdAccountsUserSkeleton *skeleton = GSD_ACCOUNTS_USER_SKELETON (object); - g_mutex_lock (&skeleton->priv->lock); - if (skeleton->priv->changed_properties != NULL && - skeleton->priv->changed_properties_idle_source == NULL) - { - skeleton->priv->changed_properties_idle_source = g_idle_source_new (); - g_source_set_priority (skeleton->priv->changed_properties_idle_source, G_PRIORITY_DEFAULT); - g_source_set_callback (skeleton->priv->changed_properties_idle_source, _gsd_accounts_user_emit_changed, g_object_ref (skeleton), (GDestroyNotify) g_object_unref); - g_source_set_name (skeleton->priv->changed_properties_idle_source, "[generated] _gsd_accounts_user_emit_changed"); - g_source_attach (skeleton->priv->changed_properties_idle_source, skeleton->priv->context); - g_source_unref (skeleton->priv->changed_properties_idle_source); - } - g_mutex_unlock (&skeleton->priv->lock); -} - -static void -gsd_accounts_user_skeleton_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - GsdAccountsUserSkeleton *skeleton = GSD_ACCOUNTS_USER_SKELETON (object); - g_assert (prop_id != 0 && prop_id - 1 < 20); - g_mutex_lock (&skeleton->priv->lock); - g_object_freeze_notify (object); - if (!_g_value_equal (value, &skeleton->priv->properties[prop_id - 1])) - { - if (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)) != NULL) - _gsd_accounts_user_schedule_emit_changed (skeleton, _gsd_accounts_user_property_info_pointers[prop_id - 1], prop_id, &skeleton->priv->properties[prop_id - 1]); - g_value_copy (value, &skeleton->priv->properties[prop_id - 1]); - g_object_notify_by_pspec (object, pspec); - } - g_mutex_unlock (&skeleton->priv->lock); - g_object_thaw_notify (object); -} - -static void -gsd_accounts_user_skeleton_init (GsdAccountsUserSkeleton *skeleton) -{ -#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 - skeleton->priv = gsd_accounts_user_skeleton_get_instance_private (skeleton); -#else - skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, GSD_TYPE_ACCOUNTS_USER_SKELETON, GsdAccountsUserSkeletonPrivate); -#endif - - g_mutex_init (&skeleton->priv->lock); - skeleton->priv->context = g_main_context_ref_thread_default (); - skeleton->priv->properties = g_new0 (GValue, 20); - g_value_init (&skeleton->priv->properties[0], G_TYPE_UINT64); - g_value_init (&skeleton->priv->properties[1], G_TYPE_STRING); - g_value_init (&skeleton->priv->properties[2], G_TYPE_STRING); - g_value_init (&skeleton->priv->properties[3], G_TYPE_INT); - g_value_init (&skeleton->priv->properties[4], G_TYPE_STRING); - g_value_init (&skeleton->priv->properties[5], G_TYPE_STRING); - g_value_init (&skeleton->priv->properties[6], G_TYPE_STRING); - g_value_init (&skeleton->priv->properties[7], G_TYPE_STRING); - g_value_init (&skeleton->priv->properties[8], G_TYPE_STRING); - g_value_init (&skeleton->priv->properties[9], G_TYPE_STRING); - g_value_init (&skeleton->priv->properties[10], G_TYPE_UINT64); - g_value_init (&skeleton->priv->properties[11], G_TYPE_INT64); - g_value_init (&skeleton->priv->properties[12], G_TYPE_VARIANT); - g_value_init (&skeleton->priv->properties[13], G_TYPE_STRING); - g_value_init (&skeleton->priv->properties[14], G_TYPE_BOOLEAN); - g_value_init (&skeleton->priv->properties[15], G_TYPE_INT); - g_value_init (&skeleton->priv->properties[16], G_TYPE_STRING); - g_value_init (&skeleton->priv->properties[17], G_TYPE_BOOLEAN); - g_value_init (&skeleton->priv->properties[18], G_TYPE_BOOLEAN); - g_value_init (&skeleton->priv->properties[19], G_TYPE_BOOLEAN); -} - -static guint64 -gsd_accounts_user_skeleton_get_uid (GsdAccountsUser *object) -{ - GsdAccountsUserSkeleton *skeleton = GSD_ACCOUNTS_USER_SKELETON (object); - guint64 value; - g_mutex_lock (&skeleton->priv->lock); - value = g_value_get_uint64 (&(skeleton->priv->properties[0])); - g_mutex_unlock (&skeleton->priv->lock); - return value; -} - -static const gchar * -gsd_accounts_user_skeleton_get_user_name (GsdAccountsUser *object) -{ - GsdAccountsUserSkeleton *skeleton = GSD_ACCOUNTS_USER_SKELETON (object); - const gchar *value; - g_mutex_lock (&skeleton->priv->lock); - value = g_value_get_string (&(skeleton->priv->properties[1])); - g_mutex_unlock (&skeleton->priv->lock); - return value; -} - -static const gchar * -gsd_accounts_user_skeleton_get_real_name (GsdAccountsUser *object) -{ - GsdAccountsUserSkeleton *skeleton = GSD_ACCOUNTS_USER_SKELETON (object); - const gchar *value; - g_mutex_lock (&skeleton->priv->lock); - value = g_value_get_string (&(skeleton->priv->properties[2])); - g_mutex_unlock (&skeleton->priv->lock); - return value; -} - -static gint -gsd_accounts_user_skeleton_get_account_type (GsdAccountsUser *object) -{ - GsdAccountsUserSkeleton *skeleton = GSD_ACCOUNTS_USER_SKELETON (object); - gint value; - g_mutex_lock (&skeleton->priv->lock); - value = g_value_get_int (&(skeleton->priv->properties[3])); - g_mutex_unlock (&skeleton->priv->lock); - return value; -} - -static const gchar * -gsd_accounts_user_skeleton_get_home_directory (GsdAccountsUser *object) -{ - GsdAccountsUserSkeleton *skeleton = GSD_ACCOUNTS_USER_SKELETON (object); - const gchar *value; - g_mutex_lock (&skeleton->priv->lock); - value = g_value_get_string (&(skeleton->priv->properties[4])); - g_mutex_unlock (&skeleton->priv->lock); - return value; -} - -static const gchar * -gsd_accounts_user_skeleton_get_shell (GsdAccountsUser *object) -{ - GsdAccountsUserSkeleton *skeleton = GSD_ACCOUNTS_USER_SKELETON (object); - const gchar *value; - g_mutex_lock (&skeleton->priv->lock); - value = g_value_get_string (&(skeleton->priv->properties[5])); - g_mutex_unlock (&skeleton->priv->lock); - return value; -} - -static const gchar * -gsd_accounts_user_skeleton_get_email (GsdAccountsUser *object) -{ - GsdAccountsUserSkeleton *skeleton = GSD_ACCOUNTS_USER_SKELETON (object); - const gchar *value; - g_mutex_lock (&skeleton->priv->lock); - value = g_value_get_string (&(skeleton->priv->properties[6])); - g_mutex_unlock (&skeleton->priv->lock); - return value; -} - -static const gchar * -gsd_accounts_user_skeleton_get_language (GsdAccountsUser *object) -{ - GsdAccountsUserSkeleton *skeleton = GSD_ACCOUNTS_USER_SKELETON (object); - const gchar *value; - g_mutex_lock (&skeleton->priv->lock); - value = g_value_get_string (&(skeleton->priv->properties[7])); - g_mutex_unlock (&skeleton->priv->lock); - return value; -} - -static const gchar * -gsd_accounts_user_skeleton_get_xsession (GsdAccountsUser *object) -{ - GsdAccountsUserSkeleton *skeleton = GSD_ACCOUNTS_USER_SKELETON (object); - const gchar *value; - g_mutex_lock (&skeleton->priv->lock); - value = g_value_get_string (&(skeleton->priv->properties[8])); - g_mutex_unlock (&skeleton->priv->lock); - return value; -} - -static const gchar * -gsd_accounts_user_skeleton_get_location (GsdAccountsUser *object) -{ - GsdAccountsUserSkeleton *skeleton = GSD_ACCOUNTS_USER_SKELETON (object); - const gchar *value; - g_mutex_lock (&skeleton->priv->lock); - value = g_value_get_string (&(skeleton->priv->properties[9])); - g_mutex_unlock (&skeleton->priv->lock); - return value; -} - -static guint64 -gsd_accounts_user_skeleton_get_login_frequency (GsdAccountsUser *object) -{ - GsdAccountsUserSkeleton *skeleton = GSD_ACCOUNTS_USER_SKELETON (object); - guint64 value; - g_mutex_lock (&skeleton->priv->lock); - value = g_value_get_uint64 (&(skeleton->priv->properties[10])); - g_mutex_unlock (&skeleton->priv->lock); - return value; -} - -static gint64 -gsd_accounts_user_skeleton_get_login_time (GsdAccountsUser *object) -{ - GsdAccountsUserSkeleton *skeleton = GSD_ACCOUNTS_USER_SKELETON (object); - gint64 value; - g_mutex_lock (&skeleton->priv->lock); - value = g_value_get_int64 (&(skeleton->priv->properties[11])); - g_mutex_unlock (&skeleton->priv->lock); - return value; -} - -static GVariant * -gsd_accounts_user_skeleton_get_login_history (GsdAccountsUser *object) -{ - GsdAccountsUserSkeleton *skeleton = GSD_ACCOUNTS_USER_SKELETON (object); - GVariant *value; - g_mutex_lock (&skeleton->priv->lock); - value = g_value_get_variant (&(skeleton->priv->properties[12])); - g_mutex_unlock (&skeleton->priv->lock); - return value; -} - -static const gchar * -gsd_accounts_user_skeleton_get_icon_file (GsdAccountsUser *object) -{ - GsdAccountsUserSkeleton *skeleton = GSD_ACCOUNTS_USER_SKELETON (object); - const gchar *value; - g_mutex_lock (&skeleton->priv->lock); - value = g_value_get_string (&(skeleton->priv->properties[13])); - g_mutex_unlock (&skeleton->priv->lock); - return value; -} - -static gboolean -gsd_accounts_user_skeleton_get_locked (GsdAccountsUser *object) -{ - GsdAccountsUserSkeleton *skeleton = GSD_ACCOUNTS_USER_SKELETON (object); - gboolean value; - g_mutex_lock (&skeleton->priv->lock); - value = g_value_get_boolean (&(skeleton->priv->properties[14])); - g_mutex_unlock (&skeleton->priv->lock); - return value; -} - -static gint -gsd_accounts_user_skeleton_get_password_mode (GsdAccountsUser *object) -{ - GsdAccountsUserSkeleton *skeleton = GSD_ACCOUNTS_USER_SKELETON (object); - gint value; - g_mutex_lock (&skeleton->priv->lock); - value = g_value_get_int (&(skeleton->priv->properties[15])); - g_mutex_unlock (&skeleton->priv->lock); - return value; -} - -static const gchar * -gsd_accounts_user_skeleton_get_password_hint (GsdAccountsUser *object) -{ - GsdAccountsUserSkeleton *skeleton = GSD_ACCOUNTS_USER_SKELETON (object); - const gchar *value; - g_mutex_lock (&skeleton->priv->lock); - value = g_value_get_string (&(skeleton->priv->properties[16])); - g_mutex_unlock (&skeleton->priv->lock); - return value; -} - -static gboolean -gsd_accounts_user_skeleton_get_automatic_login (GsdAccountsUser *object) -{ - GsdAccountsUserSkeleton *skeleton = GSD_ACCOUNTS_USER_SKELETON (object); - gboolean value; - g_mutex_lock (&skeleton->priv->lock); - value = g_value_get_boolean (&(skeleton->priv->properties[17])); - g_mutex_unlock (&skeleton->priv->lock); - return value; -} - -static gboolean -gsd_accounts_user_skeleton_get_system_account (GsdAccountsUser *object) -{ - GsdAccountsUserSkeleton *skeleton = GSD_ACCOUNTS_USER_SKELETON (object); - gboolean value; - g_mutex_lock (&skeleton->priv->lock); - value = g_value_get_boolean (&(skeleton->priv->properties[18])); - g_mutex_unlock (&skeleton->priv->lock); - return value; -} - -static gboolean -gsd_accounts_user_skeleton_get_local_account (GsdAccountsUser *object) -{ - GsdAccountsUserSkeleton *skeleton = GSD_ACCOUNTS_USER_SKELETON (object); - gboolean value; - g_mutex_lock (&skeleton->priv->lock); - value = g_value_get_boolean (&(skeleton->priv->properties[19])); - g_mutex_unlock (&skeleton->priv->lock); - return value; -} - -static void -gsd_accounts_user_skeleton_class_init (GsdAccountsUserSkeletonClass *klass) -{ - GObjectClass *gobject_class; - GDBusInterfaceSkeletonClass *skeleton_class; - - gobject_class = G_OBJECT_CLASS (klass); - gobject_class->finalize = gsd_accounts_user_skeleton_finalize; - gobject_class->get_property = gsd_accounts_user_skeleton_get_property; - gobject_class->set_property = gsd_accounts_user_skeleton_set_property; - gobject_class->notify = gsd_accounts_user_skeleton_notify; - - - gsd_accounts_user_override_properties (gobject_class, 1); - - skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass); - skeleton_class->get_info = gsd_accounts_user_skeleton_dbus_interface_get_info; - skeleton_class->get_properties = gsd_accounts_user_skeleton_dbus_interface_get_properties; - skeleton_class->flush = gsd_accounts_user_skeleton_dbus_interface_flush; - skeleton_class->get_vtable = gsd_accounts_user_skeleton_dbus_interface_get_vtable; - -#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 - g_type_class_add_private (klass, sizeof (GsdAccountsUserSkeletonPrivate)); -#endif -} - -static void -gsd_accounts_user_skeleton_iface_init (GsdAccountsUserIface *iface) -{ - iface->changed = _gsd_accounts_user_on_signal_changed; - iface->get_uid = gsd_accounts_user_skeleton_get_uid; - iface->get_user_name = gsd_accounts_user_skeleton_get_user_name; - iface->get_real_name = gsd_accounts_user_skeleton_get_real_name; - iface->get_account_type = gsd_accounts_user_skeleton_get_account_type; - iface->get_home_directory = gsd_accounts_user_skeleton_get_home_directory; - iface->get_shell = gsd_accounts_user_skeleton_get_shell; - iface->get_email = gsd_accounts_user_skeleton_get_email; - iface->get_language = gsd_accounts_user_skeleton_get_language; - iface->get_xsession = gsd_accounts_user_skeleton_get_xsession; - iface->get_location = gsd_accounts_user_skeleton_get_location; - iface->get_login_frequency = gsd_accounts_user_skeleton_get_login_frequency; - iface->get_login_time = gsd_accounts_user_skeleton_get_login_time; - iface->get_login_history = gsd_accounts_user_skeleton_get_login_history; - iface->get_icon_file = gsd_accounts_user_skeleton_get_icon_file; - iface->get_locked = gsd_accounts_user_skeleton_get_locked; - iface->get_password_mode = gsd_accounts_user_skeleton_get_password_mode; - iface->get_password_hint = gsd_accounts_user_skeleton_get_password_hint; - iface->get_automatic_login = gsd_accounts_user_skeleton_get_automatic_login; - iface->get_system_account = gsd_accounts_user_skeleton_get_system_account; - iface->get_local_account = gsd_accounts_user_skeleton_get_local_account; -} - -/** - * gsd_accounts_user_skeleton_new: - * - * Creates a skeleton object for the D-Bus interface org.freedesktop.Accounts.User. - * - * Returns: (transfer full) (type GsdAccountsUserSkeleton): The skeleton object. - */ -GsdAccountsUser * -gsd_accounts_user_skeleton_new (void) -{ - return GSD_ACCOUNTS_USER (g_object_new (GSD_TYPE_ACCOUNTS_USER_SKELETON, NULL)); -} diff --git a/plugins/account/org.freedesktop.Accounts.User.h b/plugins/account/org.freedesktop.Accounts.User.h deleted file mode 100644 index f5a0ca0..0000000 --- a/plugins/account/org.freedesktop.Accounts.User.h +++ /dev/null @@ -1,725 +0,0 @@ -/* - * Generated by gdbus-codegen 2.54.1. DO NOT EDIT. - * - * The license of this code is the same as for the source it was derived from. - */ - -#ifndef __ORG_FREEDESKTOP_ACCOUNTS_USER_H__ -#define __ORG_FREEDESKTOP_ACCOUNTS_USER_H__ - -#include - -G_BEGIN_DECLS - - -/* ------------------------------------------------------------------------ */ -/* Declarations for org.freedesktop.Accounts.User */ - -#define GSD_TYPE_ACCOUNTS_USER (gsd_accounts_user_get_type ()) -#define GSD_ACCOUNTS_USER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GSD_TYPE_ACCOUNTS_USER, GsdAccountsUser)) -#define GSD_IS_ACCOUNTS_USER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSD_TYPE_ACCOUNTS_USER)) -#define GSD_ACCOUNTS_USER_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), GSD_TYPE_ACCOUNTS_USER, GsdAccountsUserIface)) - -struct _GsdAccountsUser; -typedef struct _GsdAccountsUser GsdAccountsUser; -typedef struct _GsdAccountsUserIface GsdAccountsUserIface; - -struct _GsdAccountsUserIface -{ - GTypeInterface parent_iface; - - - - gboolean (*handle_get_password_expiration_policy) ( - GsdAccountsUser *object, - GDBusMethodInvocation *invocation); - - gboolean (*handle_set_account_type) ( - GsdAccountsUser *object, - GDBusMethodInvocation *invocation, - gint arg_accountType); - - gboolean (*handle_set_automatic_login) ( - GsdAccountsUser *object, - GDBusMethodInvocation *invocation, - gboolean arg_enabled); - - gboolean (*handle_set_email) ( - GsdAccountsUser *object, - GDBusMethodInvocation *invocation, - const gchar *arg_email); - - gboolean (*handle_set_home_directory) ( - GsdAccountsUser *object, - GDBusMethodInvocation *invocation, - const gchar *arg_homedir); - - gboolean (*handle_set_icon_file) ( - GsdAccountsUser *object, - GDBusMethodInvocation *invocation, - const gchar *arg_filename); - - gboolean (*handle_set_language) ( - GsdAccountsUser *object, - GDBusMethodInvocation *invocation, - const gchar *arg_language); - - gboolean (*handle_set_location) ( - GsdAccountsUser *object, - GDBusMethodInvocation *invocation, - const gchar *arg_location); - - gboolean (*handle_set_locked) ( - GsdAccountsUser *object, - GDBusMethodInvocation *invocation, - gboolean arg_locked); - - gboolean (*handle_set_password) ( - GsdAccountsUser *object, - GDBusMethodInvocation *invocation, - const gchar *arg_password, - const gchar *arg_hint); - - gboolean (*handle_set_password_hint) ( - GsdAccountsUser *object, - GDBusMethodInvocation *invocation, - const gchar *arg_hint); - - gboolean (*handle_set_password_mode) ( - GsdAccountsUser *object, - GDBusMethodInvocation *invocation, - gint arg_mode); - - gboolean (*handle_set_real_name) ( - GsdAccountsUser *object, - GDBusMethodInvocation *invocation, - const gchar *arg_name); - - gboolean (*handle_set_shell) ( - GsdAccountsUser *object, - GDBusMethodInvocation *invocation, - const gchar *arg_shell); - - gboolean (*handle_set_user_name) ( - GsdAccountsUser *object, - GDBusMethodInvocation *invocation, - const gchar *arg_name); - - gboolean (*handle_set_xsession) ( - GsdAccountsUser *object, - GDBusMethodInvocation *invocation, - const gchar *arg_x_session); - - gint (*get_account_type) (GsdAccountsUser *object); - - gboolean (*get_automatic_login) (GsdAccountsUser *object); - - const gchar * (*get_email) (GsdAccountsUser *object); - - const gchar * (*get_home_directory) (GsdAccountsUser *object); - - const gchar * (*get_icon_file) (GsdAccountsUser *object); - - const gchar * (*get_language) (GsdAccountsUser *object); - - gboolean (*get_local_account) (GsdAccountsUser *object); - - const gchar * (*get_location) (GsdAccountsUser *object); - - gboolean (*get_locked) (GsdAccountsUser *object); - - guint64 (*get_login_frequency) (GsdAccountsUser *object); - - GVariant * (*get_login_history) (GsdAccountsUser *object); - - gint64 (*get_login_time) (GsdAccountsUser *object); - - const gchar * (*get_password_hint) (GsdAccountsUser *object); - - gint (*get_password_mode) (GsdAccountsUser *object); - - const gchar * (*get_real_name) (GsdAccountsUser *object); - - const gchar * (*get_shell) (GsdAccountsUser *object); - - gboolean (*get_system_account) (GsdAccountsUser *object); - - guint64 (*get_uid) (GsdAccountsUser *object); - - const gchar * (*get_user_name) (GsdAccountsUser *object); - - const gchar * (*get_xsession) (GsdAccountsUser *object); - - void (*changed) ( - GsdAccountsUser *object); - -}; - -GType gsd_accounts_user_get_type (void) G_GNUC_CONST; - -GDBusInterfaceInfo *gsd_accounts_user_interface_info (void); -guint gsd_accounts_user_override_properties (GObjectClass *klass, guint property_id_begin); - - -/* D-Bus method call completion functions: */ -void gsd_accounts_user_complete_set_user_name ( - GsdAccountsUser *object, - GDBusMethodInvocation *invocation); - -void gsd_accounts_user_complete_set_real_name ( - GsdAccountsUser *object, - GDBusMethodInvocation *invocation); - -void gsd_accounts_user_complete_set_email ( - GsdAccountsUser *object, - GDBusMethodInvocation *invocation); - -void gsd_accounts_user_complete_set_language ( - GsdAccountsUser *object, - GDBusMethodInvocation *invocation); - -void gsd_accounts_user_complete_set_xsession ( - GsdAccountsUser *object, - GDBusMethodInvocation *invocation); - -void gsd_accounts_user_complete_set_location ( - GsdAccountsUser *object, - GDBusMethodInvocation *invocation); - -void gsd_accounts_user_complete_set_home_directory ( - GsdAccountsUser *object, - GDBusMethodInvocation *invocation); - -void gsd_accounts_user_complete_set_shell ( - GsdAccountsUser *object, - GDBusMethodInvocation *invocation); - -void gsd_accounts_user_complete_set_icon_file ( - GsdAccountsUser *object, - GDBusMethodInvocation *invocation); - -void gsd_accounts_user_complete_set_locked ( - GsdAccountsUser *object, - GDBusMethodInvocation *invocation); - -void gsd_accounts_user_complete_set_account_type ( - GsdAccountsUser *object, - GDBusMethodInvocation *invocation); - -void gsd_accounts_user_complete_set_password_mode ( - GsdAccountsUser *object, - GDBusMethodInvocation *invocation); - -void gsd_accounts_user_complete_set_password ( - GsdAccountsUser *object, - GDBusMethodInvocation *invocation); - -void gsd_accounts_user_complete_set_password_hint ( - GsdAccountsUser *object, - GDBusMethodInvocation *invocation); - -void gsd_accounts_user_complete_set_automatic_login ( - GsdAccountsUser *object, - GDBusMethodInvocation *invocation); - -void gsd_accounts_user_complete_get_password_expiration_policy ( - GsdAccountsUser *object, - GDBusMethodInvocation *invocation, - gint64 expiration_time, - gint64 last_change_time, - gint64 min_days_between_changes, - gint64 max_days_between_changes, - gint64 days_to_warn, - gint64 days_after_expiration_until_lock); - - - -/* D-Bus signal emissions functions: */ -void gsd_accounts_user_emit_changed ( - GsdAccountsUser *object); - - - -/* D-Bus method calls: */ -void gsd_accounts_user_call_set_user_name ( - GsdAccountsUser *proxy, - const gchar *arg_name, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data); - -gboolean gsd_accounts_user_call_set_user_name_finish ( - GsdAccountsUser *proxy, - GAsyncResult *res, - GError **error); - -gboolean gsd_accounts_user_call_set_user_name_sync ( - GsdAccountsUser *proxy, - const gchar *arg_name, - GCancellable *cancellable, - GError **error); - -void gsd_accounts_user_call_set_real_name ( - GsdAccountsUser *proxy, - const gchar *arg_name, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data); - -gboolean gsd_accounts_user_call_set_real_name_finish ( - GsdAccountsUser *proxy, - GAsyncResult *res, - GError **error); - -gboolean gsd_accounts_user_call_set_real_name_sync ( - GsdAccountsUser *proxy, - const gchar *arg_name, - GCancellable *cancellable, - GError **error); - -void gsd_accounts_user_call_set_email ( - GsdAccountsUser *proxy, - const gchar *arg_email, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data); - -gboolean gsd_accounts_user_call_set_email_finish ( - GsdAccountsUser *proxy, - GAsyncResult *res, - GError **error); - -gboolean gsd_accounts_user_call_set_email_sync ( - GsdAccountsUser *proxy, - const gchar *arg_email, - GCancellable *cancellable, - GError **error); - -void gsd_accounts_user_call_set_language ( - GsdAccountsUser *proxy, - const gchar *arg_language, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data); - -gboolean gsd_accounts_user_call_set_language_finish ( - GsdAccountsUser *proxy, - GAsyncResult *res, - GError **error); - -gboolean gsd_accounts_user_call_set_language_sync ( - GsdAccountsUser *proxy, - const gchar *arg_language, - GCancellable *cancellable, - GError **error); - -void gsd_accounts_user_call_set_xsession ( - GsdAccountsUser *proxy, - const gchar *arg_x_session, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data); - -gboolean gsd_accounts_user_call_set_xsession_finish ( - GsdAccountsUser *proxy, - GAsyncResult *res, - GError **error); - -gboolean gsd_accounts_user_call_set_xsession_sync ( - GsdAccountsUser *proxy, - const gchar *arg_x_session, - GCancellable *cancellable, - GError **error); - -void gsd_accounts_user_call_set_location ( - GsdAccountsUser *proxy, - const gchar *arg_location, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data); - -gboolean gsd_accounts_user_call_set_location_finish ( - GsdAccountsUser *proxy, - GAsyncResult *res, - GError **error); - -gboolean gsd_accounts_user_call_set_location_sync ( - GsdAccountsUser *proxy, - const gchar *arg_location, - GCancellable *cancellable, - GError **error); - -void gsd_accounts_user_call_set_home_directory ( - GsdAccountsUser *proxy, - const gchar *arg_homedir, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data); - -gboolean gsd_accounts_user_call_set_home_directory_finish ( - GsdAccountsUser *proxy, - GAsyncResult *res, - GError **error); - -gboolean gsd_accounts_user_call_set_home_directory_sync ( - GsdAccountsUser *proxy, - const gchar *arg_homedir, - GCancellable *cancellable, - GError **error); - -void gsd_accounts_user_call_set_shell ( - GsdAccountsUser *proxy, - const gchar *arg_shell, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data); - -gboolean gsd_accounts_user_call_set_shell_finish ( - GsdAccountsUser *proxy, - GAsyncResult *res, - GError **error); - -gboolean gsd_accounts_user_call_set_shell_sync ( - GsdAccountsUser *proxy, - const gchar *arg_shell, - GCancellable *cancellable, - GError **error); - -void gsd_accounts_user_call_set_icon_file ( - GsdAccountsUser *proxy, - const gchar *arg_filename, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data); - -gboolean gsd_accounts_user_call_set_icon_file_finish ( - GsdAccountsUser *proxy, - GAsyncResult *res, - GError **error); - -gboolean gsd_accounts_user_call_set_icon_file_sync ( - GsdAccountsUser *proxy, - const gchar *arg_filename, - GCancellable *cancellable, - GError **error); - -void gsd_accounts_user_call_set_locked ( - GsdAccountsUser *proxy, - gboolean arg_locked, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data); - -gboolean gsd_accounts_user_call_set_locked_finish ( - GsdAccountsUser *proxy, - GAsyncResult *res, - GError **error); - -gboolean gsd_accounts_user_call_set_locked_sync ( - GsdAccountsUser *proxy, - gboolean arg_locked, - GCancellable *cancellable, - GError **error); - -void gsd_accounts_user_call_set_account_type ( - GsdAccountsUser *proxy, - gint arg_accountType, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data); - -gboolean gsd_accounts_user_call_set_account_type_finish ( - GsdAccountsUser *proxy, - GAsyncResult *res, - GError **error); - -gboolean gsd_accounts_user_call_set_account_type_sync ( - GsdAccountsUser *proxy, - gint arg_accountType, - GCancellable *cancellable, - GError **error); - -void gsd_accounts_user_call_set_password_mode ( - GsdAccountsUser *proxy, - gint arg_mode, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data); - -gboolean gsd_accounts_user_call_set_password_mode_finish ( - GsdAccountsUser *proxy, - GAsyncResult *res, - GError **error); - -gboolean gsd_accounts_user_call_set_password_mode_sync ( - GsdAccountsUser *proxy, - gint arg_mode, - GCancellable *cancellable, - GError **error); - -void gsd_accounts_user_call_set_password ( - GsdAccountsUser *proxy, - const gchar *arg_password, - const gchar *arg_hint, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data); - -gboolean gsd_accounts_user_call_set_password_finish ( - GsdAccountsUser *proxy, - GAsyncResult *res, - GError **error); - -gboolean gsd_accounts_user_call_set_password_sync ( - GsdAccountsUser *proxy, - const gchar *arg_password, - const gchar *arg_hint, - GCancellable *cancellable, - GError **error); - -void gsd_accounts_user_call_set_password_hint ( - GsdAccountsUser *proxy, - const gchar *arg_hint, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data); - -gboolean gsd_accounts_user_call_set_password_hint_finish ( - GsdAccountsUser *proxy, - GAsyncResult *res, - GError **error); - -gboolean gsd_accounts_user_call_set_password_hint_sync ( - GsdAccountsUser *proxy, - const gchar *arg_hint, - GCancellable *cancellable, - GError **error); - -void gsd_accounts_user_call_set_automatic_login ( - GsdAccountsUser *proxy, - gboolean arg_enabled, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data); - -gboolean gsd_accounts_user_call_set_automatic_login_finish ( - GsdAccountsUser *proxy, - GAsyncResult *res, - GError **error); - -gboolean gsd_accounts_user_call_set_automatic_login_sync ( - GsdAccountsUser *proxy, - gboolean arg_enabled, - GCancellable *cancellable, - GError **error); - -void gsd_accounts_user_call_get_password_expiration_policy ( - GsdAccountsUser *proxy, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data); - -gboolean gsd_accounts_user_call_get_password_expiration_policy_finish ( - GsdAccountsUser *proxy, - gint64 *out_expiration_time, - gint64 *out_last_change_time, - gint64 *out_min_days_between_changes, - gint64 *out_max_days_between_changes, - gint64 *out_days_to_warn, - gint64 *out_days_after_expiration_until_lock, - GAsyncResult *res, - GError **error); - -gboolean gsd_accounts_user_call_get_password_expiration_policy_sync ( - GsdAccountsUser *proxy, - gint64 *out_expiration_time, - gint64 *out_last_change_time, - gint64 *out_min_days_between_changes, - gint64 *out_max_days_between_changes, - gint64 *out_days_to_warn, - gint64 *out_days_after_expiration_until_lock, - GCancellable *cancellable, - GError **error); - - - -/* D-Bus property accessors: */ -guint64 gsd_accounts_user_get_uid (GsdAccountsUser *object); -void gsd_accounts_user_set_uid (GsdAccountsUser *object, guint64 value); - -const gchar *gsd_accounts_user_get_user_name (GsdAccountsUser *object); -gchar *gsd_accounts_user_dup_user_name (GsdAccountsUser *object); -void gsd_accounts_user_set_user_name (GsdAccountsUser *object, const gchar *value); - -const gchar *gsd_accounts_user_get_real_name (GsdAccountsUser *object); -gchar *gsd_accounts_user_dup_real_name (GsdAccountsUser *object); -void gsd_accounts_user_set_real_name (GsdAccountsUser *object, const gchar *value); - -gint gsd_accounts_user_get_account_type (GsdAccountsUser *object); -void gsd_accounts_user_set_account_type (GsdAccountsUser *object, gint value); - -const gchar *gsd_accounts_user_get_home_directory (GsdAccountsUser *object); -gchar *gsd_accounts_user_dup_home_directory (GsdAccountsUser *object); -void gsd_accounts_user_set_home_directory (GsdAccountsUser *object, const gchar *value); - -const gchar *gsd_accounts_user_get_shell (GsdAccountsUser *object); -gchar *gsd_accounts_user_dup_shell (GsdAccountsUser *object); -void gsd_accounts_user_set_shell (GsdAccountsUser *object, const gchar *value); - -const gchar *gsd_accounts_user_get_email (GsdAccountsUser *object); -gchar *gsd_accounts_user_dup_email (GsdAccountsUser *object); -void gsd_accounts_user_set_email (GsdAccountsUser *object, const gchar *value); - -const gchar *gsd_accounts_user_get_language (GsdAccountsUser *object); -gchar *gsd_accounts_user_dup_language (GsdAccountsUser *object); -void gsd_accounts_user_set_language (GsdAccountsUser *object, const gchar *value); - -const gchar *gsd_accounts_user_get_xsession (GsdAccountsUser *object); -gchar *gsd_accounts_user_dup_xsession (GsdAccountsUser *object); -void gsd_accounts_user_set_xsession (GsdAccountsUser *object, const gchar *value); - -const gchar *gsd_accounts_user_get_location (GsdAccountsUser *object); -gchar *gsd_accounts_user_dup_location (GsdAccountsUser *object); -void gsd_accounts_user_set_location (GsdAccountsUser *object, const gchar *value); - -guint64 gsd_accounts_user_get_login_frequency (GsdAccountsUser *object); -void gsd_accounts_user_set_login_frequency (GsdAccountsUser *object, guint64 value); - -gint64 gsd_accounts_user_get_login_time (GsdAccountsUser *object); -void gsd_accounts_user_set_login_time (GsdAccountsUser *object, gint64 value); - -GVariant *gsd_accounts_user_get_login_history (GsdAccountsUser *object); -GVariant *gsd_accounts_user_dup_login_history (GsdAccountsUser *object); -void gsd_accounts_user_set_login_history (GsdAccountsUser *object, GVariant *value); - -const gchar *gsd_accounts_user_get_icon_file (GsdAccountsUser *object); -gchar *gsd_accounts_user_dup_icon_file (GsdAccountsUser *object); -void gsd_accounts_user_set_icon_file (GsdAccountsUser *object, const gchar *value); - -gboolean gsd_accounts_user_get_locked (GsdAccountsUser *object); -void gsd_accounts_user_set_locked (GsdAccountsUser *object, gboolean value); - -gint gsd_accounts_user_get_password_mode (GsdAccountsUser *object); -void gsd_accounts_user_set_password_mode (GsdAccountsUser *object, gint value); - -const gchar *gsd_accounts_user_get_password_hint (GsdAccountsUser *object); -gchar *gsd_accounts_user_dup_password_hint (GsdAccountsUser *object); -void gsd_accounts_user_set_password_hint (GsdAccountsUser *object, const gchar *value); - -gboolean gsd_accounts_user_get_automatic_login (GsdAccountsUser *object); -void gsd_accounts_user_set_automatic_login (GsdAccountsUser *object, gboolean value); - -gboolean gsd_accounts_user_get_system_account (GsdAccountsUser *object); -void gsd_accounts_user_set_system_account (GsdAccountsUser *object, gboolean value); - -gboolean gsd_accounts_user_get_local_account (GsdAccountsUser *object); -void gsd_accounts_user_set_local_account (GsdAccountsUser *object, gboolean value); - - -/* ---- */ - -#define GSD_TYPE_ACCOUNTS_USER_PROXY (gsd_accounts_user_proxy_get_type ()) -#define GSD_ACCOUNTS_USER_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GSD_TYPE_ACCOUNTS_USER_PROXY, GsdAccountsUserProxy)) -#define GSD_ACCOUNTS_USER_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GSD_TYPE_ACCOUNTS_USER_PROXY, GsdAccountsUserProxyClass)) -#define GSD_ACCOUNTS_USER_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GSD_TYPE_ACCOUNTS_USER_PROXY, GsdAccountsUserProxyClass)) -#define GSD_IS_ACCOUNTS_USER_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSD_TYPE_ACCOUNTS_USER_PROXY)) -#define GSD_IS_ACCOUNTS_USER_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GSD_TYPE_ACCOUNTS_USER_PROXY)) - -typedef struct _GsdAccountsUserProxy GsdAccountsUserProxy; -typedef struct _GsdAccountsUserProxyClass GsdAccountsUserProxyClass; -typedef struct _GsdAccountsUserProxyPrivate GsdAccountsUserProxyPrivate; - -struct _GsdAccountsUserProxy -{ - /*< private >*/ - GDBusProxy parent_instance; - GsdAccountsUserProxyPrivate *priv; -}; - -struct _GsdAccountsUserProxyClass -{ - GDBusProxyClass parent_class; -}; - -GType gsd_accounts_user_proxy_get_type (void) G_GNUC_CONST; - -#if GLIB_CHECK_VERSION(2, 44, 0) -G_DEFINE_AUTOPTR_CLEANUP_FUNC (GsdAccountsUserProxy, g_object_unref) -#endif - -void gsd_accounts_user_proxy_new ( - GDBusConnection *connection, - GDBusProxyFlags flags, - const gchar *name, - const gchar *object_path, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data); -GsdAccountsUser *gsd_accounts_user_proxy_new_finish ( - GAsyncResult *res, - GError **error); -GsdAccountsUser *gsd_accounts_user_proxy_new_sync ( - GDBusConnection *connection, - GDBusProxyFlags flags, - const gchar *name, - const gchar *object_path, - GCancellable *cancellable, - GError **error); - -void gsd_accounts_user_proxy_new_for_bus ( - GBusType bus_type, - GDBusProxyFlags flags, - const gchar *name, - const gchar *object_path, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data); -GsdAccountsUser *gsd_accounts_user_proxy_new_for_bus_finish ( - GAsyncResult *res, - GError **error); -GsdAccountsUser *gsd_accounts_user_proxy_new_for_bus_sync ( - GBusType bus_type, - GDBusProxyFlags flags, - const gchar *name, - const gchar *object_path, - GCancellable *cancellable, - GError **error); - - -/* ---- */ - -#define GSD_TYPE_ACCOUNTS_USER_SKELETON (gsd_accounts_user_skeleton_get_type ()) -#define GSD_ACCOUNTS_USER_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GSD_TYPE_ACCOUNTS_USER_SKELETON, GsdAccountsUserSkeleton)) -#define GSD_ACCOUNTS_USER_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GSD_TYPE_ACCOUNTS_USER_SKELETON, GsdAccountsUserSkeletonClass)) -#define GSD_ACCOUNTS_USER_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GSD_TYPE_ACCOUNTS_USER_SKELETON, GsdAccountsUserSkeletonClass)) -#define GSD_IS_ACCOUNTS_USER_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSD_TYPE_ACCOUNTS_USER_SKELETON)) -#define GSD_IS_ACCOUNTS_USER_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GSD_TYPE_ACCOUNTS_USER_SKELETON)) - -typedef struct _GsdAccountsUserSkeleton GsdAccountsUserSkeleton; -typedef struct _GsdAccountsUserSkeletonClass GsdAccountsUserSkeletonClass; -typedef struct _GsdAccountsUserSkeletonPrivate GsdAccountsUserSkeletonPrivate; - -struct _GsdAccountsUserSkeleton -{ - /*< private >*/ - GDBusInterfaceSkeleton parent_instance; - GsdAccountsUserSkeletonPrivate *priv; -}; - -struct _GsdAccountsUserSkeletonClass -{ - GDBusInterfaceSkeletonClass parent_class; -}; - -GType gsd_accounts_user_skeleton_get_type (void) G_GNUC_CONST; - -#if GLIB_CHECK_VERSION(2, 44, 0) -G_DEFINE_AUTOPTR_CLEANUP_FUNC (GsdAccountsUserSkeleton, g_object_unref) -#endif - -GsdAccountsUser *gsd_accounts_user_skeleton_new (void); - - -G_END_DECLS - -#endif /* __ORG_FREEDESKTOP_ACCOUNTS_USER_H__ */ diff --git a/plugins/account/org.freedesktop.Accounts.User.xml b/plugins/account/org.freedesktop.Accounts.User.xml deleted file mode 100644 index 4ab989a..0000000 --- a/plugins/account/org.freedesktop.Accounts.User.xml +++ /dev/null @@ -1,825 +0,0 @@ - - - - - - - - - - The new username. - - - - - - - Sets the users username. Note that it is usually not allowed - to have multiple users with the same username. - - - - The caller needs one of the following PolicyKit authorizations: - - - org.freedesktop.accounts.user-administration - To change the username of any user - - - - - if the caller lacks the appropriate PolicyKit authorization - if the operation failed - - - - - - - - - - The new name, typically in the form "Firstname Lastname". - - - - - - - Sets the users real name. - - - - The caller needs one of the following PolicyKit authorizations: - - - org.freedesktop.accounts.change-own-user-data - To change his own name - - - org.freedesktop.accounts.user-administration - To change the name of another user - - - - - if the caller lacks the appropriate PolicyKit authorization - if the operation failed - - - - - - - - - - The new email address. - - - - - - - Sets the users email address. - - - Note that setting an email address in the AccountsService is - not the same as configuring a mail client. Mail clients might - default to email address that is configured here, though. - - - - The caller needs one of the following PolicyKit authorizations: - - - org.freedesktop.accounts.change-own-user-data - To change his own email address - - - org.freedesktop.accounts.user-administration - To change the email address of another user - - - - - if the caller lacks the appropriate PolicyKit authorization - if the operation failed - - - - - - - - - - The new language, as a locale specification like "de_DE.UTF-8". - - - - - - - Sets the users language. - - - The expectation is that display managers will start the - users session with this locale. - - - - The caller needs one of the following PolicyKit authorizations: - - - org.freedesktop.accounts.change-own-user-data - To change his own language - - - org.freedesktop.accounts.user-administration - To change the language of another user - - - - - if the caller lacks the appropriate PolicyKit authorization - if the operation failed - - - - - - - - - - - The new xsession to start (e.g. "gnome") - - - - - - - Sets the users x session. - - - The expectation is that display managers will log the user in to this - specified session, if available. - - - - The caller needs one of the following PolicyKit authorizations: - - - org.freedesktop.accounts.change-own-user-data - To change his own language - - - org.freedesktop.accounts.user-administration - To change the language of another user - - - - - if the caller lacks the appropriate PolicyKit authorization - if the operation failed - - - - - - - - - - The new location as a freeform string. - - - - - - - Sets the users location. - - - - The caller needs one of the following PolicyKit authorizations: - - - org.freedesktop.accounts.change-own-user-data - To change his own location - - - org.freedesktop.accounts.user-administration - To change the location of another user - - - - - if the caller lacks the appropriate PolicyKit authorization - if the operation failed - - - - - - - - - - The new homedir as an absolute path. - - - - - - - Sets the users home directory. - - - Note that changing the users home directory moves all the content - from the old location to the new one, and is potentially an - expensive operation. - - - - The caller needs one of the following PolicyKit authorizations: - - - org.freedesktop.accounts.user-administration - To change the home directory of a user - - - - - if the caller lacks the appropriate PolicyKit authorization - if the operation failed - - - - - - - - - - The new user shell. - - - - - - - Sets the users shell. - - - Note that setting the shell to a non-allowed program may - prevent the user from logging in. - - - - The caller needs one of the following PolicyKit authorizations: - - - org.freedesktop.accounts.user-administration - To change the shell of a user - - - - - if the caller lacks the appropriate PolicyKit authorization - if the operation failed - - - - - - - - - - The absolute filename of a png file to use as the users icon. - - - - - - - Sets the users icon. - - - - The caller needs one of the following PolicyKit authorizations: - - - org.freedesktop.accounts.change-own-user-data - To change his own icon - - - org.freedesktop.accounts.user-administration - To change the icon of another user - - - - - if the caller lacks the appropriate PolicyKit authorization - if the operation failed - - - - - - - - - - Whether to lock or unlock the users account. - - - - - - - Locks or unlocks a users account. - - - Locking an account prevents the user from logging in. - - - - The caller needs one of the following PolicyKit authorizations: - - - org.freedesktop.accounts.user-administration - To lock or unlock user accounts - - - - - if the caller lacks the appropriate PolicyKit authorization - if the operation failed - - - - - - - - - - The new account type, encoded as an integer: - - - 0 - Standard user - - - 1 - Administrator - - - - - - - - - Changes the users account type. - - - - The caller needs one of the following PolicyKit authorizations: - - - org.freedesktop.accounts.user-administration - To change an account type - - - - - if the caller lacks the appropriate PolicyKit authorization - if the operation failed - - - - - - - - - - The new password mode, encoded as an integer: - - - 0 - Regular password - - - 1 - Password must be set at next login - - - 2 - No password - - - - - - - - - Changes the users password mode. - - - Note that changing the password mode has the side-effect of - unlocking the account. - - - - The caller needs one of the following PolicyKit authorizations: - - - org.freedesktop.accounts.user-administration - To change a users password mode - - - - - if the caller lacks the appropriate PolicyKit authorization - if the operation failed - - - - - - - - - - The crypted password. - - - - - - - The password hint. - - - - - - - Sets a new password for this user. - - - Note that setting a password has the side-effect of - unlocking the account. - - - - The caller needs one of the following PolicyKit authorizations: - - - org.freedesktop.accounts.user-administration - To change the password of a user - - - - - if the caller lacks the appropriate PolicyKit authorization - if the operation failed - - - - - - - - - - The password hint. - - - - - - - Sets the users password hint. - - - - The caller needs one of the following PolicyKit authorizations: - - - org.freedesktop.accounts.change-own-user-data - To change his own language - - - org.freedesktop.accounts.user-administration - To change the language of another user - - - - - if the caller lacks the appropriate PolicyKit authorization - if the operation failed - - - - - - - - - - Whether to enable automatic login for this user. - - - - - - - Enables or disables automatic login for a user. - - - Note that usually only one user can have automatic login - enabled, so turning it on for a user will disable it for - the previously configured autologin user. - - - - The caller needs one of the following PolicyKit authorizations: - - - org.freedesktop.accounts.set-login-option - To change the login screen configuration - - - - - if the caller lacks the appropriate PolicyKit authorization - if the operation failed - - - - - - - - - - - - - - - - - - - The uid of the user. - - - - - - - - - - The username of the user. - - - - - - - - - - The users real name. - - - - - - - - - - The users account type, encoded as an integer: - - - 0 - Standard user - - - 1 - Administrator - - - - - - - - - - - - The users home directory. - - - - - - - - - - The users shell. - - - - - - - - - - The email address. - - - - - - - - - - The users language, as a locale specification like "de_DE.UTF-8". - - - - - - - - - - The users x session. - - - - - - - - - - The users location. - - - - - - - - - - How often the user has logged in. - - - - - - - - - - The last login time. - - - - - - - - - - The login history for this user. - Each entry in the array represents a login session. The first two - members are the login time and logout time, as timestamps (seconds since the epoch). If the session is still running, the logout time - is 0. - - - The a{sv} member is a dictionary containing additional information - about the session. Possible members include 'type' (with values like ':0', 'tty0', 'pts/0' etc). - - - - - - - - - - The filename of a png file containing the users icon. - - - - - - - - - - Whether the users account is locked. - - - - - - - - - - The password mode for the user account, encoded as an integer: - - - 0 - Regular password - - - 1 - Password must be set at next login - - - 2 - No password - - - - - - - - - - - - The password hint for the user. - - - - - - - - - - Whether automatic login is enabled for the user. - - - - - - - - - - Whether this is a 'system' account, like 'root' or 'nobody'. - System accounts should normally not appear in lists of - users, and ListCachedUsers will not include such accounts. - - - - - - - - - - Whether the user is a local account or not. - - - - - - - - - - Emitted when the user is changed. - - - - - - - diff --git a/plugins/account/org.freedesktop.Accounts.c b/plugins/account/org.freedesktop.Accounts.c deleted file mode 100644 index 669c43a..0000000 --- a/plugins/account/org.freedesktop.Accounts.c +++ /dev/null @@ -1,3016 +0,0 @@ -/* - * Generated by gdbus-codegen 2.54.1. DO NOT EDIT. - * - * The license of this code is the same as for the source it was derived from. - */ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include "org.freedesktop.Accounts.h" - -#include -#ifdef G_OS_UNIX -# include -#endif - -typedef struct -{ - GDBusArgInfo parent_struct; - gboolean use_gvariant; -} _ExtendedGDBusArgInfo; - -typedef struct -{ - GDBusMethodInfo parent_struct; - const gchar *signal_name; - gboolean pass_fdlist; -} _ExtendedGDBusMethodInfo; - -typedef struct -{ - GDBusSignalInfo parent_struct; - const gchar *signal_name; -} _ExtendedGDBusSignalInfo; - -typedef struct -{ - GDBusPropertyInfo parent_struct; - const gchar *hyphen_name; - gboolean use_gvariant; -} _ExtendedGDBusPropertyInfo; - -typedef struct -{ - GDBusInterfaceInfo parent_struct; - const gchar *hyphen_name; -} _ExtendedGDBusInterfaceInfo; - -typedef struct -{ - const _ExtendedGDBusPropertyInfo *info; - guint prop_id; - GValue orig_value; /* the value before the change */ -} ChangedProperty; - -static void -_changed_property_free (ChangedProperty *data) -{ - g_value_unset (&data->orig_value); - g_free (data); -} - -static gboolean -_g_strv_equal0 (gchar **a, gchar **b) -{ - gboolean ret = FALSE; - guint n; - if (a == NULL && b == NULL) - { - ret = TRUE; - goto out; - } - if (a == NULL || b == NULL) - goto out; - if (g_strv_length (a) != g_strv_length (b)) - goto out; - for (n = 0; a[n] != NULL; n++) - if (g_strcmp0 (a[n], b[n]) != 0) - goto out; - ret = TRUE; -out: - return ret; -} - -static gboolean -_g_variant_equal0 (GVariant *a, GVariant *b) -{ - gboolean ret = FALSE; - if (a == NULL && b == NULL) - { - ret = TRUE; - goto out; - } - if (a == NULL || b == NULL) - goto out; - ret = g_variant_equal (a, b); -out: - return ret; -} - -G_GNUC_UNUSED static gboolean -_g_value_equal (const GValue *a, const GValue *b) -{ - gboolean ret = FALSE; - g_assert (G_VALUE_TYPE (a) == G_VALUE_TYPE (b)); - switch (G_VALUE_TYPE (a)) - { - case G_TYPE_BOOLEAN: - ret = (g_value_get_boolean (a) == g_value_get_boolean (b)); - break; - case G_TYPE_UCHAR: - ret = (g_value_get_uchar (a) == g_value_get_uchar (b)); - break; - case G_TYPE_INT: - ret = (g_value_get_int (a) == g_value_get_int (b)); - break; - case G_TYPE_UINT: - ret = (g_value_get_uint (a) == g_value_get_uint (b)); - break; - case G_TYPE_INT64: - ret = (g_value_get_int64 (a) == g_value_get_int64 (b)); - break; - case G_TYPE_UINT64: - ret = (g_value_get_uint64 (a) == g_value_get_uint64 (b)); - break; - case G_TYPE_DOUBLE: - { - /* Avoid -Wfloat-equal warnings by doing a direct bit compare */ - gdouble da = g_value_get_double (a); - gdouble db = g_value_get_double (b); - ret = memcmp (&da, &db, sizeof (gdouble)) == 0; - } - break; - case G_TYPE_STRING: - ret = (g_strcmp0 (g_value_get_string (a), g_value_get_string (b)) == 0); - break; - case G_TYPE_VARIANT: - ret = _g_variant_equal0 (g_value_get_variant (a), g_value_get_variant (b)); - break; - default: - if (G_VALUE_TYPE (a) == G_TYPE_STRV) - ret = _g_strv_equal0 (g_value_get_boxed (a), g_value_get_boxed (b)); - else - g_critical ("_g_value_equal() does not handle type %s", g_type_name (G_VALUE_TYPE (a))); - break; - } - return ret; -} - -/* ------------------------------------------------------------------------ - * Code for interface org.freedesktop.Accounts - * ------------------------------------------------------------------------ - */ - -/** - * SECTION:GsdAccounts - * @title: GsdAccounts - * @short_description: Generated C code for the org.freedesktop.Accounts D-Bus interface - * - * This section contains code for working with the org.freedesktop.Accounts D-Bus interface in C. - */ - -/* ---- Introspection data for org.freedesktop.Accounts ---- */ - -static const _ExtendedGDBusArgInfo _gsd_accounts_method_info_list_cached_users_OUT_ARG_users = -{ - { - -1, - (gchar *) "users", - (gchar *) "ao", - NULL - }, - FALSE -}; - -static const _ExtendedGDBusArgInfo * const _gsd_accounts_method_info_list_cached_users_OUT_ARG_pointers[] = -{ - &_gsd_accounts_method_info_list_cached_users_OUT_ARG_users, - NULL -}; - -static const GDBusAnnotationInfo _gsd_accounts_method_list_cached_users_annotation_info_0 = -{ - -1, - (gchar *) "org.freedesktop.DBus.GLib.Async", - (gchar *) "", - NULL -}; - -static const GDBusAnnotationInfo * const _gsd_accounts_method_list_cached_users_annotation_info_pointers[] = -{ - &_gsd_accounts_method_list_cached_users_annotation_info_0, - NULL -}; - -static const _ExtendedGDBusMethodInfo _gsd_accounts_method_info_list_cached_users = -{ - { - -1, - (gchar *) "ListCachedUsers", - NULL, - (GDBusArgInfo **) &_gsd_accounts_method_info_list_cached_users_OUT_ARG_pointers, - (GDBusAnnotationInfo **) &_gsd_accounts_method_list_cached_users_annotation_info_pointers - }, - "handle-list-cached-users", - FALSE -}; - -static const _ExtendedGDBusArgInfo _gsd_accounts_method_info_find_user_by_id_IN_ARG_id = -{ - { - -1, - (gchar *) "id", - (gchar *) "x", - NULL - }, - FALSE -}; - -static const _ExtendedGDBusArgInfo * const _gsd_accounts_method_info_find_user_by_id_IN_ARG_pointers[] = -{ - &_gsd_accounts_method_info_find_user_by_id_IN_ARG_id, - NULL -}; - -static const _ExtendedGDBusArgInfo _gsd_accounts_method_info_find_user_by_id_OUT_ARG_user = -{ - { - -1, - (gchar *) "user", - (gchar *) "o", - NULL - }, - FALSE -}; - -static const _ExtendedGDBusArgInfo * const _gsd_accounts_method_info_find_user_by_id_OUT_ARG_pointers[] = -{ - &_gsd_accounts_method_info_find_user_by_id_OUT_ARG_user, - NULL -}; - -static const GDBusAnnotationInfo _gsd_accounts_method_find_user_by_id_annotation_info_0 = -{ - -1, - (gchar *) "org.freedesktop.DBus.GLib.Async", - (gchar *) "", - NULL -}; - -static const GDBusAnnotationInfo * const _gsd_accounts_method_find_user_by_id_annotation_info_pointers[] = -{ - &_gsd_accounts_method_find_user_by_id_annotation_info_0, - NULL -}; - -static const _ExtendedGDBusMethodInfo _gsd_accounts_method_info_find_user_by_id = -{ - { - -1, - (gchar *) "FindUserById", - (GDBusArgInfo **) &_gsd_accounts_method_info_find_user_by_id_IN_ARG_pointers, - (GDBusArgInfo **) &_gsd_accounts_method_info_find_user_by_id_OUT_ARG_pointers, - (GDBusAnnotationInfo **) &_gsd_accounts_method_find_user_by_id_annotation_info_pointers - }, - "handle-find-user-by-id", - FALSE -}; - -static const _ExtendedGDBusArgInfo _gsd_accounts_method_info_find_user_by_name_IN_ARG_name = -{ - { - -1, - (gchar *) "name", - (gchar *) "s", - NULL - }, - FALSE -}; - -static const _ExtendedGDBusArgInfo * const _gsd_accounts_method_info_find_user_by_name_IN_ARG_pointers[] = -{ - &_gsd_accounts_method_info_find_user_by_name_IN_ARG_name, - NULL -}; - -static const _ExtendedGDBusArgInfo _gsd_accounts_method_info_find_user_by_name_OUT_ARG_user = -{ - { - -1, - (gchar *) "user", - (gchar *) "o", - NULL - }, - FALSE -}; - -static const _ExtendedGDBusArgInfo * const _gsd_accounts_method_info_find_user_by_name_OUT_ARG_pointers[] = -{ - &_gsd_accounts_method_info_find_user_by_name_OUT_ARG_user, - NULL -}; - -static const GDBusAnnotationInfo _gsd_accounts_method_find_user_by_name_annotation_info_0 = -{ - -1, - (gchar *) "org.freedesktop.DBus.GLib.Async", - (gchar *) "", - NULL -}; - -static const GDBusAnnotationInfo * const _gsd_accounts_method_find_user_by_name_annotation_info_pointers[] = -{ - &_gsd_accounts_method_find_user_by_name_annotation_info_0, - NULL -}; - -static const _ExtendedGDBusMethodInfo _gsd_accounts_method_info_find_user_by_name = -{ - { - -1, - (gchar *) "FindUserByName", - (GDBusArgInfo **) &_gsd_accounts_method_info_find_user_by_name_IN_ARG_pointers, - (GDBusArgInfo **) &_gsd_accounts_method_info_find_user_by_name_OUT_ARG_pointers, - (GDBusAnnotationInfo **) &_gsd_accounts_method_find_user_by_name_annotation_info_pointers - }, - "handle-find-user-by-name", - FALSE -}; - -static const _ExtendedGDBusArgInfo _gsd_accounts_method_info_create_user_IN_ARG_name = -{ - { - -1, - (gchar *) "name", - (gchar *) "s", - NULL - }, - FALSE -}; - -static const _ExtendedGDBusArgInfo _gsd_accounts_method_info_create_user_IN_ARG_fullname = -{ - { - -1, - (gchar *) "fullname", - (gchar *) "s", - NULL - }, - FALSE -}; - -static const _ExtendedGDBusArgInfo _gsd_accounts_method_info_create_user_IN_ARG_accountType = -{ - { - -1, - (gchar *) "accountType", - (gchar *) "i", - NULL - }, - FALSE -}; - -static const _ExtendedGDBusArgInfo * const _gsd_accounts_method_info_create_user_IN_ARG_pointers[] = -{ - &_gsd_accounts_method_info_create_user_IN_ARG_name, - &_gsd_accounts_method_info_create_user_IN_ARG_fullname, - &_gsd_accounts_method_info_create_user_IN_ARG_accountType, - NULL -}; - -static const _ExtendedGDBusArgInfo _gsd_accounts_method_info_create_user_OUT_ARG_user = -{ - { - -1, - (gchar *) "user", - (gchar *) "o", - NULL - }, - FALSE -}; - -static const _ExtendedGDBusArgInfo * const _gsd_accounts_method_info_create_user_OUT_ARG_pointers[] = -{ - &_gsd_accounts_method_info_create_user_OUT_ARG_user, - NULL -}; - -static const GDBusAnnotationInfo _gsd_accounts_method_create_user_annotation_info_0 = -{ - -1, - (gchar *) "org.freedesktop.DBus.GLib.Async", - (gchar *) "", - NULL -}; - -static const GDBusAnnotationInfo _gsd_accounts_method_create_user_annotation_info_1 = -{ - -1, - (gchar *) "org.freedesktop.DBus.GLib.Async", - (gchar *) "", - NULL -}; - -static const GDBusAnnotationInfo * const _gsd_accounts_method_create_user_annotation_info_pointers[] = -{ - &_gsd_accounts_method_create_user_annotation_info_0, - &_gsd_accounts_method_create_user_annotation_info_1, - NULL -}; - -static const _ExtendedGDBusMethodInfo _gsd_accounts_method_info_create_user = -{ - { - -1, - (gchar *) "CreateUser", - (GDBusArgInfo **) &_gsd_accounts_method_info_create_user_IN_ARG_pointers, - (GDBusArgInfo **) &_gsd_accounts_method_info_create_user_OUT_ARG_pointers, - (GDBusAnnotationInfo **) &_gsd_accounts_method_create_user_annotation_info_pointers - }, - "handle-create-user", - FALSE -}; - -static const _ExtendedGDBusArgInfo _gsd_accounts_method_info_cache_user_IN_ARG_name = -{ - { - -1, - (gchar *) "name", - (gchar *) "s", - NULL - }, - FALSE -}; - -static const _ExtendedGDBusArgInfo * const _gsd_accounts_method_info_cache_user_IN_ARG_pointers[] = -{ - &_gsd_accounts_method_info_cache_user_IN_ARG_name, - NULL -}; - -static const _ExtendedGDBusArgInfo _gsd_accounts_method_info_cache_user_OUT_ARG_user = -{ - { - -1, - (gchar *) "user", - (gchar *) "o", - NULL - }, - FALSE -}; - -static const _ExtendedGDBusArgInfo * const _gsd_accounts_method_info_cache_user_OUT_ARG_pointers[] = -{ - &_gsd_accounts_method_info_cache_user_OUT_ARG_user, - NULL -}; - -static const GDBusAnnotationInfo _gsd_accounts_method_cache_user_annotation_info_0 = -{ - -1, - (gchar *) "org.freedesktop.DBus.GLib.Async", - (gchar *) "", - NULL -}; - -static const GDBusAnnotationInfo * const _gsd_accounts_method_cache_user_annotation_info_pointers[] = -{ - &_gsd_accounts_method_cache_user_annotation_info_0, - NULL -}; - -static const _ExtendedGDBusMethodInfo _gsd_accounts_method_info_cache_user = -{ - { - -1, - (gchar *) "CacheUser", - (GDBusArgInfo **) &_gsd_accounts_method_info_cache_user_IN_ARG_pointers, - (GDBusArgInfo **) &_gsd_accounts_method_info_cache_user_OUT_ARG_pointers, - (GDBusAnnotationInfo **) &_gsd_accounts_method_cache_user_annotation_info_pointers - }, - "handle-cache-user", - FALSE -}; - -static const _ExtendedGDBusArgInfo _gsd_accounts_method_info_uncache_user_IN_ARG_name = -{ - { - -1, - (gchar *) "name", - (gchar *) "s", - NULL - }, - FALSE -}; - -static const _ExtendedGDBusArgInfo * const _gsd_accounts_method_info_uncache_user_IN_ARG_pointers[] = -{ - &_gsd_accounts_method_info_uncache_user_IN_ARG_name, - NULL -}; - -static const GDBusAnnotationInfo _gsd_accounts_method_uncache_user_annotation_info_0 = -{ - -1, - (gchar *) "org.freedesktop.DBus.GLib.Async", - (gchar *) "", - NULL -}; - -static const GDBusAnnotationInfo * const _gsd_accounts_method_uncache_user_annotation_info_pointers[] = -{ - &_gsd_accounts_method_uncache_user_annotation_info_0, - NULL -}; - -static const _ExtendedGDBusMethodInfo _gsd_accounts_method_info_uncache_user = -{ - { - -1, - (gchar *) "UncacheUser", - (GDBusArgInfo **) &_gsd_accounts_method_info_uncache_user_IN_ARG_pointers, - NULL, - (GDBusAnnotationInfo **) &_gsd_accounts_method_uncache_user_annotation_info_pointers - }, - "handle-uncache-user", - FALSE -}; - -static const _ExtendedGDBusArgInfo _gsd_accounts_method_info_delete_user_IN_ARG_id = -{ - { - -1, - (gchar *) "id", - (gchar *) "x", - NULL - }, - FALSE -}; - -static const _ExtendedGDBusArgInfo _gsd_accounts_method_info_delete_user_IN_ARG_removeFiles = -{ - { - -1, - (gchar *) "removeFiles", - (gchar *) "b", - NULL - }, - FALSE -}; - -static const _ExtendedGDBusArgInfo * const _gsd_accounts_method_info_delete_user_IN_ARG_pointers[] = -{ - &_gsd_accounts_method_info_delete_user_IN_ARG_id, - &_gsd_accounts_method_info_delete_user_IN_ARG_removeFiles, - NULL -}; - -static const GDBusAnnotationInfo _gsd_accounts_method_delete_user_annotation_info_0 = -{ - -1, - (gchar *) "org.freedesktop.DBus.GLib.Async", - (gchar *) "", - NULL -}; - -static const GDBusAnnotationInfo * const _gsd_accounts_method_delete_user_annotation_info_pointers[] = -{ - &_gsd_accounts_method_delete_user_annotation_info_0, - NULL -}; - -static const _ExtendedGDBusMethodInfo _gsd_accounts_method_info_delete_user = -{ - { - -1, - (gchar *) "DeleteUser", - (GDBusArgInfo **) &_gsd_accounts_method_info_delete_user_IN_ARG_pointers, - NULL, - (GDBusAnnotationInfo **) &_gsd_accounts_method_delete_user_annotation_info_pointers - }, - "handle-delete-user", - FALSE -}; - -static const _ExtendedGDBusMethodInfo * const _gsd_accounts_method_info_pointers[] = -{ - &_gsd_accounts_method_info_list_cached_users, - &_gsd_accounts_method_info_find_user_by_id, - &_gsd_accounts_method_info_find_user_by_name, - &_gsd_accounts_method_info_create_user, - &_gsd_accounts_method_info_cache_user, - &_gsd_accounts_method_info_uncache_user, - &_gsd_accounts_method_info_delete_user, - NULL -}; - -static const _ExtendedGDBusArgInfo _gsd_accounts_signal_info_user_added_ARG_user = -{ - { - -1, - (gchar *) "user", - (gchar *) "o", - NULL - }, - FALSE -}; - -static const _ExtendedGDBusArgInfo * const _gsd_accounts_signal_info_user_added_ARG_pointers[] = -{ - &_gsd_accounts_signal_info_user_added_ARG_user, - NULL -}; - -static const _ExtendedGDBusSignalInfo _gsd_accounts_signal_info_user_added = -{ - { - -1, - (gchar *) "UserAdded", - (GDBusArgInfo **) &_gsd_accounts_signal_info_user_added_ARG_pointers, - NULL - }, - "user-added" -}; - -static const _ExtendedGDBusArgInfo _gsd_accounts_signal_info_user_deleted_ARG_user = -{ - { - -1, - (gchar *) "user", - (gchar *) "o", - NULL - }, - FALSE -}; - -static const _ExtendedGDBusArgInfo * const _gsd_accounts_signal_info_user_deleted_ARG_pointers[] = -{ - &_gsd_accounts_signal_info_user_deleted_ARG_user, - NULL -}; - -static const _ExtendedGDBusSignalInfo _gsd_accounts_signal_info_user_deleted = -{ - { - -1, - (gchar *) "UserDeleted", - (GDBusArgInfo **) &_gsd_accounts_signal_info_user_deleted_ARG_pointers, - NULL - }, - "user-deleted" -}; - -static const _ExtendedGDBusSignalInfo * const _gsd_accounts_signal_info_pointers[] = -{ - &_gsd_accounts_signal_info_user_added, - &_gsd_accounts_signal_info_user_deleted, - NULL -}; - -static const _ExtendedGDBusPropertyInfo _gsd_accounts_property_info_daemon_version = -{ - { - -1, - (gchar *) "DaemonVersion", - (gchar *) "s", - G_DBUS_PROPERTY_INFO_FLAGS_READABLE, - NULL - }, - "daemon-version", - FALSE -}; - -static const _ExtendedGDBusPropertyInfo _gsd_accounts_property_info_has_no_users = -{ - { - -1, - (gchar *) "HasNoUsers", - (gchar *) "b", - G_DBUS_PROPERTY_INFO_FLAGS_READABLE, - NULL - }, - "has-no-users", - FALSE -}; - -static const _ExtendedGDBusPropertyInfo _gsd_accounts_property_info_has_multiple_users = -{ - { - -1, - (gchar *) "HasMultipleUsers", - (gchar *) "b", - G_DBUS_PROPERTY_INFO_FLAGS_READABLE, - NULL - }, - "has-multiple-users", - FALSE -}; - -static const _ExtendedGDBusPropertyInfo * const _gsd_accounts_property_info_pointers[] = -{ - &_gsd_accounts_property_info_daemon_version, - &_gsd_accounts_property_info_has_no_users, - &_gsd_accounts_property_info_has_multiple_users, - NULL -}; - -static const _ExtendedGDBusInterfaceInfo _gsd_accounts_interface_info = -{ - { - -1, - (gchar *) "org.freedesktop.Accounts", - (GDBusMethodInfo **) &_gsd_accounts_method_info_pointers, - (GDBusSignalInfo **) &_gsd_accounts_signal_info_pointers, - (GDBusPropertyInfo **) &_gsd_accounts_property_info_pointers, - NULL - }, - "accounts", -}; - - -/** - * gsd_accounts_interface_info: - * - * Gets a machine-readable description of the org.freedesktop.Accounts D-Bus interface. - * - * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free. - */ -GDBusInterfaceInfo * -gsd_accounts_interface_info (void) -{ - return (GDBusInterfaceInfo *) &_gsd_accounts_interface_info.parent_struct; -} - -/** - * gsd_accounts_override_properties: - * @klass: The class structure for a #GObject-derived class. - * @property_id_begin: The property id to assign to the first overridden property. - * - * Overrides all #GObject properties in the #GsdAccounts interface for a concrete class. - * The properties are overridden in the order they are defined. - * - * Returns: The last property id. - */ -guint -gsd_accounts_override_properties (GObjectClass *klass, guint property_id_begin) -{ - g_object_class_override_property (klass, property_id_begin++, "daemon-version"); - g_object_class_override_property (klass, property_id_begin++, "has-no-users"); - g_object_class_override_property (klass, property_id_begin++, "has-multiple-users"); - return property_id_begin - 1; -} - - - -/** - * GsdAccounts: - * - * Abstract interface type for the D-Bus interface org.freedesktop.Accounts. - */ - -/** - * GsdAccountsIface: - * @parent_iface: The parent interface. - * @handle_cache_user: Handler for the #GsdAccounts::handle-cache-user signal. - * @handle_create_user: Handler for the #GsdAccounts::handle-create-user signal. - * @handle_delete_user: Handler for the #GsdAccounts::handle-delete-user signal. - * @handle_find_user_by_id: Handler for the #GsdAccounts::handle-find-user-by-id signal. - * @handle_find_user_by_name: Handler for the #GsdAccounts::handle-find-user-by-name signal. - * @handle_list_cached_users: Handler for the #GsdAccounts::handle-list-cached-users signal. - * @handle_uncache_user: Handler for the #GsdAccounts::handle-uncache-user signal. - * @get_daemon_version: Getter for the #GsdAccounts:daemon-version property. - * @get_has_multiple_users: Getter for the #GsdAccounts:has-multiple-users property. - * @get_has_no_users: Getter for the #GsdAccounts:has-no-users property. - * @user_added: Handler for the #GsdAccounts::user-added signal. - * @user_deleted: Handler for the #GsdAccounts::user-deleted signal. - * - * Virtual table for the D-Bus interface org.freedesktop.Accounts. - */ - -typedef GsdAccountsIface GsdAccountsInterface; -G_DEFINE_INTERFACE (GsdAccounts, gsd_accounts, G_TYPE_OBJECT) - -static void -gsd_accounts_default_init (GsdAccountsIface *iface) -{ - /* GObject signals for incoming D-Bus method calls: */ - /** - * GsdAccounts::handle-list-cached-users: - * @object: A #GsdAccounts. - * @invocation: A #GDBusMethodInvocation. - * - * Signal emitted when a remote caller is invoking the ListCachedUsers() D-Bus method. - * - * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gsd_accounts_complete_list_cached_users() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. - * - * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - */ - g_signal_new ("handle-list-cached-users", - G_TYPE_FROM_INTERFACE (iface), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GsdAccountsIface, handle_list_cached_users), - g_signal_accumulator_true_handled, - NULL, - g_cclosure_marshal_generic, - G_TYPE_BOOLEAN, - 1, - G_TYPE_DBUS_METHOD_INVOCATION); - - /** - * GsdAccounts::handle-find-user-by-id: - * @object: A #GsdAccounts. - * @invocation: A #GDBusMethodInvocation. - * @arg_id: Argument passed by remote caller. - * - * Signal emitted when a remote caller is invoking the FindUserById() D-Bus method. - * - * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gsd_accounts_complete_find_user_by_id() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. - * - * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - */ - g_signal_new ("handle-find-user-by-id", - G_TYPE_FROM_INTERFACE (iface), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GsdAccountsIface, handle_find_user_by_id), - g_signal_accumulator_true_handled, - NULL, - g_cclosure_marshal_generic, - G_TYPE_BOOLEAN, - 2, - G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_INT64); - - /** - * GsdAccounts::handle-find-user-by-name: - * @object: A #GsdAccounts. - * @invocation: A #GDBusMethodInvocation. - * @arg_name: Argument passed by remote caller. - * - * Signal emitted when a remote caller is invoking the FindUserByName() D-Bus method. - * - * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gsd_accounts_complete_find_user_by_name() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. - * - * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - */ - g_signal_new ("handle-find-user-by-name", - G_TYPE_FROM_INTERFACE (iface), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GsdAccountsIface, handle_find_user_by_name), - g_signal_accumulator_true_handled, - NULL, - g_cclosure_marshal_generic, - G_TYPE_BOOLEAN, - 2, - G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); - - /** - * GsdAccounts::handle-create-user: - * @object: A #GsdAccounts. - * @invocation: A #GDBusMethodInvocation. - * @arg_name: Argument passed by remote caller. - * @arg_fullname: Argument passed by remote caller. - * @arg_accountType: Argument passed by remote caller. - * - * Signal emitted when a remote caller is invoking the CreateUser() D-Bus method. - * - * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gsd_accounts_complete_create_user() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. - * - * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - */ - g_signal_new ("handle-create-user", - G_TYPE_FROM_INTERFACE (iface), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GsdAccountsIface, handle_create_user), - g_signal_accumulator_true_handled, - NULL, - g_cclosure_marshal_generic, - G_TYPE_BOOLEAN, - 4, - G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT); - - /** - * GsdAccounts::handle-cache-user: - * @object: A #GsdAccounts. - * @invocation: A #GDBusMethodInvocation. - * @arg_name: Argument passed by remote caller. - * - * Signal emitted when a remote caller is invoking the CacheUser() D-Bus method. - * - * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gsd_accounts_complete_cache_user() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. - * - * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - */ - g_signal_new ("handle-cache-user", - G_TYPE_FROM_INTERFACE (iface), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GsdAccountsIface, handle_cache_user), - g_signal_accumulator_true_handled, - NULL, - g_cclosure_marshal_generic, - G_TYPE_BOOLEAN, - 2, - G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); - - /** - * GsdAccounts::handle-uncache-user: - * @object: A #GsdAccounts. - * @invocation: A #GDBusMethodInvocation. - * @arg_name: Argument passed by remote caller. - * - * Signal emitted when a remote caller is invoking the UncacheUser() D-Bus method. - * - * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gsd_accounts_complete_uncache_user() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. - * - * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - */ - g_signal_new ("handle-uncache-user", - G_TYPE_FROM_INTERFACE (iface), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GsdAccountsIface, handle_uncache_user), - g_signal_accumulator_true_handled, - NULL, - g_cclosure_marshal_generic, - G_TYPE_BOOLEAN, - 2, - G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); - - /** - * GsdAccounts::handle-delete-user: - * @object: A #GsdAccounts. - * @invocation: A #GDBusMethodInvocation. - * @arg_id: Argument passed by remote caller. - * @arg_removeFiles: Argument passed by remote caller. - * - * Signal emitted when a remote caller is invoking the DeleteUser() D-Bus method. - * - * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gsd_accounts_complete_delete_user() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. - * - * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. - */ - g_signal_new ("handle-delete-user", - G_TYPE_FROM_INTERFACE (iface), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GsdAccountsIface, handle_delete_user), - g_signal_accumulator_true_handled, - NULL, - g_cclosure_marshal_generic, - G_TYPE_BOOLEAN, - 3, - G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_INT64, G_TYPE_BOOLEAN); - - /* GObject signals for received D-Bus signals: */ - /** - * GsdAccounts::user-added: - * @object: A #GsdAccounts. - * @arg_user: Argument. - * - * On the client-side, this signal is emitted whenever the D-Bus signal "UserAdded" is received. - * - * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. - */ - g_signal_new ("user-added", - G_TYPE_FROM_INTERFACE (iface), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GsdAccountsIface, user_added), - NULL, - NULL, - g_cclosure_marshal_generic, - G_TYPE_NONE, - 1, G_TYPE_STRING); - - /** - * GsdAccounts::user-deleted: - * @object: A #GsdAccounts. - * @arg_user: Argument. - * - * On the client-side, this signal is emitted whenever the D-Bus signal "UserDeleted" is received. - * - * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. - */ - g_signal_new ("user-deleted", - G_TYPE_FROM_INTERFACE (iface), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GsdAccountsIface, user_deleted), - NULL, - NULL, - g_cclosure_marshal_generic, - G_TYPE_NONE, - 1, G_TYPE_STRING); - - /* GObject properties for D-Bus properties: */ - /** - * GsdAccounts:daemon-version: - * - * Represents the D-Bus property "DaemonVersion". - * - * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. - */ - g_object_interface_install_property (iface, - g_param_spec_string ("daemon-version", "DaemonVersion", "DaemonVersion", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - /** - * GsdAccounts:has-no-users: - * - * Represents the D-Bus property "HasNoUsers". - * - * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. - */ - g_object_interface_install_property (iface, - g_param_spec_boolean ("has-no-users", "HasNoUsers", "HasNoUsers", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - /** - * GsdAccounts:has-multiple-users: - * - * Represents the D-Bus property "HasMultipleUsers". - * - * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. - */ - g_object_interface_install_property (iface, - g_param_spec_boolean ("has-multiple-users", "HasMultipleUsers", "HasMultipleUsers", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); -} - -/** - * gsd_accounts_get_daemon_version: (skip) - * @object: A #GsdAccounts. - * - * Gets the value of the "DaemonVersion" D-Bus property. - * - * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - * - * The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use gsd_accounts_dup_daemon_version() if on another thread. - * - * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. - */ -const gchar * -gsd_accounts_get_daemon_version (GsdAccounts *object) -{ - return GSD_ACCOUNTS_GET_IFACE (object)->get_daemon_version (object); -} - -/** - * gsd_accounts_dup_daemon_version: (skip) - * @object: A #GsdAccounts. - * - * Gets a copy of the "DaemonVersion" D-Bus property. - * - * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - * - * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free(). - */ -gchar * -gsd_accounts_dup_daemon_version (GsdAccounts *object) -{ - gchar *value; - g_object_get (G_OBJECT (object), "daemon-version", &value, NULL); - return value; -} - -/** - * gsd_accounts_set_daemon_version: (skip) - * @object: A #GsdAccounts. - * @value: The value to set. - * - * Sets the "DaemonVersion" D-Bus property to @value. - * - * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. - */ -void -gsd_accounts_set_daemon_version (GsdAccounts *object, const gchar *value) -{ - g_object_set (G_OBJECT (object), "daemon-version", value, NULL); -} - -/** - * gsd_accounts_get_has_no_users: (skip) - * @object: A #GsdAccounts. - * - * Gets the value of the "HasNoUsers" D-Bus property. - * - * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - * - * Returns: The property value. - */ -gboolean -gsd_accounts_get_has_no_users (GsdAccounts *object) -{ - return GSD_ACCOUNTS_GET_IFACE (object)->get_has_no_users (object); -} - -/** - * gsd_accounts_set_has_no_users: (skip) - * @object: A #GsdAccounts. - * @value: The value to set. - * - * Sets the "HasNoUsers" D-Bus property to @value. - * - * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. - */ -void -gsd_accounts_set_has_no_users (GsdAccounts *object, gboolean value) -{ - g_object_set (G_OBJECT (object), "has-no-users", value, NULL); -} - -/** - * gsd_accounts_get_has_multiple_users: (skip) - * @object: A #GsdAccounts. - * - * Gets the value of the "HasMultipleUsers" D-Bus property. - * - * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. - * - * Returns: The property value. - */ -gboolean -gsd_accounts_get_has_multiple_users (GsdAccounts *object) -{ - return GSD_ACCOUNTS_GET_IFACE (object)->get_has_multiple_users (object); -} - -/** - * gsd_accounts_set_has_multiple_users: (skip) - * @object: A #GsdAccounts. - * @value: The value to set. - * - * Sets the "HasMultipleUsers" D-Bus property to @value. - * - * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. - */ -void -gsd_accounts_set_has_multiple_users (GsdAccounts *object, gboolean value) -{ - g_object_set (G_OBJECT (object), "has-multiple-users", value, NULL); -} - -/** - * gsd_accounts_emit_user_added: - * @object: A #GsdAccounts. - * @arg_user: Argument to pass with the signal. - * - * Emits the "UserAdded" D-Bus signal. - */ -void -gsd_accounts_emit_user_added ( - GsdAccounts *object, - const gchar *arg_user) -{ - g_signal_emit_by_name (object, "user-added", arg_user); -} - -/** - * gsd_accounts_emit_user_deleted: - * @object: A #GsdAccounts. - * @arg_user: Argument to pass with the signal. - * - * Emits the "UserDeleted" D-Bus signal. - */ -void -gsd_accounts_emit_user_deleted ( - GsdAccounts *object, - const gchar *arg_user) -{ - g_signal_emit_by_name (object, "user-deleted", arg_user); -} - -/** - * gsd_accounts_call_list_cached_users: - * @proxy: A #GsdAccountsProxy. - * @cancellable: (allow-none): A #GCancellable or %NULL. - * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. - * @user_data: User data to pass to @callback. - * - * Asynchronously invokes the ListCachedUsers() D-Bus method on @proxy. - * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. - * You can then call gsd_accounts_call_list_cached_users_finish() to get the result of the operation. - * - * See gsd_accounts_call_list_cached_users_sync() for the synchronous, blocking version of this method. - */ -void -gsd_accounts_call_list_cached_users ( - GsdAccounts *proxy, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) -{ - g_dbus_proxy_call (G_DBUS_PROXY (proxy), - "ListCachedUsers", - g_variant_new ("()"), - G_DBUS_CALL_FLAGS_NONE, - -1, - cancellable, - callback, - user_data); -} - -/** - * gsd_accounts_call_list_cached_users_finish: - * @proxy: A #GsdAccountsProxy. - * @out_users: (out): Return location for return parameter or %NULL to ignore. - * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_accounts_call_list_cached_users(). - * @error: Return location for error or %NULL. - * - * Finishes an operation started with gsd_accounts_call_list_cached_users(). - * - * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. - */ -gboolean -gsd_accounts_call_list_cached_users_finish ( - GsdAccounts *proxy, - gchar ***out_users, - GAsyncResult *res, - GError **error) -{ - GVariant *_ret; - _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); - if (_ret == NULL) - goto _out; - g_variant_get (_ret, - "(^ao)", - out_users); - g_variant_unref (_ret); -_out: - return _ret != NULL; -} - -/** - * gsd_accounts_call_list_cached_users_sync: - * @proxy: A #GsdAccountsProxy. - * @out_users: (out): Return location for return parameter or %NULL to ignore. - * @cancellable: (allow-none): A #GCancellable or %NULL. - * @error: Return location for error or %NULL. - * - * Synchronously invokes the ListCachedUsers() D-Bus method on @proxy. The calling thread is blocked until a reply is received. - * - * See gsd_accounts_call_list_cached_users() for the asynchronous version of this method. - * - * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. - */ -gboolean -gsd_accounts_call_list_cached_users_sync ( - GsdAccounts *proxy, - gchar ***out_users, - GCancellable *cancellable, - GError **error) -{ - GVariant *_ret; - _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), - "ListCachedUsers", - g_variant_new ("()"), - G_DBUS_CALL_FLAGS_NONE, - -1, - cancellable, - error); - if (_ret == NULL) - goto _out; - g_variant_get (_ret, - "(^ao)", - out_users); - g_variant_unref (_ret); -_out: - return _ret != NULL; -} - -/** - * gsd_accounts_call_find_user_by_id: - * @proxy: A #GsdAccountsProxy. - * @arg_id: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. - * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. - * @user_data: User data to pass to @callback. - * - * Asynchronously invokes the FindUserById() D-Bus method on @proxy. - * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. - * You can then call gsd_accounts_call_find_user_by_id_finish() to get the result of the operation. - * - * See gsd_accounts_call_find_user_by_id_sync() for the synchronous, blocking version of this method. - */ -void -gsd_accounts_call_find_user_by_id ( - GsdAccounts *proxy, - gint64 arg_id, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) -{ - g_dbus_proxy_call (G_DBUS_PROXY (proxy), - "FindUserById", - g_variant_new ("(x)", - arg_id), - G_DBUS_CALL_FLAGS_NONE, - -1, - cancellable, - callback, - user_data); -} - -/** - * gsd_accounts_call_find_user_by_id_finish: - * @proxy: A #GsdAccountsProxy. - * @out_user: (out): Return location for return parameter or %NULL to ignore. - * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_accounts_call_find_user_by_id(). - * @error: Return location for error or %NULL. - * - * Finishes an operation started with gsd_accounts_call_find_user_by_id(). - * - * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. - */ -gboolean -gsd_accounts_call_find_user_by_id_finish ( - GsdAccounts *proxy, - gchar **out_user, - GAsyncResult *res, - GError **error) -{ - GVariant *_ret; - _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); - if (_ret == NULL) - goto _out; - g_variant_get (_ret, - "(o)", - out_user); - g_variant_unref (_ret); -_out: - return _ret != NULL; -} - -/** - * gsd_accounts_call_find_user_by_id_sync: - * @proxy: A #GsdAccountsProxy. - * @arg_id: Argument to pass with the method invocation. - * @out_user: (out): Return location for return parameter or %NULL to ignore. - * @cancellable: (allow-none): A #GCancellable or %NULL. - * @error: Return location for error or %NULL. - * - * Synchronously invokes the FindUserById() D-Bus method on @proxy. The calling thread is blocked until a reply is received. - * - * See gsd_accounts_call_find_user_by_id() for the asynchronous version of this method. - * - * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. - */ -gboolean -gsd_accounts_call_find_user_by_id_sync ( - GsdAccounts *proxy, - gint64 arg_id, - gchar **out_user, - GCancellable *cancellable, - GError **error) -{ - GVariant *_ret; - _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), - "FindUserById", - g_variant_new ("(x)", - arg_id), - G_DBUS_CALL_FLAGS_NONE, - -1, - cancellable, - error); - if (_ret == NULL) - goto _out; - g_variant_get (_ret, - "(o)", - out_user); - g_variant_unref (_ret); -_out: - return _ret != NULL; -} - -/** - * gsd_accounts_call_find_user_by_name: - * @proxy: A #GsdAccountsProxy. - * @arg_name: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. - * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. - * @user_data: User data to pass to @callback. - * - * Asynchronously invokes the FindUserByName() D-Bus method on @proxy. - * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. - * You can then call gsd_accounts_call_find_user_by_name_finish() to get the result of the operation. - * - * See gsd_accounts_call_find_user_by_name_sync() for the synchronous, blocking version of this method. - */ -void -gsd_accounts_call_find_user_by_name ( - GsdAccounts *proxy, - const gchar *arg_name, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) -{ - g_dbus_proxy_call (G_DBUS_PROXY (proxy), - "FindUserByName", - g_variant_new ("(s)", - arg_name), - G_DBUS_CALL_FLAGS_NONE, - -1, - cancellable, - callback, - user_data); -} - -/** - * gsd_accounts_call_find_user_by_name_finish: - * @proxy: A #GsdAccountsProxy. - * @out_user: (out): Return location for return parameter or %NULL to ignore. - * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_accounts_call_find_user_by_name(). - * @error: Return location for error or %NULL. - * - * Finishes an operation started with gsd_accounts_call_find_user_by_name(). - * - * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. - */ -gboolean -gsd_accounts_call_find_user_by_name_finish ( - GsdAccounts *proxy, - gchar **out_user, - GAsyncResult *res, - GError **error) -{ - GVariant *_ret; - _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); - if (_ret == NULL) - goto _out; - g_variant_get (_ret, - "(o)", - out_user); - g_variant_unref (_ret); -_out: - return _ret != NULL; -} - -/** - * gsd_accounts_call_find_user_by_name_sync: - * @proxy: A #GsdAccountsProxy. - * @arg_name: Argument to pass with the method invocation. - * @out_user: (out): Return location for return parameter or %NULL to ignore. - * @cancellable: (allow-none): A #GCancellable or %NULL. - * @error: Return location for error or %NULL. - * - * Synchronously invokes the FindUserByName() D-Bus method on @proxy. The calling thread is blocked until a reply is received. - * - * See gsd_accounts_call_find_user_by_name() for the asynchronous version of this method. - * - * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. - */ -gboolean -gsd_accounts_call_find_user_by_name_sync ( - GsdAccounts *proxy, - const gchar *arg_name, - gchar **out_user, - GCancellable *cancellable, - GError **error) -{ - GVariant *_ret; - _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), - "FindUserByName", - g_variant_new ("(s)", - arg_name), - G_DBUS_CALL_FLAGS_NONE, - -1, - cancellable, - error); - if (_ret == NULL) - goto _out; - g_variant_get (_ret, - "(o)", - out_user); - g_variant_unref (_ret); -_out: - return _ret != NULL; -} - -/** - * gsd_accounts_call_create_user: - * @proxy: A #GsdAccountsProxy. - * @arg_name: Argument to pass with the method invocation. - * @arg_fullname: Argument to pass with the method invocation. - * @arg_accountType: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. - * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. - * @user_data: User data to pass to @callback. - * - * Asynchronously invokes the CreateUser() D-Bus method on @proxy. - * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. - * You can then call gsd_accounts_call_create_user_finish() to get the result of the operation. - * - * See gsd_accounts_call_create_user_sync() for the synchronous, blocking version of this method. - */ -void -gsd_accounts_call_create_user ( - GsdAccounts *proxy, - const gchar *arg_name, - const gchar *arg_fullname, - gint arg_accountType, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) -{ - g_dbus_proxy_call (G_DBUS_PROXY (proxy), - "CreateUser", - g_variant_new ("(ssi)", - arg_name, - arg_fullname, - arg_accountType), - G_DBUS_CALL_FLAGS_NONE, - -1, - cancellable, - callback, - user_data); -} - -/** - * gsd_accounts_call_create_user_finish: - * @proxy: A #GsdAccountsProxy. - * @out_user: (out): Return location for return parameter or %NULL to ignore. - * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_accounts_call_create_user(). - * @error: Return location for error or %NULL. - * - * Finishes an operation started with gsd_accounts_call_create_user(). - * - * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. - */ -gboolean -gsd_accounts_call_create_user_finish ( - GsdAccounts *proxy, - gchar **out_user, - GAsyncResult *res, - GError **error) -{ - GVariant *_ret; - _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); - if (_ret == NULL) - goto _out; - g_variant_get (_ret, - "(o)", - out_user); - g_variant_unref (_ret); -_out: - return _ret != NULL; -} - -/** - * gsd_accounts_call_create_user_sync: - * @proxy: A #GsdAccountsProxy. - * @arg_name: Argument to pass with the method invocation. - * @arg_fullname: Argument to pass with the method invocation. - * @arg_accountType: Argument to pass with the method invocation. - * @out_user: (out): Return location for return parameter or %NULL to ignore. - * @cancellable: (allow-none): A #GCancellable or %NULL. - * @error: Return location for error or %NULL. - * - * Synchronously invokes the CreateUser() D-Bus method on @proxy. The calling thread is blocked until a reply is received. - * - * See gsd_accounts_call_create_user() for the asynchronous version of this method. - * - * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. - */ -gboolean -gsd_accounts_call_create_user_sync ( - GsdAccounts *proxy, - const gchar *arg_name, - const gchar *arg_fullname, - gint arg_accountType, - gchar **out_user, - GCancellable *cancellable, - GError **error) -{ - GVariant *_ret; - _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), - "CreateUser", - g_variant_new ("(ssi)", - arg_name, - arg_fullname, - arg_accountType), - G_DBUS_CALL_FLAGS_NONE, - -1, - cancellable, - error); - if (_ret == NULL) - goto _out; - g_variant_get (_ret, - "(o)", - out_user); - g_variant_unref (_ret); -_out: - return _ret != NULL; -} - -/** - * gsd_accounts_call_cache_user: - * @proxy: A #GsdAccountsProxy. - * @arg_name: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. - * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. - * @user_data: User data to pass to @callback. - * - * Asynchronously invokes the CacheUser() D-Bus method on @proxy. - * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. - * You can then call gsd_accounts_call_cache_user_finish() to get the result of the operation. - * - * See gsd_accounts_call_cache_user_sync() for the synchronous, blocking version of this method. - */ -void -gsd_accounts_call_cache_user ( - GsdAccounts *proxy, - const gchar *arg_name, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) -{ - g_dbus_proxy_call (G_DBUS_PROXY (proxy), - "CacheUser", - g_variant_new ("(s)", - arg_name), - G_DBUS_CALL_FLAGS_NONE, - -1, - cancellable, - callback, - user_data); -} - -/** - * gsd_accounts_call_cache_user_finish: - * @proxy: A #GsdAccountsProxy. - * @out_user: (out): Return location for return parameter or %NULL to ignore. - * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_accounts_call_cache_user(). - * @error: Return location for error or %NULL. - * - * Finishes an operation started with gsd_accounts_call_cache_user(). - * - * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. - */ -gboolean -gsd_accounts_call_cache_user_finish ( - GsdAccounts *proxy, - gchar **out_user, - GAsyncResult *res, - GError **error) -{ - GVariant *_ret; - _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); - if (_ret == NULL) - goto _out; - g_variant_get (_ret, - "(o)", - out_user); - g_variant_unref (_ret); -_out: - return _ret != NULL; -} - -/** - * gsd_accounts_call_cache_user_sync: - * @proxy: A #GsdAccountsProxy. - * @arg_name: Argument to pass with the method invocation. - * @out_user: (out): Return location for return parameter or %NULL to ignore. - * @cancellable: (allow-none): A #GCancellable or %NULL. - * @error: Return location for error or %NULL. - * - * Synchronously invokes the CacheUser() D-Bus method on @proxy. The calling thread is blocked until a reply is received. - * - * See gsd_accounts_call_cache_user() for the asynchronous version of this method. - * - * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. - */ -gboolean -gsd_accounts_call_cache_user_sync ( - GsdAccounts *proxy, - const gchar *arg_name, - gchar **out_user, - GCancellable *cancellable, - GError **error) -{ - GVariant *_ret; - _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), - "CacheUser", - g_variant_new ("(s)", - arg_name), - G_DBUS_CALL_FLAGS_NONE, - -1, - cancellable, - error); - if (_ret == NULL) - goto _out; - g_variant_get (_ret, - "(o)", - out_user); - g_variant_unref (_ret); -_out: - return _ret != NULL; -} - -/** - * gsd_accounts_call_uncache_user: - * @proxy: A #GsdAccountsProxy. - * @arg_name: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. - * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. - * @user_data: User data to pass to @callback. - * - * Asynchronously invokes the UncacheUser() D-Bus method on @proxy. - * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. - * You can then call gsd_accounts_call_uncache_user_finish() to get the result of the operation. - * - * See gsd_accounts_call_uncache_user_sync() for the synchronous, blocking version of this method. - */ -void -gsd_accounts_call_uncache_user ( - GsdAccounts *proxy, - const gchar *arg_name, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) -{ - g_dbus_proxy_call (G_DBUS_PROXY (proxy), - "UncacheUser", - g_variant_new ("(s)", - arg_name), - G_DBUS_CALL_FLAGS_NONE, - -1, - cancellable, - callback, - user_data); -} - -/** - * gsd_accounts_call_uncache_user_finish: - * @proxy: A #GsdAccountsProxy. - * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_accounts_call_uncache_user(). - * @error: Return location for error or %NULL. - * - * Finishes an operation started with gsd_accounts_call_uncache_user(). - * - * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. - */ -gboolean -gsd_accounts_call_uncache_user_finish ( - GsdAccounts *proxy, - GAsyncResult *res, - GError **error) -{ - GVariant *_ret; - _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); - if (_ret == NULL) - goto _out; - g_variant_get (_ret, - "()"); - g_variant_unref (_ret); -_out: - return _ret != NULL; -} - -/** - * gsd_accounts_call_uncache_user_sync: - * @proxy: A #GsdAccountsProxy. - * @arg_name: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. - * @error: Return location for error or %NULL. - * - * Synchronously invokes the UncacheUser() D-Bus method on @proxy. The calling thread is blocked until a reply is received. - * - * See gsd_accounts_call_uncache_user() for the asynchronous version of this method. - * - * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. - */ -gboolean -gsd_accounts_call_uncache_user_sync ( - GsdAccounts *proxy, - const gchar *arg_name, - GCancellable *cancellable, - GError **error) -{ - GVariant *_ret; - _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), - "UncacheUser", - g_variant_new ("(s)", - arg_name), - G_DBUS_CALL_FLAGS_NONE, - -1, - cancellable, - error); - if (_ret == NULL) - goto _out; - g_variant_get (_ret, - "()"); - g_variant_unref (_ret); -_out: - return _ret != NULL; -} - -/** - * gsd_accounts_call_delete_user: - * @proxy: A #GsdAccountsProxy. - * @arg_id: Argument to pass with the method invocation. - * @arg_removeFiles: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. - * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. - * @user_data: User data to pass to @callback. - * - * Asynchronously invokes the DeleteUser() D-Bus method on @proxy. - * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. - * You can then call gsd_accounts_call_delete_user_finish() to get the result of the operation. - * - * See gsd_accounts_call_delete_user_sync() for the synchronous, blocking version of this method. - */ -void -gsd_accounts_call_delete_user ( - GsdAccounts *proxy, - gint64 arg_id, - gboolean arg_removeFiles, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) -{ - g_dbus_proxy_call (G_DBUS_PROXY (proxy), - "DeleteUser", - g_variant_new ("(xb)", - arg_id, - arg_removeFiles), - G_DBUS_CALL_FLAGS_NONE, - -1, - cancellable, - callback, - user_data); -} - -/** - * gsd_accounts_call_delete_user_finish: - * @proxy: A #GsdAccountsProxy. - * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_accounts_call_delete_user(). - * @error: Return location for error or %NULL. - * - * Finishes an operation started with gsd_accounts_call_delete_user(). - * - * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. - */ -gboolean -gsd_accounts_call_delete_user_finish ( - GsdAccounts *proxy, - GAsyncResult *res, - GError **error) -{ - GVariant *_ret; - _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); - if (_ret == NULL) - goto _out; - g_variant_get (_ret, - "()"); - g_variant_unref (_ret); -_out: - return _ret != NULL; -} - -/** - * gsd_accounts_call_delete_user_sync: - * @proxy: A #GsdAccountsProxy. - * @arg_id: Argument to pass with the method invocation. - * @arg_removeFiles: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. - * @error: Return location for error or %NULL. - * - * Synchronously invokes the DeleteUser() D-Bus method on @proxy. The calling thread is blocked until a reply is received. - * - * See gsd_accounts_call_delete_user() for the asynchronous version of this method. - * - * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. - */ -gboolean -gsd_accounts_call_delete_user_sync ( - GsdAccounts *proxy, - gint64 arg_id, - gboolean arg_removeFiles, - GCancellable *cancellable, - GError **error) -{ - GVariant *_ret; - _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), - "DeleteUser", - g_variant_new ("(xb)", - arg_id, - arg_removeFiles), - G_DBUS_CALL_FLAGS_NONE, - -1, - cancellable, - error); - if (_ret == NULL) - goto _out; - g_variant_get (_ret, - "()"); - g_variant_unref (_ret); -_out: - return _ret != NULL; -} - -/** - * gsd_accounts_complete_list_cached_users: - * @object: A #GsdAccounts. - * @invocation: (transfer full): A #GDBusMethodInvocation. - * @users: Parameter to return. - * - * Helper function used in service implementations to finish handling invocations of the ListCachedUsers() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. - * - * This method will free @invocation, you cannot use it afterwards. - */ -void -gsd_accounts_complete_list_cached_users ( - GsdAccounts *object, - GDBusMethodInvocation *invocation, - const gchar *const *users) -{ - g_dbus_method_invocation_return_value (invocation, - g_variant_new ("(^ao)", - users)); -} - -/** - * gsd_accounts_complete_find_user_by_id: - * @object: A #GsdAccounts. - * @invocation: (transfer full): A #GDBusMethodInvocation. - * @user: Parameter to return. - * - * Helper function used in service implementations to finish handling invocations of the FindUserById() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. - * - * This method will free @invocation, you cannot use it afterwards. - */ -void -gsd_accounts_complete_find_user_by_id ( - GsdAccounts *object, - GDBusMethodInvocation *invocation, - const gchar *user) -{ - g_dbus_method_invocation_return_value (invocation, - g_variant_new ("(o)", - user)); -} - -/** - * gsd_accounts_complete_find_user_by_name: - * @object: A #GsdAccounts. - * @invocation: (transfer full): A #GDBusMethodInvocation. - * @user: Parameter to return. - * - * Helper function used in service implementations to finish handling invocations of the FindUserByName() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. - * - * This method will free @invocation, you cannot use it afterwards. - */ -void -gsd_accounts_complete_find_user_by_name ( - GsdAccounts *object, - GDBusMethodInvocation *invocation, - const gchar *user) -{ - g_dbus_method_invocation_return_value (invocation, - g_variant_new ("(o)", - user)); -} - -/** - * gsd_accounts_complete_create_user: - * @object: A #GsdAccounts. - * @invocation: (transfer full): A #GDBusMethodInvocation. - * @user: Parameter to return. - * - * Helper function used in service implementations to finish handling invocations of the CreateUser() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. - * - * This method will free @invocation, you cannot use it afterwards. - */ -void -gsd_accounts_complete_create_user ( - GsdAccounts *object, - GDBusMethodInvocation *invocation, - const gchar *user) -{ - g_dbus_method_invocation_return_value (invocation, - g_variant_new ("(o)", - user)); -} - -/** - * gsd_accounts_complete_cache_user: - * @object: A #GsdAccounts. - * @invocation: (transfer full): A #GDBusMethodInvocation. - * @user: Parameter to return. - * - * Helper function used in service implementations to finish handling invocations of the CacheUser() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. - * - * This method will free @invocation, you cannot use it afterwards. - */ -void -gsd_accounts_complete_cache_user ( - GsdAccounts *object, - GDBusMethodInvocation *invocation, - const gchar *user) -{ - g_dbus_method_invocation_return_value (invocation, - g_variant_new ("(o)", - user)); -} - -/** - * gsd_accounts_complete_uncache_user: - * @object: A #GsdAccounts. - * @invocation: (transfer full): A #GDBusMethodInvocation. - * - * Helper function used in service implementations to finish handling invocations of the UncacheUser() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. - * - * This method will free @invocation, you cannot use it afterwards. - */ -void -gsd_accounts_complete_uncache_user ( - GsdAccounts *object, - GDBusMethodInvocation *invocation) -{ - g_dbus_method_invocation_return_value (invocation, - g_variant_new ("()")); -} - -/** - * gsd_accounts_complete_delete_user: - * @object: A #GsdAccounts. - * @invocation: (transfer full): A #GDBusMethodInvocation. - * - * Helper function used in service implementations to finish handling invocations of the DeleteUser() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. - * - * This method will free @invocation, you cannot use it afterwards. - */ -void -gsd_accounts_complete_delete_user ( - GsdAccounts *object, - GDBusMethodInvocation *invocation) -{ - g_dbus_method_invocation_return_value (invocation, - g_variant_new ("()")); -} - -/* ------------------------------------------------------------------------ */ - -/** - * GsdAccountsProxy: - * - * The #GsdAccountsProxy structure contains only private data and should only be accessed using the provided API. - */ - -/** - * GsdAccountsProxyClass: - * @parent_class: The parent class. - * - * Class structure for #GsdAccountsProxy. - */ - -struct _GsdAccountsProxyPrivate -{ - GData *qdata; -}; - -static void gsd_accounts_proxy_iface_init (GsdAccountsIface *iface); - -#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 -G_DEFINE_TYPE_WITH_CODE (GsdAccountsProxy, gsd_accounts_proxy, G_TYPE_DBUS_PROXY, - G_ADD_PRIVATE (GsdAccountsProxy) - G_IMPLEMENT_INTERFACE (GSD_TYPE_ACCOUNTS, gsd_accounts_proxy_iface_init)) - -#else -G_DEFINE_TYPE_WITH_CODE (GsdAccountsProxy, gsd_accounts_proxy, G_TYPE_DBUS_PROXY, - G_IMPLEMENT_INTERFACE (GSD_TYPE_ACCOUNTS, gsd_accounts_proxy_iface_init)) - -#endif -static void -gsd_accounts_proxy_finalize (GObject *object) -{ - GsdAccountsProxy *proxy = GSD_ACCOUNTS_PROXY (object); - g_datalist_clear (&proxy->priv->qdata); - G_OBJECT_CLASS (gsd_accounts_proxy_parent_class)->finalize (object); -} - -static void -gsd_accounts_proxy_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec G_GNUC_UNUSED) -{ - const _ExtendedGDBusPropertyInfo *info; - GVariant *variant; - g_assert (prop_id != 0 && prop_id - 1 < 3); - info = _gsd_accounts_property_info_pointers[prop_id - 1]; - variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (object), info->parent_struct.name); - if (info->use_gvariant) - { - g_value_set_variant (value, variant); - } - else - { - if (variant != NULL) - g_dbus_gvariant_to_gvalue (variant, value); - } - if (variant != NULL) - g_variant_unref (variant); -} - -static void -gsd_accounts_proxy_set_property_cb (GDBusProxy *proxy, - GAsyncResult *res, - gpointer user_data) -{ - const _ExtendedGDBusPropertyInfo *info = user_data; - GError *error; - GVariant *_ret; - error = NULL; - _ret = g_dbus_proxy_call_finish (proxy, res, &error); - if (!_ret) - { - g_warning ("Error setting property '%s' on interface org.freedesktop.Accounts: %s (%s, %d)", - info->parent_struct.name, - error->message, g_quark_to_string (error->domain), error->code); - g_error_free (error); - } - else - { - g_variant_unref (_ret); - } -} - -static void -gsd_accounts_proxy_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec G_GNUC_UNUSED) -{ - const _ExtendedGDBusPropertyInfo *info; - GVariant *variant; - g_assert (prop_id != 0 && prop_id - 1 < 3); - info = _gsd_accounts_property_info_pointers[prop_id - 1]; - variant = g_dbus_gvalue_to_gvariant (value, G_VARIANT_TYPE (info->parent_struct.signature)); - g_dbus_proxy_call (G_DBUS_PROXY (object), - "org.freedesktop.DBus.Properties.Set", - g_variant_new ("(ssv)", "org.freedesktop.Accounts", info->parent_struct.name, variant), - G_DBUS_CALL_FLAGS_NONE, - -1, - NULL, (GAsyncReadyCallback) gsd_accounts_proxy_set_property_cb, (GDBusPropertyInfo *) &info->parent_struct); - g_variant_unref (variant); -} - -static void -gsd_accounts_proxy_g_signal (GDBusProxy *proxy, - const gchar *sender_name G_GNUC_UNUSED, - const gchar *signal_name, - GVariant *parameters) -{ - _ExtendedGDBusSignalInfo *info; - GVariantIter iter; - GVariant *child; - GValue *paramv; - gsize num_params; - gsize n; - guint signal_id; - info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_gsd_accounts_interface_info.parent_struct, signal_name); - if (info == NULL) - return; - num_params = g_variant_n_children (parameters); - paramv = g_new0 (GValue, num_params + 1); - g_value_init (¶mv[0], GSD_TYPE_ACCOUNTS); - g_value_set_object (¶mv[0], proxy); - g_variant_iter_init (&iter, parameters); - n = 1; - while ((child = g_variant_iter_next_value (&iter)) != NULL) - { - _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1]; - if (arg_info->use_gvariant) - { - g_value_init (¶mv[n], G_TYPE_VARIANT); - g_value_set_variant (¶mv[n], child); - n++; - } - else - g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); - g_variant_unref (child); - } - signal_id = g_signal_lookup (info->signal_name, GSD_TYPE_ACCOUNTS); - g_signal_emitv (paramv, signal_id, 0, NULL); - for (n = 0; n < num_params + 1; n++) - g_value_unset (¶mv[n]); - g_free (paramv); -} - -static void -gsd_accounts_proxy_g_properties_changed (GDBusProxy *_proxy, - GVariant *changed_properties, - const gchar *const *invalidated_properties) -{ - GsdAccountsProxy *proxy = GSD_ACCOUNTS_PROXY (_proxy); - guint n; - const gchar *key; - GVariantIter *iter; - _ExtendedGDBusPropertyInfo *info; - g_variant_get (changed_properties, "a{sv}", &iter); - while (g_variant_iter_next (iter, "{&sv}", &key, NULL)) - { - info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gsd_accounts_interface_info.parent_struct, key); - g_datalist_remove_data (&proxy->priv->qdata, key); - if (info != NULL) - g_object_notify (G_OBJECT (proxy), info->hyphen_name); - } - g_variant_iter_free (iter); - for (n = 0; invalidated_properties[n] != NULL; n++) - { - info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gsd_accounts_interface_info.parent_struct, invalidated_properties[n]); - g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]); - if (info != NULL) - g_object_notify (G_OBJECT (proxy), info->hyphen_name); - } -} - -static const gchar * -gsd_accounts_proxy_get_daemon_version (GsdAccounts *object) -{ - GsdAccountsProxy *proxy = GSD_ACCOUNTS_PROXY (object); - GVariant *variant; - const gchar *value = NULL; - variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "DaemonVersion"); - if (variant != NULL) - { - value = g_variant_get_string (variant, NULL); - g_variant_unref (variant); - } - return value; -} - -static gboolean -gsd_accounts_proxy_get_has_no_users (GsdAccounts *object) -{ - GsdAccountsProxy *proxy = GSD_ACCOUNTS_PROXY (object); - GVariant *variant; - gboolean value = 0; - variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "HasNoUsers"); - if (variant != NULL) - { - value = g_variant_get_boolean (variant); - g_variant_unref (variant); - } - return value; -} - -static gboolean -gsd_accounts_proxy_get_has_multiple_users (GsdAccounts *object) -{ - GsdAccountsProxy *proxy = GSD_ACCOUNTS_PROXY (object); - GVariant *variant; - gboolean value = 0; - variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "HasMultipleUsers"); - if (variant != NULL) - { - value = g_variant_get_boolean (variant); - g_variant_unref (variant); - } - return value; -} - -static void -gsd_accounts_proxy_init (GsdAccountsProxy *proxy) -{ -#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 - proxy->priv = gsd_accounts_proxy_get_instance_private (proxy); -#else - proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, GSD_TYPE_ACCOUNTS_PROXY, GsdAccountsProxyPrivate); -#endif - - g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), gsd_accounts_interface_info ()); -} - -static void -gsd_accounts_proxy_class_init (GsdAccountsProxyClass *klass) -{ - GObjectClass *gobject_class; - GDBusProxyClass *proxy_class; - - gobject_class = G_OBJECT_CLASS (klass); - gobject_class->finalize = gsd_accounts_proxy_finalize; - gobject_class->get_property = gsd_accounts_proxy_get_property; - gobject_class->set_property = gsd_accounts_proxy_set_property; - - proxy_class = G_DBUS_PROXY_CLASS (klass); - proxy_class->g_signal = gsd_accounts_proxy_g_signal; - proxy_class->g_properties_changed = gsd_accounts_proxy_g_properties_changed; - - gsd_accounts_override_properties (gobject_class, 1); - -#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 - g_type_class_add_private (klass, sizeof (GsdAccountsProxyPrivate)); -#endif -} - -static void -gsd_accounts_proxy_iface_init (GsdAccountsIface *iface) -{ - iface->get_daemon_version = gsd_accounts_proxy_get_daemon_version; - iface->get_has_no_users = gsd_accounts_proxy_get_has_no_users; - iface->get_has_multiple_users = gsd_accounts_proxy_get_has_multiple_users; -} - -/** - * gsd_accounts_proxy_new: - * @connection: A #GDBusConnection. - * @flags: Flags from the #GDBusProxyFlags enumeration. - * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. - * @object_path: An object path. - * @cancellable: (allow-none): A #GCancellable or %NULL. - * @callback: A #GAsyncReadyCallback to call when the request is satisfied. - * @user_data: User data to pass to @callback. - * - * Asynchronously creates a proxy for the D-Bus interface org.freedesktop.Accounts. See g_dbus_proxy_new() for more details. - * - * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. - * You can then call gsd_accounts_proxy_new_finish() to get the result of the operation. - * - * See gsd_accounts_proxy_new_sync() for the synchronous, blocking version of this constructor. - */ -void -gsd_accounts_proxy_new ( - GDBusConnection *connection, - GDBusProxyFlags flags, - const gchar *name, - const gchar *object_path, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) -{ - g_async_initable_new_async (GSD_TYPE_ACCOUNTS_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.Accounts", NULL); -} - -/** - * gsd_accounts_proxy_new_finish: - * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_accounts_proxy_new(). - * @error: Return location for error or %NULL - * - * Finishes an operation started with gsd_accounts_proxy_new(). - * - * Returns: (transfer full) (type GsdAccountsProxy): The constructed proxy object or %NULL if @error is set. - */ -GsdAccounts * -gsd_accounts_proxy_new_finish ( - GAsyncResult *res, - GError **error) -{ - GObject *ret; - GObject *source_object; - source_object = g_async_result_get_source_object (res); - ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); - g_object_unref (source_object); - if (ret != NULL) - return GSD_ACCOUNTS (ret); - else - return NULL; -} - -/** - * gsd_accounts_proxy_new_sync: - * @connection: A #GDBusConnection. - * @flags: Flags from the #GDBusProxyFlags enumeration. - * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. - * @object_path: An object path. - * @cancellable: (allow-none): A #GCancellable or %NULL. - * @error: Return location for error or %NULL - * - * Synchronously creates a proxy for the D-Bus interface org.freedesktop.Accounts. See g_dbus_proxy_new_sync() for more details. - * - * The calling thread is blocked until a reply is received. - * - * See gsd_accounts_proxy_new() for the asynchronous version of this constructor. - * - * Returns: (transfer full) (type GsdAccountsProxy): The constructed proxy object or %NULL if @error is set. - */ -GsdAccounts * -gsd_accounts_proxy_new_sync ( - GDBusConnection *connection, - GDBusProxyFlags flags, - const gchar *name, - const gchar *object_path, - GCancellable *cancellable, - GError **error) -{ - GInitable *ret; - ret = g_initable_new (GSD_TYPE_ACCOUNTS_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.Accounts", NULL); - if (ret != NULL) - return GSD_ACCOUNTS (ret); - else - return NULL; -} - - -/** - * gsd_accounts_proxy_new_for_bus: - * @bus_type: A #GBusType. - * @flags: Flags from the #GDBusProxyFlags enumeration. - * @name: A bus name (well-known or unique). - * @object_path: An object path. - * @cancellable: (allow-none): A #GCancellable or %NULL. - * @callback: A #GAsyncReadyCallback to call when the request is satisfied. - * @user_data: User data to pass to @callback. - * - * Like gsd_accounts_proxy_new() but takes a #GBusType instead of a #GDBusConnection. - * - * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. - * You can then call gsd_accounts_proxy_new_for_bus_finish() to get the result of the operation. - * - * See gsd_accounts_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. - */ -void -gsd_accounts_proxy_new_for_bus ( - GBusType bus_type, - GDBusProxyFlags flags, - const gchar *name, - const gchar *object_path, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) -{ - g_async_initable_new_async (GSD_TYPE_ACCOUNTS_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.Accounts", NULL); -} - -/** - * gsd_accounts_proxy_new_for_bus_finish: - * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_accounts_proxy_new_for_bus(). - * @error: Return location for error or %NULL - * - * Finishes an operation started with gsd_accounts_proxy_new_for_bus(). - * - * Returns: (transfer full) (type GsdAccountsProxy): The constructed proxy object or %NULL if @error is set. - */ -GsdAccounts * -gsd_accounts_proxy_new_for_bus_finish ( - GAsyncResult *res, - GError **error) -{ - GObject *ret; - GObject *source_object; - source_object = g_async_result_get_source_object (res); - ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); - g_object_unref (source_object); - if (ret != NULL) - return GSD_ACCOUNTS (ret); - else - return NULL; -} - -/** - * gsd_accounts_proxy_new_for_bus_sync: - * @bus_type: A #GBusType. - * @flags: Flags from the #GDBusProxyFlags enumeration. - * @name: A bus name (well-known or unique). - * @object_path: An object path. - * @cancellable: (allow-none): A #GCancellable or %NULL. - * @error: Return location for error or %NULL - * - * Like gsd_accounts_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. - * - * The calling thread is blocked until a reply is received. - * - * See gsd_accounts_proxy_new_for_bus() for the asynchronous version of this constructor. - * - * Returns: (transfer full) (type GsdAccountsProxy): The constructed proxy object or %NULL if @error is set. - */ -GsdAccounts * -gsd_accounts_proxy_new_for_bus_sync ( - GBusType bus_type, - GDBusProxyFlags flags, - const gchar *name, - const gchar *object_path, - GCancellable *cancellable, - GError **error) -{ - GInitable *ret; - ret = g_initable_new (GSD_TYPE_ACCOUNTS_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.Accounts", NULL); - if (ret != NULL) - return GSD_ACCOUNTS (ret); - else - return NULL; -} - - -/* ------------------------------------------------------------------------ */ - -/** - * GsdAccountsSkeleton: - * - * The #GsdAccountsSkeleton structure contains only private data and should only be accessed using the provided API. - */ - -/** - * GsdAccountsSkeletonClass: - * @parent_class: The parent class. - * - * Class structure for #GsdAccountsSkeleton. - */ - -struct _GsdAccountsSkeletonPrivate -{ - GValue *properties; - GList *changed_properties; - GSource *changed_properties_idle_source; - GMainContext *context; - GMutex lock; -}; - -static void -_gsd_accounts_skeleton_handle_method_call ( - GDBusConnection *connection G_GNUC_UNUSED, - const gchar *sender G_GNUC_UNUSED, - const gchar *object_path G_GNUC_UNUSED, - const gchar *interface_name, - const gchar *method_name, - GVariant *parameters, - GDBusMethodInvocation *invocation, - gpointer user_data) -{ - GsdAccountsSkeleton *skeleton = GSD_ACCOUNTS_SKELETON (user_data); - _ExtendedGDBusMethodInfo *info; - GVariantIter iter; - GVariant *child; - GValue *paramv; - gsize num_params; - guint num_extra; - gsize n; - guint signal_id; - GValue return_value = G_VALUE_INIT; - info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation); - g_assert (info != NULL); - num_params = g_variant_n_children (parameters); - num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra); - n = 0; - g_value_init (¶mv[n], GSD_TYPE_ACCOUNTS); - g_value_set_object (¶mv[n++], skeleton); - g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION); - g_value_set_object (¶mv[n++], invocation); - if (info->pass_fdlist) - { -#ifdef G_OS_UNIX - g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST); - g_value_set_object (¶mv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation))); -#else - g_assert_not_reached (); -#endif - } - g_variant_iter_init (&iter, parameters); - while ((child = g_variant_iter_next_value (&iter)) != NULL) - { - _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra]; - if (arg_info->use_gvariant) - { - g_value_init (¶mv[n], G_TYPE_VARIANT); - g_value_set_variant (¶mv[n], child); - n++; - } - else - g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); - g_variant_unref (child); - } - signal_id = g_signal_lookup (info->signal_name, GSD_TYPE_ACCOUNTS); - g_value_init (&return_value, G_TYPE_BOOLEAN); - g_signal_emitv (paramv, signal_id, 0, &return_value); - if (!g_value_get_boolean (&return_value)) - g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name); - g_value_unset (&return_value); - for (n = 0; n < num_params + num_extra; n++) - g_value_unset (¶mv[n]); - g_free (paramv); -} - -static GVariant * -_gsd_accounts_skeleton_handle_get_property ( - GDBusConnection *connection G_GNUC_UNUSED, - const gchar *sender G_GNUC_UNUSED, - const gchar *object_path G_GNUC_UNUSED, - const gchar *interface_name G_GNUC_UNUSED, - const gchar *property_name, - GError **error, - gpointer user_data) -{ - GsdAccountsSkeleton *skeleton = GSD_ACCOUNTS_SKELETON (user_data); - GValue value = G_VALUE_INIT; - GParamSpec *pspec; - _ExtendedGDBusPropertyInfo *info; - GVariant *ret; - ret = NULL; - info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gsd_accounts_interface_info.parent_struct, property_name); - g_assert (info != NULL); - pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); - if (pspec == NULL) - { - g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); - } - else - { - g_value_init (&value, pspec->value_type); - g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value); - ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature)); - g_value_unset (&value); - } - return ret; -} - -static gboolean -_gsd_accounts_skeleton_handle_set_property ( - GDBusConnection *connection G_GNUC_UNUSED, - const gchar *sender G_GNUC_UNUSED, - const gchar *object_path G_GNUC_UNUSED, - const gchar *interface_name G_GNUC_UNUSED, - const gchar *property_name, - GVariant *variant, - GError **error, - gpointer user_data) -{ - GsdAccountsSkeleton *skeleton = GSD_ACCOUNTS_SKELETON (user_data); - GValue value = G_VALUE_INIT; - GParamSpec *pspec; - _ExtendedGDBusPropertyInfo *info; - gboolean ret; - ret = FALSE; - info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gsd_accounts_interface_info.parent_struct, property_name); - g_assert (info != NULL); - pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); - if (pspec == NULL) - { - g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); - } - else - { - if (info->use_gvariant) - g_value_set_variant (&value, variant); - else - g_dbus_gvariant_to_gvalue (variant, &value); - g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value); - g_value_unset (&value); - ret = TRUE; - } - return ret; -} - -static const GDBusInterfaceVTable _gsd_accounts_skeleton_vtable = -{ - _gsd_accounts_skeleton_handle_method_call, - _gsd_accounts_skeleton_handle_get_property, - _gsd_accounts_skeleton_handle_set_property, - {NULL} -}; - -static GDBusInterfaceInfo * -gsd_accounts_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) -{ - return gsd_accounts_interface_info (); -} - -static GDBusInterfaceVTable * -gsd_accounts_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) -{ - return (GDBusInterfaceVTable *) &_gsd_accounts_skeleton_vtable; -} - -static GVariant * -gsd_accounts_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton) -{ - GsdAccountsSkeleton *skeleton = GSD_ACCOUNTS_SKELETON (_skeleton); - - GVariantBuilder builder; - guint n; - g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); - if (_gsd_accounts_interface_info.parent_struct.properties == NULL) - goto out; - for (n = 0; _gsd_accounts_interface_info.parent_struct.properties[n] != NULL; n++) - { - GDBusPropertyInfo *info = _gsd_accounts_interface_info.parent_struct.properties[n]; - if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE) - { - GVariant *value; - value = _gsd_accounts_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.freedesktop.Accounts", info->name, NULL, skeleton); - if (value != NULL) - { - g_variant_take_ref (value); - g_variant_builder_add (&builder, "{sv}", info->name, value); - g_variant_unref (value); - } - } - } -out: - return g_variant_builder_end (&builder); -} - -static gboolean _gsd_accounts_emit_changed (gpointer user_data); - -static void -gsd_accounts_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton) -{ - GsdAccountsSkeleton *skeleton = GSD_ACCOUNTS_SKELETON (_skeleton); - gboolean emit_changed = FALSE; - - g_mutex_lock (&skeleton->priv->lock); - if (skeleton->priv->changed_properties_idle_source != NULL) - { - g_source_destroy (skeleton->priv->changed_properties_idle_source); - skeleton->priv->changed_properties_idle_source = NULL; - emit_changed = TRUE; - } - g_mutex_unlock (&skeleton->priv->lock); - - if (emit_changed) - _gsd_accounts_emit_changed (skeleton); -} - -static void -_gsd_accounts_on_signal_user_added ( - GsdAccounts *object, - const gchar *arg_user) -{ - GsdAccountsSkeleton *skeleton = GSD_ACCOUNTS_SKELETON (object); - - GList *connections, *l; - GVariant *signal_variant; - connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); - - signal_variant = g_variant_ref_sink (g_variant_new ("(o)", - arg_user)); - for (l = connections; l != NULL; l = l->next) - { - GDBusConnection *connection = l->data; - g_dbus_connection_emit_signal (connection, - NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.freedesktop.Accounts", "UserAdded", - signal_variant, NULL); - } - g_variant_unref (signal_variant); - g_list_free_full (connections, g_object_unref); -} - -static void -_gsd_accounts_on_signal_user_deleted ( - GsdAccounts *object, - const gchar *arg_user) -{ - GsdAccountsSkeleton *skeleton = GSD_ACCOUNTS_SKELETON (object); - - GList *connections, *l; - GVariant *signal_variant; - connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); - - signal_variant = g_variant_ref_sink (g_variant_new ("(o)", - arg_user)); - for (l = connections; l != NULL; l = l->next) - { - GDBusConnection *connection = l->data; - g_dbus_connection_emit_signal (connection, - NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.freedesktop.Accounts", "UserDeleted", - signal_variant, NULL); - } - g_variant_unref (signal_variant); - g_list_free_full (connections, g_object_unref); -} - -static void gsd_accounts_skeleton_iface_init (GsdAccountsIface *iface); -#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 -G_DEFINE_TYPE_WITH_CODE (GsdAccountsSkeleton, gsd_accounts_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, - G_ADD_PRIVATE (GsdAccountsSkeleton) - G_IMPLEMENT_INTERFACE (GSD_TYPE_ACCOUNTS, gsd_accounts_skeleton_iface_init)) - -#else -G_DEFINE_TYPE_WITH_CODE (GsdAccountsSkeleton, gsd_accounts_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, - G_IMPLEMENT_INTERFACE (GSD_TYPE_ACCOUNTS, gsd_accounts_skeleton_iface_init)) - -#endif -static void -gsd_accounts_skeleton_finalize (GObject *object) -{ - GsdAccountsSkeleton *skeleton = GSD_ACCOUNTS_SKELETON (object); - guint n; - for (n = 0; n < 3; n++) - g_value_unset (&skeleton->priv->properties[n]); - g_free (skeleton->priv->properties); - g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free); - if (skeleton->priv->changed_properties_idle_source != NULL) - g_source_destroy (skeleton->priv->changed_properties_idle_source); - g_main_context_unref (skeleton->priv->context); - g_mutex_clear (&skeleton->priv->lock); - G_OBJECT_CLASS (gsd_accounts_skeleton_parent_class)->finalize (object); -} - -static void -gsd_accounts_skeleton_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec G_GNUC_UNUSED) -{ - GsdAccountsSkeleton *skeleton = GSD_ACCOUNTS_SKELETON (object); - g_assert (prop_id != 0 && prop_id - 1 < 3); - g_mutex_lock (&skeleton->priv->lock); - g_value_copy (&skeleton->priv->properties[prop_id - 1], value); - g_mutex_unlock (&skeleton->priv->lock); -} - -static gboolean -_gsd_accounts_emit_changed (gpointer user_data) -{ - GsdAccountsSkeleton *skeleton = GSD_ACCOUNTS_SKELETON (user_data); - GList *l; - GVariantBuilder builder; - GVariantBuilder invalidated_builder; - guint num_changes; - - g_mutex_lock (&skeleton->priv->lock); - g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); - g_variant_builder_init (&invalidated_builder, G_VARIANT_TYPE ("as")); - for (l = skeleton->priv->changed_properties, num_changes = 0; l != NULL; l = l->next) - { - ChangedProperty *cp = l->data; - GVariant *variant; - const GValue *cur_value; - - cur_value = &skeleton->priv->properties[cp->prop_id - 1]; - if (!_g_value_equal (cur_value, &cp->orig_value)) - { - variant = g_dbus_gvalue_to_gvariant (cur_value, G_VARIANT_TYPE (cp->info->parent_struct.signature)); - g_variant_builder_add (&builder, "{sv}", cp->info->parent_struct.name, variant); - g_variant_unref (variant); - num_changes++; - } - } - if (num_changes > 0) - { - GList *connections, *ll; - GVariant *signal_variant; - signal_variant = g_variant_ref_sink (g_variant_new ("(sa{sv}as)", "org.freedesktop.Accounts", - &builder, &invalidated_builder)); - connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); - for (ll = connections; ll != NULL; ll = ll->next) - { - GDBusConnection *connection = ll->data; - - g_dbus_connection_emit_signal (connection, - NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), - "org.freedesktop.DBus.Properties", - "PropertiesChanged", - signal_variant, - NULL); - } - g_variant_unref (signal_variant); - g_list_free_full (connections, g_object_unref); - } - else - { - g_variant_builder_clear (&builder); - g_variant_builder_clear (&invalidated_builder); - } - g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free); - skeleton->priv->changed_properties = NULL; - skeleton->priv->changed_properties_idle_source = NULL; - g_mutex_unlock (&skeleton->priv->lock); - return FALSE; -} - -static void -_gsd_accounts_schedule_emit_changed (GsdAccountsSkeleton *skeleton, const _ExtendedGDBusPropertyInfo *info, guint prop_id, const GValue *orig_value) -{ - ChangedProperty *cp; - GList *l; - cp = NULL; - for (l = skeleton->priv->changed_properties; l != NULL; l = l->next) - { - ChangedProperty *i_cp = l->data; - if (i_cp->info == info) - { - cp = i_cp; - break; - } - } - if (cp == NULL) - { - cp = g_new0 (ChangedProperty, 1); - cp->prop_id = prop_id; - cp->info = info; - skeleton->priv->changed_properties = g_list_prepend (skeleton->priv->changed_properties, cp); - g_value_init (&cp->orig_value, G_VALUE_TYPE (orig_value)); - g_value_copy (orig_value, &cp->orig_value); - } -} - -static void -gsd_accounts_skeleton_notify (GObject *object, - GParamSpec *pspec G_GNUC_UNUSED) -{ - GsdAccountsSkeleton *skeleton = GSD_ACCOUNTS_SKELETON (object); - g_mutex_lock (&skeleton->priv->lock); - if (skeleton->priv->changed_properties != NULL && - skeleton->priv->changed_properties_idle_source == NULL) - { - skeleton->priv->changed_properties_idle_source = g_idle_source_new (); - g_source_set_priority (skeleton->priv->changed_properties_idle_source, G_PRIORITY_DEFAULT); - g_source_set_callback (skeleton->priv->changed_properties_idle_source, _gsd_accounts_emit_changed, g_object_ref (skeleton), (GDestroyNotify) g_object_unref); - g_source_set_name (skeleton->priv->changed_properties_idle_source, "[generated] _gsd_accounts_emit_changed"); - g_source_attach (skeleton->priv->changed_properties_idle_source, skeleton->priv->context); - g_source_unref (skeleton->priv->changed_properties_idle_source); - } - g_mutex_unlock (&skeleton->priv->lock); -} - -static void -gsd_accounts_skeleton_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - GsdAccountsSkeleton *skeleton = GSD_ACCOUNTS_SKELETON (object); - g_assert (prop_id != 0 && prop_id - 1 < 3); - g_mutex_lock (&skeleton->priv->lock); - g_object_freeze_notify (object); - if (!_g_value_equal (value, &skeleton->priv->properties[prop_id - 1])) - { - if (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)) != NULL) - _gsd_accounts_schedule_emit_changed (skeleton, _gsd_accounts_property_info_pointers[prop_id - 1], prop_id, &skeleton->priv->properties[prop_id - 1]); - g_value_copy (value, &skeleton->priv->properties[prop_id - 1]); - g_object_notify_by_pspec (object, pspec); - } - g_mutex_unlock (&skeleton->priv->lock); - g_object_thaw_notify (object); -} - -static void -gsd_accounts_skeleton_init (GsdAccountsSkeleton *skeleton) -{ -#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 - skeleton->priv = gsd_accounts_skeleton_get_instance_private (skeleton); -#else - skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, GSD_TYPE_ACCOUNTS_SKELETON, GsdAccountsSkeletonPrivate); -#endif - - g_mutex_init (&skeleton->priv->lock); - skeleton->priv->context = g_main_context_ref_thread_default (); - skeleton->priv->properties = g_new0 (GValue, 3); - g_value_init (&skeleton->priv->properties[0], G_TYPE_STRING); - g_value_init (&skeleton->priv->properties[1], G_TYPE_BOOLEAN); - g_value_init (&skeleton->priv->properties[2], G_TYPE_BOOLEAN); -} - -static const gchar * -gsd_accounts_skeleton_get_daemon_version (GsdAccounts *object) -{ - GsdAccountsSkeleton *skeleton = GSD_ACCOUNTS_SKELETON (object); - const gchar *value; - g_mutex_lock (&skeleton->priv->lock); - value = g_value_get_string (&(skeleton->priv->properties[0])); - g_mutex_unlock (&skeleton->priv->lock); - return value; -} - -static gboolean -gsd_accounts_skeleton_get_has_no_users (GsdAccounts *object) -{ - GsdAccountsSkeleton *skeleton = GSD_ACCOUNTS_SKELETON (object); - gboolean value; - g_mutex_lock (&skeleton->priv->lock); - value = g_value_get_boolean (&(skeleton->priv->properties[1])); - g_mutex_unlock (&skeleton->priv->lock); - return value; -} - -static gboolean -gsd_accounts_skeleton_get_has_multiple_users (GsdAccounts *object) -{ - GsdAccountsSkeleton *skeleton = GSD_ACCOUNTS_SKELETON (object); - gboolean value; - g_mutex_lock (&skeleton->priv->lock); - value = g_value_get_boolean (&(skeleton->priv->properties[2])); - g_mutex_unlock (&skeleton->priv->lock); - return value; -} - -static void -gsd_accounts_skeleton_class_init (GsdAccountsSkeletonClass *klass) -{ - GObjectClass *gobject_class; - GDBusInterfaceSkeletonClass *skeleton_class; - - gobject_class = G_OBJECT_CLASS (klass); - gobject_class->finalize = gsd_accounts_skeleton_finalize; - gobject_class->get_property = gsd_accounts_skeleton_get_property; - gobject_class->set_property = gsd_accounts_skeleton_set_property; - gobject_class->notify = gsd_accounts_skeleton_notify; - - - gsd_accounts_override_properties (gobject_class, 1); - - skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass); - skeleton_class->get_info = gsd_accounts_skeleton_dbus_interface_get_info; - skeleton_class->get_properties = gsd_accounts_skeleton_dbus_interface_get_properties; - skeleton_class->flush = gsd_accounts_skeleton_dbus_interface_flush; - skeleton_class->get_vtable = gsd_accounts_skeleton_dbus_interface_get_vtable; - -#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 - g_type_class_add_private (klass, sizeof (GsdAccountsSkeletonPrivate)); -#endif -} - -static void -gsd_accounts_skeleton_iface_init (GsdAccountsIface *iface) -{ - iface->user_added = _gsd_accounts_on_signal_user_added; - iface->user_deleted = _gsd_accounts_on_signal_user_deleted; - iface->get_daemon_version = gsd_accounts_skeleton_get_daemon_version; - iface->get_has_no_users = gsd_accounts_skeleton_get_has_no_users; - iface->get_has_multiple_users = gsd_accounts_skeleton_get_has_multiple_users; -} - -/** - * gsd_accounts_skeleton_new: - * - * Creates a skeleton object for the D-Bus interface org.freedesktop.Accounts. - * - * Returns: (transfer full) (type GsdAccountsSkeleton): The skeleton object. - */ -GsdAccounts * -gsd_accounts_skeleton_new (void) -{ - return GSD_ACCOUNTS (g_object_new (GSD_TYPE_ACCOUNTS_SKELETON, NULL)); -} diff --git a/plugins/account/org.freedesktop.Accounts.h b/plugins/account/org.freedesktop.Accounts.h deleted file mode 100644 index b8d0625..0000000 --- a/plugins/account/org.freedesktop.Accounts.h +++ /dev/null @@ -1,400 +0,0 @@ -/* - * Generated by gdbus-codegen 2.54.1. DO NOT EDIT. - * - * The license of this code is the same as for the source it was derived from. - */ - -#ifndef __ORG_FREEDESKTOP_ACCOUNTS_H__ -#define __ORG_FREEDESKTOP_ACCOUNTS_H__ - -#include - -G_BEGIN_DECLS - - -/* ------------------------------------------------------------------------ */ -/* Declarations for org.freedesktop.Accounts */ - -#define GSD_TYPE_ACCOUNTS (gsd_accounts_get_type ()) -#define GSD_ACCOUNTS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GSD_TYPE_ACCOUNTS, GsdAccounts)) -#define GSD_IS_ACCOUNTS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSD_TYPE_ACCOUNTS)) -#define GSD_ACCOUNTS_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), GSD_TYPE_ACCOUNTS, GsdAccountsIface)) - -struct _GsdAccounts; -typedef struct _GsdAccounts GsdAccounts; -typedef struct _GsdAccountsIface GsdAccountsIface; - -struct _GsdAccountsIface -{ - GTypeInterface parent_iface; - - - - gboolean (*handle_cache_user) ( - GsdAccounts *object, - GDBusMethodInvocation *invocation, - const gchar *arg_name); - - gboolean (*handle_create_user) ( - GsdAccounts *object, - GDBusMethodInvocation *invocation, - const gchar *arg_name, - const gchar *arg_fullname, - gint arg_accountType); - - gboolean (*handle_delete_user) ( - GsdAccounts *object, - GDBusMethodInvocation *invocation, - gint64 arg_id, - gboolean arg_removeFiles); - - gboolean (*handle_find_user_by_id) ( - GsdAccounts *object, - GDBusMethodInvocation *invocation, - gint64 arg_id); - - gboolean (*handle_find_user_by_name) ( - GsdAccounts *object, - GDBusMethodInvocation *invocation, - const gchar *arg_name); - - gboolean (*handle_list_cached_users) ( - GsdAccounts *object, - GDBusMethodInvocation *invocation); - - gboolean (*handle_uncache_user) ( - GsdAccounts *object, - GDBusMethodInvocation *invocation, - const gchar *arg_name); - - const gchar * (*get_daemon_version) (GsdAccounts *object); - - gboolean (*get_has_multiple_users) (GsdAccounts *object); - - gboolean (*get_has_no_users) (GsdAccounts *object); - - void (*user_added) ( - GsdAccounts *object, - const gchar *arg_user); - - void (*user_deleted) ( - GsdAccounts *object, - const gchar *arg_user); - -}; - -GType gsd_accounts_get_type (void) G_GNUC_CONST; - -GDBusInterfaceInfo *gsd_accounts_interface_info (void); -guint gsd_accounts_override_properties (GObjectClass *klass, guint property_id_begin); - - -/* D-Bus method call completion functions: */ -void gsd_accounts_complete_list_cached_users ( - GsdAccounts *object, - GDBusMethodInvocation *invocation, - const gchar *const *users); - -void gsd_accounts_complete_find_user_by_id ( - GsdAccounts *object, - GDBusMethodInvocation *invocation, - const gchar *user); - -void gsd_accounts_complete_find_user_by_name ( - GsdAccounts *object, - GDBusMethodInvocation *invocation, - const gchar *user); - -void gsd_accounts_complete_create_user ( - GsdAccounts *object, - GDBusMethodInvocation *invocation, - const gchar *user); - -void gsd_accounts_complete_cache_user ( - GsdAccounts *object, - GDBusMethodInvocation *invocation, - const gchar *user); - -void gsd_accounts_complete_uncache_user ( - GsdAccounts *object, - GDBusMethodInvocation *invocation); - -void gsd_accounts_complete_delete_user ( - GsdAccounts *object, - GDBusMethodInvocation *invocation); - - - -/* D-Bus signal emissions functions: */ -void gsd_accounts_emit_user_added ( - GsdAccounts *object, - const gchar *arg_user); - -void gsd_accounts_emit_user_deleted ( - GsdAccounts *object, - const gchar *arg_user); - - - -/* D-Bus method calls: */ -void gsd_accounts_call_list_cached_users ( - GsdAccounts *proxy, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data); - -gboolean gsd_accounts_call_list_cached_users_finish ( - GsdAccounts *proxy, - gchar ***out_users, - GAsyncResult *res, - GError **error); - -gboolean gsd_accounts_call_list_cached_users_sync ( - GsdAccounts *proxy, - gchar ***out_users, - GCancellable *cancellable, - GError **error); - -void gsd_accounts_call_find_user_by_id ( - GsdAccounts *proxy, - gint64 arg_id, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data); - -gboolean gsd_accounts_call_find_user_by_id_finish ( - GsdAccounts *proxy, - gchar **out_user, - GAsyncResult *res, - GError **error); - -gboolean gsd_accounts_call_find_user_by_id_sync ( - GsdAccounts *proxy, - gint64 arg_id, - gchar **out_user, - GCancellable *cancellable, - GError **error); - -void gsd_accounts_call_find_user_by_name ( - GsdAccounts *proxy, - const gchar *arg_name, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data); - -gboolean gsd_accounts_call_find_user_by_name_finish ( - GsdAccounts *proxy, - gchar **out_user, - GAsyncResult *res, - GError **error); - -gboolean gsd_accounts_call_find_user_by_name_sync ( - GsdAccounts *proxy, - const gchar *arg_name, - gchar **out_user, - GCancellable *cancellable, - GError **error); - -void gsd_accounts_call_create_user ( - GsdAccounts *proxy, - const gchar *arg_name, - const gchar *arg_fullname, - gint arg_accountType, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data); - -gboolean gsd_accounts_call_create_user_finish ( - GsdAccounts *proxy, - gchar **out_user, - GAsyncResult *res, - GError **error); - -gboolean gsd_accounts_call_create_user_sync ( - GsdAccounts *proxy, - const gchar *arg_name, - const gchar *arg_fullname, - gint arg_accountType, - gchar **out_user, - GCancellable *cancellable, - GError **error); - -void gsd_accounts_call_cache_user ( - GsdAccounts *proxy, - const gchar *arg_name, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data); - -gboolean gsd_accounts_call_cache_user_finish ( - GsdAccounts *proxy, - gchar **out_user, - GAsyncResult *res, - GError **error); - -gboolean gsd_accounts_call_cache_user_sync ( - GsdAccounts *proxy, - const gchar *arg_name, - gchar **out_user, - GCancellable *cancellable, - GError **error); - -void gsd_accounts_call_uncache_user ( - GsdAccounts *proxy, - const gchar *arg_name, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data); - -gboolean gsd_accounts_call_uncache_user_finish ( - GsdAccounts *proxy, - GAsyncResult *res, - GError **error); - -gboolean gsd_accounts_call_uncache_user_sync ( - GsdAccounts *proxy, - const gchar *arg_name, - GCancellable *cancellable, - GError **error); - -void gsd_accounts_call_delete_user ( - GsdAccounts *proxy, - gint64 arg_id, - gboolean arg_removeFiles, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data); - -gboolean gsd_accounts_call_delete_user_finish ( - GsdAccounts *proxy, - GAsyncResult *res, - GError **error); - -gboolean gsd_accounts_call_delete_user_sync ( - GsdAccounts *proxy, - gint64 arg_id, - gboolean arg_removeFiles, - GCancellable *cancellable, - GError **error); - - - -/* D-Bus property accessors: */ -const gchar *gsd_accounts_get_daemon_version (GsdAccounts *object); -gchar *gsd_accounts_dup_daemon_version (GsdAccounts *object); -void gsd_accounts_set_daemon_version (GsdAccounts *object, const gchar *value); - -gboolean gsd_accounts_get_has_no_users (GsdAccounts *object); -void gsd_accounts_set_has_no_users (GsdAccounts *object, gboolean value); - -gboolean gsd_accounts_get_has_multiple_users (GsdAccounts *object); -void gsd_accounts_set_has_multiple_users (GsdAccounts *object, gboolean value); - - -/* ---- */ - -#define GSD_TYPE_ACCOUNTS_PROXY (gsd_accounts_proxy_get_type ()) -#define GSD_ACCOUNTS_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GSD_TYPE_ACCOUNTS_PROXY, GsdAccountsProxy)) -#define GSD_ACCOUNTS_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GSD_TYPE_ACCOUNTS_PROXY, GsdAccountsProxyClass)) -#define GSD_ACCOUNTS_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GSD_TYPE_ACCOUNTS_PROXY, GsdAccountsProxyClass)) -#define GSD_IS_ACCOUNTS_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSD_TYPE_ACCOUNTS_PROXY)) -#define GSD_IS_ACCOUNTS_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GSD_TYPE_ACCOUNTS_PROXY)) - -typedef struct _GsdAccountsProxy GsdAccountsProxy; -typedef struct _GsdAccountsProxyClass GsdAccountsProxyClass; -typedef struct _GsdAccountsProxyPrivate GsdAccountsProxyPrivate; - -struct _GsdAccountsProxy -{ - /*< private >*/ - GDBusProxy parent_instance; - GsdAccountsProxyPrivate *priv; -}; - -struct _GsdAccountsProxyClass -{ - GDBusProxyClass parent_class; -}; - -GType gsd_accounts_proxy_get_type (void) G_GNUC_CONST; - -#if GLIB_CHECK_VERSION(2, 44, 0) -G_DEFINE_AUTOPTR_CLEANUP_FUNC (GsdAccountsProxy, g_object_unref) -#endif - -void gsd_accounts_proxy_new ( - GDBusConnection *connection, - GDBusProxyFlags flags, - const gchar *name, - const gchar *object_path, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data); -GsdAccounts *gsd_accounts_proxy_new_finish ( - GAsyncResult *res, - GError **error); -GsdAccounts *gsd_accounts_proxy_new_sync ( - GDBusConnection *connection, - GDBusProxyFlags flags, - const gchar *name, - const gchar *object_path, - GCancellable *cancellable, - GError **error); - -void gsd_accounts_proxy_new_for_bus ( - GBusType bus_type, - GDBusProxyFlags flags, - const gchar *name, - const gchar *object_path, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data); -GsdAccounts *gsd_accounts_proxy_new_for_bus_finish ( - GAsyncResult *res, - GError **error); -GsdAccounts *gsd_accounts_proxy_new_for_bus_sync ( - GBusType bus_type, - GDBusProxyFlags flags, - const gchar *name, - const gchar *object_path, - GCancellable *cancellable, - GError **error); - - -/* ---- */ - -#define GSD_TYPE_ACCOUNTS_SKELETON (gsd_accounts_skeleton_get_type ()) -#define GSD_ACCOUNTS_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GSD_TYPE_ACCOUNTS_SKELETON, GsdAccountsSkeleton)) -#define GSD_ACCOUNTS_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GSD_TYPE_ACCOUNTS_SKELETON, GsdAccountsSkeletonClass)) -#define GSD_ACCOUNTS_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GSD_TYPE_ACCOUNTS_SKELETON, GsdAccountsSkeletonClass)) -#define GSD_IS_ACCOUNTS_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSD_TYPE_ACCOUNTS_SKELETON)) -#define GSD_IS_ACCOUNTS_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GSD_TYPE_ACCOUNTS_SKELETON)) - -typedef struct _GsdAccountsSkeleton GsdAccountsSkeleton; -typedef struct _GsdAccountsSkeletonClass GsdAccountsSkeletonClass; -typedef struct _GsdAccountsSkeletonPrivate GsdAccountsSkeletonPrivate; - -struct _GsdAccountsSkeleton -{ - /*< private >*/ - GDBusInterfaceSkeleton parent_instance; - GsdAccountsSkeletonPrivate *priv; -}; - -struct _GsdAccountsSkeletonClass -{ - GDBusInterfaceSkeletonClass parent_class; -}; - -GType gsd_accounts_skeleton_get_type (void) G_GNUC_CONST; - -#if GLIB_CHECK_VERSION(2, 44, 0) -G_DEFINE_AUTOPTR_CLEANUP_FUNC (GsdAccountsSkeleton, g_object_unref) -#endif - -GsdAccounts *gsd_accounts_skeleton_new (void); - - -G_END_DECLS - -#endif /* __ORG_FREEDESKTOP_ACCOUNTS_H__ */ diff --git a/plugins/account/org.freedesktop.Accounts.xml b/plugins/account/org.freedesktop.Accounts.xml deleted file mode 100644 index ed7db50..0000000 --- a/plugins/account/org.freedesktop.Accounts.xml +++ /dev/null @@ -1,248 +0,0 @@ - - - - - - - - - - Object paths of cached users - - - - - - Lists users which have logged into the system locally before. - This is not meant to return an exhaustive list of all users. - It is possible for FindUserByName() - to return a user that's not on the list. - - - - - - - - - The uid to look up - - - Object path of user - - - - - - Finds a user by uid. - - - - if no user with the given uid exists - - - - - - - - The username to look up - - - Object path of user - - - - - - Finds a user by its username. - - - - if no user with the given username exists - - - - - - - - The username for the new user - - - - The real name for the new user - - - Object path of the new user - - - - The account type, encoded as an integer - - - - - - Creates a new user account. - - - The accountType argument can take the following values: - - - - 0 - Standard user - - - 1 - Administrator - - - - - The caller needs the org.freedesktop.accounts.user-administration PolicyKit authorization. - - - if the caller lacks the appropriate PolicyKit authorization - if the operation failed - - - - - - - - The username for the user - - - Object path of user - - - - - - Caches a user account, so that it shows up in ListCachedUsers() output. - The user name may be a remote user, but the system must be able to lookup - the user name and resolve the user information. - - - - The caller needs the org.freedesktop.accounts.user-administration PolicyKit authorization. - - - if the caller lacks the appropriate PolicyKit authorization - if the user name cannot be resolved - - - - - - - - The username for the user - - - - - - Releases all metadata about a user account, including icon, language and session. If the user account is - from a remote server and the user has never logged in before, then that account will no longer show up - in ListCachedUsers() output. - - - - The caller needs the org.freedesktop.accounts.user-administration PolicyKit authorization. - - - if the caller lacks the appropriate PolicyKit authorization - if the user name cannot be resolved - - - - - - - - The uid to delete - - - Whether to remove the users files - - - - - - Deletes a user account. - - - - The caller needs the org.freedesktop.accounts.user-administration PolicyKit authorization. - - - if the caller lacks the appropriate PolicyKit authorization - if the operation failed - - - - - - - Object path of the user that was added. - - - - - Emitted when a user is added. - - - - - - - - Object path of the user that was deleted. - - - - - Emitted when a user is deleted. - - - - - - - - - - The version of the running daemon. - - - - - - - - - - Whether or not the system has no users - - - - - - - - - - Whether or not the system has multiple users - - - - - - - diff --git a/plugins/account/org.gnome.SettingsDaemon.Account.desktop b/plugins/account/org.gnome.SettingsDaemon.Account.desktop deleted file mode 100644 index 388fbd5..0000000 --- a/plugins/account/org.gnome.SettingsDaemon.Account.desktop +++ /dev/null @@ -1,9 +0,0 @@ -[Desktop Entry] -Type=Application -Name=GNOME Settings Daemon's housekeeping plugin -Exec=/usr/libexec/gsd-account -OnlyShowIn=GNOME; -NoDisplay=true -X-GNOME-Autostart-Phase=Initialization -X-GNOME-Autostart-Notify=true -X-GNOME-AutoRestart=true diff --git a/plugins/account/org.gnome.SettingsDaemon.Account.desktop.in b/plugins/account/org.gnome.SettingsDaemon.Account.desktop.in deleted file mode 100644 index 1a8ded7..0000000 --- a/plugins/account/org.gnome.SettingsDaemon.Account.desktop.in +++ /dev/null @@ -1,9 +0,0 @@ -[Desktop Entry] -Type=Application -Name=GNOME Settings Daemon's housekeeping plugin -Exec=@libexecdir@/gsd-account -OnlyShowIn=GNOME; -NoDisplay=true -X-GNOME-Autostart-Phase=Initialization -X-GNOME-Autostart-Notify=true -X-GNOME-AutoRestart=true diff --git a/plugins/housekeeping/gsd-gpu-mem.c b/plugins/housekeeping/gsd-gpu-mem.c deleted file mode 100644 index a76579b..0000000 --- a/plugins/housekeeping/gsd-gpu-mem.c +++ /dev/null @@ -1,261 +0,0 @@ -/* - * Copyright (C) 2017 Red Hat, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - */ - -#include -#include -#include -#include "nvml/include/nvml.h" - -typedef nvmlReturn_t (*nvml_init_t) (void); -static nvml_init_t nvml_init; -typedef nvmlReturn_t (*nvml_device_get_handle_by_index_t) (unsigned int, nvmlDevice_t *); -static nvml_device_get_handle_by_index_t nvml_device_get_handle_by_index; -typedef nvmlReturn_t (*nvml_device_get_memory_info_t) (nvmlDevice_t, nvmlMemory_t *); -static nvml_device_get_memory_info_t nvml_device_get_memory_info; -typedef const char* (*nvml_error_string_t) (nvmlReturn_t); -static nvml_error_string_t nvml_error_string; -static void *nvml_handle = NULL; -static gboolean nvml_loaded = FALSE; - -static gboolean -nvml_load (void) -{ - char *error; - - if (nvml_loaded) - goto out; - nvml_loaded = TRUE; - - nvml_handle = dlopen ("libnvidia-ml.so", RTLD_LAZY); - error = dlerror(); - if (!nvml_handle) - { - g_warning ("Loading NVML: %s", error); - goto out; - } - - nvml_init = (nvml_init_t) dlsym (nvml_handle, "nvmlInit"); - nvml_device_get_handle_by_index = (nvml_device_get_handle_by_index_t) dlsym (nvml_handle, "nvmlDeviceGetHandleByIndex"); - nvml_device_get_memory_info = (nvml_device_get_memory_info_t) dlsym (nvml_handle, "nvmlDeviceGetMemoryInfo"); - nvml_error_string = (nvml_error_string_t) dlsym (nvml_handle, "nvmlErrorString"); - error = dlerror(); - if (error) - { - g_warning ("Loading NVML: %s", error); - goto cleanup; - } - goto out; - - cleanup: - dlclose (nvml_handle); - nvml_handle = NULL; - out: - return nvml_handle != NULL; -} - -static nvmlReturn_t nvml_status = NVML_ERROR_UNINITIALIZED; -static nvmlDevice_t nvml_device = NULL; - -static nvmlReturn_t -nvml_warn (nvmlReturn_t rcode, const gchar *prefix) -{ - if (rcode != NVML_SUCCESS) - g_warning ("%s: %s", prefix, nvml_error_string (rcode)); - return rcode; -} - -static gboolean -nvml_ready (void) -{ - if (!nvml_load ()) - return FALSE; - - if (nvml_status == NVML_ERROR_UNINITIALIZED) - { - nvml_status = nvml_warn (nvml_init (), "Initializing NVML"); - if (nvml_status == NVML_SUCCESS) - nvml_warn (nvml_device_get_handle_by_index (0, &nvml_device), "Getting NVML device 0"); - } - - return nvml_status == NVML_SUCCESS && nvml_device != NULL; -} - -static void -nvml_read_mem_info (nvmlMemory_t *mem_info) -{ - if (!nvml_ready ()) - return; - - nvml_device_get_memory_info (nvml_device, mem_info); -} - - -#include -#include -#include "gsd-gpu-mem.h" - -#define POLLING_INTERVAL 30 -#define MEM_USAGE_NOTIFY_THRESHOLD 0.80 - -struct _GsdGpuMem -{ - GObject parent_instance; - - guint timeout_id; - - GDesktopAppInfo *sysmon_app_info; - NotifyNotification *notification; -}; - -G_DEFINE_TYPE (GsdGpuMem, gsd_gpu_mem, G_TYPE_OBJECT) - -static void -clear_timeout (GsdGpuMem *self) -{ - if (self->timeout_id != 0) - { - g_source_remove (self->timeout_id); - self->timeout_id = 0; - } -} - -static void -notification_closed (GsdGpuMem *self) -{ - g_clear_object (&self->notification); -} - -static void -unnotify (GsdGpuMem *self) -{ - if (!self->notification) - return; - - notify_notification_close (self->notification, NULL); -} - -static void -ignore_callback (NotifyNotification *n, - const char *a, - GsdGpuMem *self) -{ - unnotify (self); - clear_timeout (self); -} - -static void -examine_callback (NotifyNotification *n, - const char *a, - GsdGpuMem *self) - -{ - unnotify (self); - g_app_info_launch (G_APP_INFO (self->sysmon_app_info), NULL, NULL, NULL); -} - -static void -notify (GsdGpuMem *self, double mem_usage) -{ - const gchar *summary = "Running low on GPU memory"; - const gchar *icon_name = "utilities-system-monitor-symbolic"; - g_autofree gchar *body = g_strdup_printf ("GPU memory usage is at %d%%. " - "You may free up some memory by closing some applications.", - (int) round (mem_usage * 100)); - if (self->notification) - { - notify_notification_update (self->notification, summary, body, icon_name); - notify_notification_show (self->notification, NULL); - return; - } - - self->notification = notify_notification_new (summary, body, icon_name); - g_signal_connect_object (self->notification, "closed", - G_CALLBACK (notification_closed), - self, G_CONNECT_SWAPPED); - - notify_notification_set_app_name (self->notification, "GPU memory"); - - notify_notification_add_action (self->notification, - "ignore", - "Ignore", - (NotifyActionCallback) ignore_callback, - self, NULL); - - if (self->sysmon_app_info) - notify_notification_add_action (self->notification, - "examine", - "Examine", - (NotifyActionCallback) examine_callback, - self, NULL); - - notify_notification_show (self->notification, NULL); -} - -static gboolean -poll_gpu_memory (gpointer user_data) -{ - GsdGpuMem *self = user_data; - nvmlMemory_t mem_info = { 0 }; - double mem_usage = 0.0; - - nvml_read_mem_info (&mem_info); - if (mem_info.total > 0) - mem_usage = (double) mem_info.used / mem_info.total; - - if (mem_usage > MEM_USAGE_NOTIFY_THRESHOLD) - { - notify (self, mem_usage); - } - else - { - unnotify (self); - } - - return G_SOURCE_CONTINUE; -} - -static void -gsd_gpu_mem_init (GsdGpuMem *self) -{ - if (!nvml_ready ()) - return; - - self->timeout_id = g_timeout_add_seconds (POLLING_INTERVAL, poll_gpu_memory, self); - self->sysmon_app_info = g_desktop_app_info_new ("gnome-system-monitor.desktop"); -} - -static void -gsd_gpu_mem_finalize (GObject *object) -{ - GsdGpuMem *self = GSD_GPU_MEM (object); - - clear_timeout (self); - g_clear_object (&self->sysmon_app_info); - unnotify (self); - - G_OBJECT_CLASS (gsd_gpu_mem_parent_class)->finalize (object); -} - -static void -gsd_gpu_mem_class_init (GsdGpuMemClass *klass) -{ - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - - gobject_class->finalize = gsd_gpu_mem_finalize; -} diff --git a/plugins/housekeeping/gsd-gpu-mem.h b/plugins/housekeeping/gsd-gpu-mem.h deleted file mode 100644 index f896787..0000000 --- a/plugins/housekeeping/gsd-gpu-mem.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2017 Red Hat, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - */ - -#ifndef _GSD_GPU_MEM_H -#define _GSD_GPU_MEM_H - -#include - -G_BEGIN_DECLS - -#define GSD_TYPE_GPU_MEM (gsd_gpu_mem_get_type ()) -G_DECLARE_FINAL_TYPE (GsdGpuMem, gsd_gpu_mem, - GSD, GPU_MEM, GObject) - -G_END_DECLS - -#endif /* _GSD_GPU_MEM_H */ diff --git a/plugins/housekeeping/gsd-housekeeping-manager.c b/plugins/housekeeping/gsd-housekeeping-manager.c index 1bd5306..5ace417 100644 --- a/plugins/housekeeping/gsd-housekeeping-manager.c +++ b/plugins/housekeeping/gsd-housekeeping-manager.c @@ -26,7 +26,6 @@ #include "gnome-settings-profile.h" #include "gsd-housekeeping-manager.h" #include "gsd-disk-space.h" -#include "gsd-gpu-mem.h" /* General */ @@ -58,8 +57,6 @@ struct GsdHousekeepingManagerPrivate { GDBusConnection *connection; GCancellable *bus_cancellable; guint name_id; - - GsdGpuMem *gpu_mem_notifier; }; #define GSD_HOUSEKEEPING_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GSD_TYPE_HOUSEKEEPING_MANAGER, GsdHousekeepingManagerPrivate)) @@ -414,8 +411,6 @@ gsd_housekeeping_manager_start (GsdHousekeepingManager *manager, manager); g_source_set_name_by_id (manager->priv->long_term_cb, "[gnome-settings-daemon] do_cleanup"); - manager->priv->gpu_mem_notifier = g_object_new (GSD_TYPE_GPU_MEM, NULL); - gnome_settings_profile_end (NULL); return TRUE; @@ -457,8 +452,6 @@ gsd_housekeeping_manager_stop (GsdHousekeepingManager *manager) g_clear_object (&p->settings); gsd_ldsm_clean (); - - g_clear_object (&p->gpu_mem_notifier); } static void diff --git a/plugins/housekeeping/meson.build b/plugins/housekeeping/meson.build index 0b690cd..a0b4ca5 100644 --- a/plugins/housekeeping/meson.build +++ b/plugins/housekeeping/meson.build @@ -1,7 +1,6 @@ common_files = files( 'gsd-disk-space.c', - 'gsd-disk-space-helper.c', - 'gsd-gpu-mem.c' + 'gsd-disk-space-helper.c' ) sources = common_files + files( @@ -12,9 +11,7 @@ sources = common_files + files( deps = plugins_deps + [ gio_unix_dep, gtk_dep, - libnotify_dep, - m_dep, - dl_dep + libnotify_dep ] executable( diff --git a/plugins/housekeeping/nvml/include/nvml.h b/plugins/housekeeping/nvml/include/nvml.h deleted file mode 100644 index f151007..0000000 --- a/plugins/housekeeping/nvml/include/nvml.h +++ /dev/null @@ -1,4447 +0,0 @@ -/* - * Copyright 1993-2016 NVIDIA Corporation. All rights reserved. - * - * NOTICE TO USER: - * - * This source code is subject to NVIDIA ownership rights under U.S. and - * international Copyright laws. Users and possessors of this source code - * are hereby granted a nonexclusive, royalty-free license to use this code - * in individual and commercial software. - * - * NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOURCE - * CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR - * IMPLIED WARRANTY OF ANY KIND. NVIDIA DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOURCE CODE, INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. - * IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL, - * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS - * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE - * OR PERFORMANCE OF THIS SOURCE CODE. - * - * U.S. Government End Users. This source code is a "commercial item" as - * that term is defined at 48 C.F.R. 2.101 (OCT 1995), consisting of - * "commercial computer software" and "commercial computer software - * documentation" as such terms are used in 48 C.F.R. 12.212 (SEPT 1995) - * and is provided to the U.S. Government only as a commercial end item. - * Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through - * 227.7202-4 (JUNE 1995), all U.S. Government End Users acquire the - * source code with only those rights set forth herein. - * - * Any use of this source code in individual and commercial software must - * include, in the user documentation and internal comments to the code, - * the above Disclaimer and U.S. Government End Users Notice. - */ - -/* -NVML API Reference - -The NVIDIA Management Library (NVML) is a C-based programmatic interface for monitoring and -managing various states within NVIDIA Tesla &tm; GPUs. It is intended to be a platform for building -3rd party applications, and is also the underlying library for the NVIDIA-supported nvidia-smi -tool. NVML is thread-safe so it is safe to make simultaneous NVML calls from multiple threads. - -API Documentation - -Supported platforms: -- Windows: Windows Server 2008 R2 64bit, Windows Server 2012 R2 64bit, Windows 7 64bit, Windows 8 64bit, Windows 10 64bit -- Linux: 32-bit and 64-bit -- Hypervisors: Windows Server 2008R2/2012 Hyper-V 64bit, Citrix XenServer 6.2 SP1+, VMware ESX 5.1/5.5 - -Supported products: -- Full Support - - All Tesla products, starting with the Fermi architecture - - All Quadro products, starting with the Fermi architecture - - All GRID products, starting with the Kepler architecture - - Selected GeForce Titan products -- Limited Support - - All Geforce products, starting with the Fermi architecture - -The NVML library can be found at \%ProgramW6432\%\\"NVIDIA Corporation"\\NVSMI\\ on Windows. It is -not be added to the system path by default. To dynamically link to NVML, add this path to the PATH -environmental variable. To dynamically load NVML, call LoadLibrary with this path. - -On Linux the NVML library will be found on the standard library path. For 64 bit Linux, both the 32 bit -and 64 bit NVML libraries will be installed. - -Online documentation for this library is available at http://docs.nvidia.com/deploy/nvml-api/index.html -*/ - -#ifndef __nvml_nvml_h__ -#define __nvml_nvml_h__ - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * On Windows, set up methods for DLL export - * define NVML_STATIC_IMPORT when using nvml_loader library - */ -#if defined _WINDOWS - #if !defined NVML_STATIC_IMPORT - #if defined NVML_LIB_EXPORT - #define DECLDIR __declspec(dllexport) - #else - #define DECLDIR __declspec(dllimport) - #endif - #else - #define DECLDIR - #endif -#else - #define DECLDIR -#endif - -/** - * NVML API versioning support - */ -#define NVML_API_VERSION 8 -#define NVML_API_VERSION_STR "8" -#define nvmlInit nvmlInit_v2 -#define nvmlDeviceGetPciInfo nvmlDeviceGetPciInfo_v2 -#define nvmlDeviceGetCount nvmlDeviceGetCount_v2 -#define nvmlDeviceGetHandleByIndex nvmlDeviceGetHandleByIndex_v2 -#define nvmlDeviceGetHandleByPciBusId nvmlDeviceGetHandleByPciBusId_v2 - -/***************************************************************************************************/ -/** @defgroup nvmlDeviceStructs Device Structs - * @{ - */ -/***************************************************************************************************/ - -/** - * Special constant that some fields take when they are not available. - * Used when only part of the struct is not available. - * - * Each structure explicitly states when to check for this value. - */ -#define NVML_VALUE_NOT_AVAILABLE (-1) - -typedef struct nvmlDevice_st* nvmlDevice_t; - -/** - * Buffer size guaranteed to be large enough for pci bus id - */ -#define NVML_DEVICE_PCI_BUS_ID_BUFFER_SIZE 16 - -/** - * PCI information about a GPU device. - */ -typedef struct nvmlPciInfo_st -{ - char busId[NVML_DEVICE_PCI_BUS_ID_BUFFER_SIZE]; //!< The tuple domain:bus:device.function PCI identifier (& NULL terminator) - unsigned int domain; //!< The PCI domain on which the device's bus resides, 0 to 0xffff - unsigned int bus; //!< The bus on which the device resides, 0 to 0xff - unsigned int device; //!< The device's id on the bus, 0 to 31 - unsigned int pciDeviceId; //!< The combined 16-bit device id and 16-bit vendor id - - // Added in NVML 2.285 API - unsigned int pciSubSystemId; //!< The 32-bit Sub System Device ID - - // NVIDIA reserved for internal use only - unsigned int reserved0; - unsigned int reserved1; - unsigned int reserved2; - unsigned int reserved3; -} nvmlPciInfo_t; - -/** - * Detailed ECC error counts for a device. - * - * @deprecated Different GPU families can have different memory error counters - * See \ref nvmlDeviceGetMemoryErrorCounter - */ -typedef struct nvmlEccErrorCounts_st -{ - unsigned long long l1Cache; //!< L1 cache errors - unsigned long long l2Cache; //!< L2 cache errors - unsigned long long deviceMemory; //!< Device memory errors - unsigned long long registerFile; //!< Register file errors -} nvmlEccErrorCounts_t; - -/** - * Utilization information for a device. - * Each sample period may be between 1 second and 1/6 second, depending on the product being queried. - */ -typedef struct nvmlUtilization_st -{ - unsigned int gpu; //!< Percent of time over the past sample period during which one or more kernels was executing on the GPU - unsigned int memory; //!< Percent of time over the past sample period during which global (device) memory was being read or written -} nvmlUtilization_t; - -/** - * Memory allocation information for a device. - */ -typedef struct nvmlMemory_st -{ - unsigned long long total; //!< Total installed FB memory (in bytes) - unsigned long long free; //!< Unallocated FB memory (in bytes) - unsigned long long used; //!< Allocated FB memory (in bytes). Note that the driver/GPU always sets aside a small amount of memory for bookkeeping -} nvmlMemory_t; - -/** - * BAR1 Memory allocation Information for a device - */ -typedef struct nvmlBAR1Memory_st -{ - unsigned long long bar1Total; //!< Total BAR1 Memory (in bytes) - unsigned long long bar1Free; //!< Unallocated BAR1 Memory (in bytes) - unsigned long long bar1Used; //!< Allocated Used Memory (in bytes) -}nvmlBAR1Memory_t; - -/** - * Information about running compute processes on the GPU - */ -typedef struct nvmlProcessInfo_st -{ - unsigned int pid; //!< Process ID - unsigned long long usedGpuMemory; //!< Amount of used GPU memory in bytes. - //! Under WDDM, \ref NVML_VALUE_NOT_AVAILABLE is always reported - //! because Windows KMD manages all the memory and not the NVIDIA driver -} nvmlProcessInfo_t; - - -/** - * Enum to represent type of bridge chip - */ -typedef enum nvmlBridgeChipType_enum -{ - NVML_BRIDGE_CHIP_PLX = 0, - NVML_BRIDGE_CHIP_BRO4 = 1 -}nvmlBridgeChipType_t; - -/** - * Maximum number of NvLink links supported - */ -#define NVML_NVLINK_MAX_LINKS 4 - -/** - * Enum to represent the NvLink utilization counter packet units - */ -typedef enum nvmlNvLinkUtilizationCountUnits_enum -{ - NVML_NVLINK_COUNTER_UNIT_CYCLES = 0, // count by cycles - NVML_NVLINK_COUNTER_UNIT_PACKETS = 1, // count by packets - NVML_NVLINK_COUNTER_UNIT_BYTES = 2, // count by bytes - - // this must be last - NVML_NVLINK_COUNTER_UNIT_COUNT -} nvmlNvLinkUtilizationCountUnits_t; - -/** - * Enum to represent the NvLink utilization counter packet types to count - * ** this is ONLY applicable with the units as packets or bytes - * ** as specified in \a nvmlNvLinkUtilizationCountUnits_t - * ** all packet filter descriptions are target GPU centric - * ** these can be "OR'd" together - */ -typedef enum nvmlNvLinkUtilizationCountPktTypes_enum -{ - NVML_NVLINK_COUNTER_PKTFILTER_NOP = 0x1, // no operation packets - NVML_NVLINK_COUNTER_PKTFILTER_READ = 0x2, // read packets - NVML_NVLINK_COUNTER_PKTFILTER_WRITE = 0x4, // write packets - NVML_NVLINK_COUNTER_PKTFILTER_RATOM = 0x8, // reduction atomic requests - NVML_NVLINK_COUNTER_PKTFILTER_NRATOM = 0x10, // non-reduction atomic requests - NVML_NVLINK_COUNTER_PKTFILTER_FLUSH = 0x20, // flush requests - NVML_NVLINK_COUNTER_PKTFILTER_RESPDATA = 0x40, // responses with data - NVML_NVLINK_COUNTER_PKTFILTER_RESPNODATA = 0x80, // responses without data - NVML_NVLINK_COUNTER_PKTFILTER_ALL = 0xFF // all packets -} nvmlNvLinkUtilizationCountPktTypes_t; - -/** - * Struct to define the NVLINK counter controls - */ -typedef struct nvmlNvLinkUtilizationControl_st -{ - nvmlNvLinkUtilizationCountUnits_t units; - nvmlNvLinkUtilizationCountPktTypes_t pktfilter; -} nvmlNvLinkUtilizationControl_t; - -/** - * Enum to represent NvLink queryable capabilities - */ -typedef enum nvmlNvLinkCapability_enum -{ - NVML_NVLINK_CAP_P2P_SUPPORTED = 0, // P2P over NVLink is supported - NVML_NVLINK_CAP_SYSMEM_ACCESS = 1, // Access to system memory is supported - NVML_NVLINK_CAP_P2P_ATOMICS = 2, // P2P atomics are supported - NVML_NVLINK_CAP_SYSMEM_ATOMICS= 3, // System memory atomics are supported - NVML_NVLINK_CAP_SLI_BRIDGE = 4, // SLI is supported over this link - NVML_NVLINK_CAP_VALID = 5, // Link is supported on this device - // should be last - NVML_NVLINK_CAP_COUNT -} nvmlNvLinkCapability_t; - -/** - * Enum to represent NvLink queryable error counters - */ -typedef enum nvmlNvLinkErrorCounter_enum -{ - NVML_NVLINK_ERROR_DL_REPLAY = 0, // Data link transmit replay error counter - NVML_NVLINK_ERROR_DL_RECOVERY = 1, // Data link transmit recovery error counter - NVML_NVLINK_ERROR_DL_CRC_FLIT = 2, // Data link receive flow control digit CRC error counter - NVML_NVLINK_ERROR_DL_CRC_DATA = 3, // Data link receive data CRC error counter - - // this must be last - NVML_NVLINK_ERROR_COUNT -} nvmlNvLinkErrorCounter_t; - -/** - * Represents level relationships within a system between two GPUs - * The enums are spaced to allow for future relationships - */ -typedef enum nvmlGpuLevel_enum -{ - NVML_TOPOLOGY_INTERNAL = 0, // e.g. Tesla K80 - NVML_TOPOLOGY_SINGLE = 10, // all devices that only need traverse a single PCIe switch - NVML_TOPOLOGY_MULTIPLE = 20, // all devices that need not traverse a host bridge - NVML_TOPOLOGY_HOSTBRIDGE = 30, // all devices that are connected to the same host bridge - NVML_TOPOLOGY_CPU = 40, // all devices that are connected to the same CPU but possibly multiple host bridges - NVML_TOPOLOGY_SYSTEM = 50, // all devices in the system - - // there is purposefully no COUNT here because of the need for spacing above -} nvmlGpuTopologyLevel_t; - -/* P2P Capability Index Status*/ -typedef enum nvmlGpuP2PStatus_enum -{ - NVML_P2P_STATUS_OK = 0, - NVML_P2P_STATUS_CHIPSET_NOT_SUPPORED, - NVML_P2P_STATUS_GPU_NOT_SUPPORTED, - NVML_P2P_STATUS_IOH_TOPOLOGY_NOT_SUPPORTED, - NVML_P2P_STATUS_DISABLED_BY_REGKEY, - NVML_P2P_STATUS_NOT_SUPPORTED, - NVML_P2P_STATUS_UNKNOWN - -} nvmlGpuP2PStatus_t; - -/* P2P Capability Index*/ -typedef enum nvmlGpuP2PCapsIndex_enum -{ - NVML_P2P_CAPS_INDEX_READ = 0, - NVML_P2P_CAPS_INDEX_WRITE, - NVML_P2P_CAPS_INDEX_NVLINK, - NVML_P2P_CAPS_INDEX_ATOMICS, - NVML_P2P_CAPS_INDEX_PROP, - NVML_P2P_CAPS_INDEX_UNKNOWN -}nvmlGpuP2PCapsIndex_t; - -/** - * Maximum limit on Physical Bridges per Board - */ -#define NVML_MAX_PHYSICAL_BRIDGE (128) - -/** - * Information about the Bridge Chip Firmware - */ -typedef struct nvmlBridgeChipInfo_st -{ - nvmlBridgeChipType_t type; //!< Type of Bridge Chip - unsigned int fwVersion; //!< Firmware Version. 0=Version is unavailable -}nvmlBridgeChipInfo_t; - -/** - * This structure stores the complete Hierarchy of the Bridge Chip within the board. The immediate - * bridge is stored at index 0 of bridgeInfoList, parent to immediate bridge is at index 1 and so forth. - */ -typedef struct nvmlBridgeChipHierarchy_st -{ - unsigned char bridgeCount; //!< Number of Bridge Chips on the Board - nvmlBridgeChipInfo_t bridgeChipInfo[NVML_MAX_PHYSICAL_BRIDGE]; //!< Hierarchy of Bridge Chips on the board -}nvmlBridgeChipHierarchy_t; - -/** - * Represents Type of Sampling Event - */ -typedef enum nvmlSamplingType_enum -{ - NVML_TOTAL_POWER_SAMPLES = 0, //!< To represent total power drawn by GPU - NVML_GPU_UTILIZATION_SAMPLES = 1, //!< To represent percent of time during which one or more kernels was executing on the GPU - NVML_MEMORY_UTILIZATION_SAMPLES = 2, //!< To represent percent of time during which global (device) memory was being read or written - NVML_ENC_UTILIZATION_SAMPLES = 3, //!< To represent percent of time during which NVENC remains busy - NVML_DEC_UTILIZATION_SAMPLES = 4, //!< To represent percent of time during which NVDEC remains busy - NVML_PROCESSOR_CLK_SAMPLES = 5, //!< To represent processor clock samples - NVML_MEMORY_CLK_SAMPLES = 6, //!< To represent memory clock samples - - // Keep this last - NVML_SAMPLINGTYPE_COUNT -}nvmlSamplingType_t; - -/** - * Represents the queryable PCIe utilization counters - */ -typedef enum nvmlPcieUtilCounter_enum -{ - NVML_PCIE_UTIL_TX_BYTES = 0, // 1KB granularity - NVML_PCIE_UTIL_RX_BYTES = 1, // 1KB granularity - - // Keep this last - NVML_PCIE_UTIL_COUNT -} nvmlPcieUtilCounter_t; - -/** - * Represents the type for sample value returned - */ -typedef enum nvmlValueType_enum -{ - NVML_VALUE_TYPE_DOUBLE = 0, - NVML_VALUE_TYPE_UNSIGNED_INT = 1, - NVML_VALUE_TYPE_UNSIGNED_LONG = 2, - NVML_VALUE_TYPE_UNSIGNED_LONG_LONG = 3, - - // Keep this last - NVML_VALUE_TYPE_COUNT -}nvmlValueType_t; - - -/** - * Union to represent different types of Value - */ -typedef union nvmlValue_st -{ - double dVal; //!< If the value is double - unsigned int uiVal; //!< If the value is unsigned int - unsigned long ulVal; //!< If the value is unsigned long - unsigned long long ullVal; //!< If the value is unsigned long long -}nvmlValue_t; - -/** - * Information for Sample - */ -typedef struct nvmlSample_st -{ - unsigned long long timeStamp; //!< CPU Timestamp in microseconds - nvmlValue_t sampleValue; //!< Sample Value -}nvmlSample_t; - -/** - * Represents type of perf policy for which violation times can be queried - */ -typedef enum nvmlPerfPolicyType_enum -{ - NVML_PERF_POLICY_POWER = 0, - NVML_PERF_POLICY_THERMAL = 1, - NVML_PERF_POLICY_SYNC_BOOST = 2, - - // Keep this last - NVML_PERF_POLICY_COUNT -}nvmlPerfPolicyType_t; - -/** - * Struct to hold perf policy violation status data - */ -typedef struct nvmlViolationTime_st -{ - unsigned long long referenceTime; //!< referenceTime represents CPU timestamp in microseconds - unsigned long long violationTime; //!< violationTime in Nanoseconds -}nvmlViolationTime_t; - -/** @} */ - -/***************************************************************************************************/ -/** @defgroup nvmlDeviceEnumvs Device Enums - * @{ - */ -/***************************************************************************************************/ - -/** - * Generic enable/disable enum. - */ -typedef enum nvmlEnableState_enum -{ - NVML_FEATURE_DISABLED = 0, //!< Feature disabled - NVML_FEATURE_ENABLED = 1 //!< Feature enabled -} nvmlEnableState_t; - -//! Generic flag used to specify the default behavior of some functions. See description of particular functions for details. -#define nvmlFlagDefault 0x00 -//! Generic flag used to force some behavior. See description of particular functions for details. -#define nvmlFlagForce 0x01 - -/** - * * The Brand of the GPU - * */ -typedef enum nvmlBrandType_enum -{ - NVML_BRAND_UNKNOWN = 0, - NVML_BRAND_QUADRO = 1, - NVML_BRAND_TESLA = 2, - NVML_BRAND_NVS = 3, - NVML_BRAND_GRID = 4, - NVML_BRAND_GEFORCE = 5, - - // Keep this last - NVML_BRAND_COUNT -} nvmlBrandType_t; - -/** - * Temperature thresholds. - */ -typedef enum nvmlTemperatureThresholds_enum -{ - NVML_TEMPERATURE_THRESHOLD_SHUTDOWN = 0, // Temperature at which the GPU will shut down - // for HW protection - NVML_TEMPERATURE_THRESHOLD_SLOWDOWN = 1, // Temperature at which the GPU will begin slowdown - // Keep this last - NVML_TEMPERATURE_THRESHOLD_COUNT -} nvmlTemperatureThresholds_t; - -/** - * Temperature sensors. - */ -typedef enum nvmlTemperatureSensors_enum -{ - NVML_TEMPERATURE_GPU = 0, //!< Temperature sensor for the GPU die - - // Keep this last - NVML_TEMPERATURE_COUNT -} nvmlTemperatureSensors_t; - -/** - * Compute mode. - * - * NVML_COMPUTEMODE_EXCLUSIVE_PROCESS was added in CUDA 4.0. - * Earlier CUDA versions supported a single exclusive mode, - * which is equivalent to NVML_COMPUTEMODE_EXCLUSIVE_THREAD in CUDA 4.0 and beyond. - */ -typedef enum nvmlComputeMode_enum -{ - NVML_COMPUTEMODE_DEFAULT = 0, //!< Default compute mode -- multiple contexts per device - NVML_COMPUTEMODE_EXCLUSIVE_THREAD = 1, //!< Support Removed - NVML_COMPUTEMODE_PROHIBITED = 2, //!< Compute-prohibited mode -- no contexts per device - NVML_COMPUTEMODE_EXCLUSIVE_PROCESS = 3, //!< Compute-exclusive-process mode -- only one context per device, usable from multiple threads at a time - - // Keep this last - NVML_COMPUTEMODE_COUNT -} nvmlComputeMode_t; - -/** - * ECC bit types. - * - * @deprecated See \ref nvmlMemoryErrorType_t for a more flexible type - */ -#define nvmlEccBitType_t nvmlMemoryErrorType_t - -/** - * Single bit ECC errors - * - * @deprecated Mapped to \ref NVML_MEMORY_ERROR_TYPE_CORRECTED - */ -#define NVML_SINGLE_BIT_ECC NVML_MEMORY_ERROR_TYPE_CORRECTED - -/** - * Double bit ECC errors - * - * @deprecated Mapped to \ref NVML_MEMORY_ERROR_TYPE_UNCORRECTED - */ -#define NVML_DOUBLE_BIT_ECC NVML_MEMORY_ERROR_TYPE_UNCORRECTED - -/** - * Memory error types - */ -typedef enum nvmlMemoryErrorType_enum -{ - /** - * A memory error that was corrected - * - * For ECC errors, these are single bit errors - * For Texture memory, these are errors fixed by resend - */ - NVML_MEMORY_ERROR_TYPE_CORRECTED = 0, - /** - * A memory error that was not corrected - * - * For ECC errors, these are double bit errors - * For Texture memory, these are errors where the resend fails - */ - NVML_MEMORY_ERROR_TYPE_UNCORRECTED = 1, - - - // Keep this last - NVML_MEMORY_ERROR_TYPE_COUNT //!< Count of memory error types - -} nvmlMemoryErrorType_t; - -/** - * ECC counter types. - * - * Note: Volatile counts are reset each time the driver loads. On Windows this is once per boot. On Linux this can be more frequent. - * On Linux the driver unloads when no active clients exist. If persistence mode is enabled or there is always a driver - * client active (e.g. X11), then Linux also sees per-boot behavior. If not, volatile counts are reset each time a compute app - * is run. - */ -typedef enum nvmlEccCounterType_enum -{ - NVML_VOLATILE_ECC = 0, //!< Volatile counts are reset each time the driver loads. - NVML_AGGREGATE_ECC = 1, //!< Aggregate counts persist across reboots (i.e. for the lifetime of the device) - - // Keep this last - NVML_ECC_COUNTER_TYPE_COUNT //!< Count of memory counter types -} nvmlEccCounterType_t; - -/** - * Clock types. - * - * All speeds are in Mhz. - */ -typedef enum nvmlClockType_enum -{ - NVML_CLOCK_GRAPHICS = 0, //!< Graphics clock domain - NVML_CLOCK_SM = 1, //!< SM clock domain - NVML_CLOCK_MEM = 2, //!< Memory clock domain - NVML_CLOCK_VIDEO = 3, //!< Video encoder/decoder clock domain - - // Keep this last - NVML_CLOCK_COUNT //usedGpuMemory is not supported - - - unsigned long long time; //!< Amount of time in ms during which the compute context was active. The time is reported as 0 if - //!< the process is not terminated - - unsigned long long startTime; //!< CPU Timestamp in usec representing start time for the process - - unsigned int isRunning; //!< Flag to represent if the process is running (1 for running, 0 for terminated) - - unsigned int reserved[5]; //!< Reserved for future use -} nvmlAccountingStats_t; - -/** @} */ - -/***************************************************************************************************/ -/** @defgroup nvmlInitializationAndCleanup Initialization and Cleanup - * This chapter describes the methods that handle NVML initialization and cleanup. - * It is the user's responsibility to call \ref nvmlInit() before calling any other methods, and - * nvmlShutdown() once NVML is no longer being used. - * @{ - */ -/***************************************************************************************************/ - -/** - * Initialize NVML, but don't initialize any GPUs yet. - * - * \note In NVML 5.319 new nvmlInit_v2 has replaced nvmlInit"_v1" (default in NVML 4.304 and older) that - * did initialize all GPU devices in the system. - * - * This allows NVML to communicate with a GPU - * when other GPUs in the system are unstable or in a bad state. When using this API, GPUs are - * discovered and initialized in nvmlDeviceGetHandleBy* functions instead. - * - * \note To contrast nvmlInit_v2 with nvmlInit"_v1", NVML 4.304 nvmlInit"_v1" will fail when any detected GPU is in - * a bad or unstable state. - * - * For all products. - * - * This method, should be called once before invoking any other methods in the library. - * A reference count of the number of initializations is maintained. Shutdown only occurs - * when the reference count reaches zero. - * - * @return - * - \ref NVML_SUCCESS if NVML has been properly initialized - * - \ref NVML_ERROR_DRIVER_NOT_LOADED if NVIDIA driver is not running - * - \ref NVML_ERROR_NO_PERMISSION if NVML does not have permission to talk to the driver - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlInit(void); - -/** - * Shut down NVML by releasing all GPU resources previously allocated with \ref nvmlInit(). - * - * For all products. - * - * This method should be called after NVML work is done, once for each call to \ref nvmlInit() - * A reference count of the number of initializations is maintained. Shutdown only occurs - * when the reference count reaches zero. For backwards compatibility, no error is reported if - * nvmlShutdown() is called more times than nvmlInit(). - * - * @return - * - \ref NVML_SUCCESS if NVML has been properly shut down - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlShutdown(void); - -/** @} */ - -/***************************************************************************************************/ -/** @defgroup nvmlErrorReporting Error reporting - * This chapter describes helper functions for error reporting routines. - * @{ - */ -/***************************************************************************************************/ - -/** - * Helper method for converting NVML error codes into readable strings. - * - * For all products. - * - * @param result NVML error code to convert - * - * @return String representation of the error. - * - */ -const DECLDIR char* nvmlErrorString(nvmlReturn_t result); -/** @} */ - - -/***************************************************************************************************/ -/** @defgroup nvmlConstants Constants - * @{ - */ -/***************************************************************************************************/ - -/** - * Buffer size guaranteed to be large enough for \ref nvmlDeviceGetInforomVersion and \ref nvmlDeviceGetInforomImageVersion - */ -#define NVML_DEVICE_INFOROM_VERSION_BUFFER_SIZE 16 - -/** - * Buffer size guaranteed to be large enough for \ref nvmlDeviceGetUUID - */ -#define NVML_DEVICE_UUID_BUFFER_SIZE 80 - -/** - * Buffer size guaranteed to be large enough for \ref nvmlDeviceGetBoardPartNumber - */ -#define NVML_DEVICE_PART_NUMBER_BUFFER_SIZE 80 - -/** - * Buffer size guaranteed to be large enough for \ref nvmlSystemGetDriverVersion - */ -#define NVML_SYSTEM_DRIVER_VERSION_BUFFER_SIZE 80 - -/** - * Buffer size guaranteed to be large enough for \ref nvmlSystemGetNVMLVersion - */ -#define NVML_SYSTEM_NVML_VERSION_BUFFER_SIZE 80 - -/** - * Buffer size guaranteed to be large enough for \ref nvmlDeviceGetName - */ -#define NVML_DEVICE_NAME_BUFFER_SIZE 64 - -/** - * Buffer size guaranteed to be large enough for \ref nvmlDeviceGetSerial - */ -#define NVML_DEVICE_SERIAL_BUFFER_SIZE 30 - -/** - * Buffer size guaranteed to be large enough for \ref nvmlDeviceGetVbiosVersion - */ -#define NVML_DEVICE_VBIOS_VERSION_BUFFER_SIZE 32 - -/** @} */ - -/***************************************************************************************************/ -/** @defgroup nvmlSystemQueries System Queries - * This chapter describes the queries that NVML can perform against the local system. These queries - * are not device-specific. - * @{ - */ -/***************************************************************************************************/ - -/** - * Retrieves the version of the system's graphics driver. - * - * For all products. - * - * The version identifier is an alphanumeric string. It will not exceed 80 characters in length - * (including the NULL terminator). See \ref nvmlConstants::NVML_SYSTEM_DRIVER_VERSION_BUFFER_SIZE. - * - * @param version Reference in which to return the version identifier - * @param length The maximum allowed length of the string returned in \a version - * - * @return - * - \ref NVML_SUCCESS if \a version has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a version is NULL - * - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a length is too small - */ -nvmlReturn_t DECLDIR nvmlSystemGetDriverVersion(char *version, unsigned int length); - -/** - * Retrieves the version of the NVML library. - * - * For all products. - * - * The version identifier is an alphanumeric string. It will not exceed 80 characters in length - * (including the NULL terminator). See \ref nvmlConstants::NVML_SYSTEM_NVML_VERSION_BUFFER_SIZE. - * - * @param version Reference in which to return the version identifier - * @param length The maximum allowed length of the string returned in \a version - * - * @return - * - \ref NVML_SUCCESS if \a version has been set - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a version is NULL - * - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a length is too small - */ -nvmlReturn_t DECLDIR nvmlSystemGetNVMLVersion(char *version, unsigned int length); - -/** - * Gets name of the process with provided process id - * - * For all products. - * - * Returned process name is cropped to provided length. - * name string is encoded in ANSI. - * - * @param pid The identifier of the process - * @param name Reference in which to return the process name - * @param length The maximum allowed length of the string returned in \a name - * - * @return - * - \ref NVML_SUCCESS if \a name has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a name is NULL or \a length is 0. - * - \ref NVML_ERROR_NOT_FOUND if process doesn't exists - * - \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to perform this operation - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlSystemGetProcessName(unsigned int pid, char *name, unsigned int length); - -/** @} */ - -/***************************************************************************************************/ -/** @defgroup nvmlUnitQueries Unit Queries - * This chapter describes that queries that NVML can perform against each unit. For S-class systems only. - * In each case the device is identified with an nvmlUnit_t handle. This handle is obtained by - * calling \ref nvmlUnitGetHandleByIndex(). - * @{ - */ -/***************************************************************************************************/ - - /** - * Retrieves the number of units in the system. - * - * For S-class products. - * - * @param unitCount Reference in which to return the number of units - * - * @return - * - \ref NVML_SUCCESS if \a unitCount has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a unitCount is NULL - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlUnitGetCount(unsigned int *unitCount); - -/** - * Acquire the handle for a particular unit, based on its index. - * - * For S-class products. - * - * Valid indices are derived from the \a unitCount returned by \ref nvmlUnitGetCount(). - * For example, if \a unitCount is 2 the valid indices are 0 and 1, corresponding to UNIT 0 and UNIT 1. - * - * The order in which NVML enumerates units has no guarantees of consistency between reboots. - * - * @param index The index of the target unit, >= 0 and < \a unitCount - * @param unit Reference in which to return the unit handle - * - * @return - * - \ref NVML_SUCCESS if \a unit has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a index is invalid or \a unit is NULL - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlUnitGetHandleByIndex(unsigned int index, nvmlUnit_t *unit); - -/** - * Retrieves the static information associated with a unit. - * - * For S-class products. - * - * See \ref nvmlUnitInfo_t for details on available unit info. - * - * @param unit The identifier of the target unit - * @param info Reference in which to return the unit information - * - * @return - * - \ref NVML_SUCCESS if \a info has been populated - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a unit is invalid or \a info is NULL - */ -nvmlReturn_t DECLDIR nvmlUnitGetUnitInfo(nvmlUnit_t unit, nvmlUnitInfo_t *info); - -/** - * Retrieves the LED state associated with this unit. - * - * For S-class products. - * - * See \ref nvmlLedState_t for details on allowed states. - * - * @param unit The identifier of the target unit - * @param state Reference in which to return the current LED state - * - * @return - * - \ref NVML_SUCCESS if \a state has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a unit is invalid or \a state is NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if this is not an S-class product - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - * - * @see nvmlUnitSetLedState() - */ -nvmlReturn_t DECLDIR nvmlUnitGetLedState(nvmlUnit_t unit, nvmlLedState_t *state); - -/** - * Retrieves the PSU stats for the unit. - * - * For S-class products. - * - * See \ref nvmlPSUInfo_t for details on available PSU info. - * - * @param unit The identifier of the target unit - * @param psu Reference in which to return the PSU information - * - * @return - * - \ref NVML_SUCCESS if \a psu has been populated - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a unit is invalid or \a psu is NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if this is not an S-class product - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlUnitGetPsuInfo(nvmlUnit_t unit, nvmlPSUInfo_t *psu); - -/** - * Retrieves the temperature readings for the unit, in degrees C. - * - * For S-class products. - * - * Depending on the product, readings may be available for intake (type=0), - * exhaust (type=1) and board (type=2). - * - * @param unit The identifier of the target unit - * @param type The type of reading to take - * @param temp Reference in which to return the intake temperature - * - * @return - * - \ref NVML_SUCCESS if \a temp has been populated - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a unit or \a type is invalid or \a temp is NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if this is not an S-class product - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlUnitGetTemperature(nvmlUnit_t unit, unsigned int type, unsigned int *temp); - -/** - * Retrieves the fan speed readings for the unit. - * - * For S-class products. - * - * See \ref nvmlUnitFanSpeeds_t for details on available fan speed info. - * - * @param unit The identifier of the target unit - * @param fanSpeeds Reference in which to return the fan speed information - * - * @return - * - \ref NVML_SUCCESS if \a fanSpeeds has been populated - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a unit is invalid or \a fanSpeeds is NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if this is not an S-class product - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlUnitGetFanSpeedInfo(nvmlUnit_t unit, nvmlUnitFanSpeeds_t *fanSpeeds); - -/** - * Retrieves the set of GPU devices that are attached to the specified unit. - * - * For S-class products. - * - * The \a deviceCount argument is expected to be set to the size of the input \a devices array. - * - * @param unit The identifier of the target unit - * @param deviceCount Reference in which to provide the \a devices array size, and - * to return the number of attached GPU devices - * @param devices Reference in which to return the references to the attached GPU devices - * - * @return - * - \ref NVML_SUCCESS if \a deviceCount and \a devices have been populated - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a deviceCount indicates that the \a devices array is too small - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a unit is invalid, either of \a deviceCount or \a devices is NULL - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlUnitGetDevices(nvmlUnit_t unit, unsigned int *deviceCount, nvmlDevice_t *devices); - -/** - * Retrieves the IDs and firmware versions for any Host Interface Cards (HICs) in the system. - * - * For S-class products. - * - * The \a hwbcCount argument is expected to be set to the size of the input \a hwbcEntries array. - * The HIC must be connected to an S-class system for it to be reported by this function. - * - * @param hwbcCount Size of hwbcEntries array - * @param hwbcEntries Array holding information about hwbc - * - * @return - * - \ref NVML_SUCCESS if \a hwbcCount and \a hwbcEntries have been populated - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if either \a hwbcCount or \a hwbcEntries is NULL - * - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a hwbcCount indicates that the \a hwbcEntries array is too small - */ -nvmlReturn_t DECLDIR nvmlSystemGetHicVersion(unsigned int *hwbcCount, nvmlHwbcEntry_t *hwbcEntries); -/** @} */ - -/***************************************************************************************************/ -/** @defgroup nvmlDeviceQueries Device Queries - * This chapter describes that queries that NVML can perform against each device. - * In each case the device is identified with an nvmlDevice_t handle. This handle is obtained by - * calling one of \ref nvmlDeviceGetHandleByIndex(), \ref nvmlDeviceGetHandleBySerial(), - * \ref nvmlDeviceGetHandleByPciBusId(). or \ref nvmlDeviceGetHandleByUUID(). - * @{ - */ -/***************************************************************************************************/ - - /** - * Retrieves the number of compute devices in the system. A compute device is a single GPU. - * - * For all products. - * - * Note: New nvmlDeviceGetCount_v2 (default in NVML 5.319) returns count of all devices in the system - * even if nvmlDeviceGetHandleByIndex_v2 returns NVML_ERROR_NO_PERMISSION for such device. - * Update your code to handle this error, or use NVML 4.304 or older nvml header file. - * For backward binary compatibility reasons _v1 version of the API is still present in the shared - * library. - * Old _v1 version of nvmlDeviceGetCount doesn't count devices that NVML has no permission to talk to. - * - * @param deviceCount Reference in which to return the number of accessible devices - * - * @return - * - \ref NVML_SUCCESS if \a deviceCount has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a deviceCount is NULL - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceGetCount(unsigned int *deviceCount); - -/** - * Acquire the handle for a particular device, based on its index. - * - * For all products. - * - * Valid indices are derived from the \a accessibleDevices count returned by - * \ref nvmlDeviceGetCount(). For example, if \a accessibleDevices is 2 the valid indices - * are 0 and 1, corresponding to GPU 0 and GPU 1. - * - * The order in which NVML enumerates devices has no guarantees of consistency between reboots. For that reason it - * is recommended that devices be looked up by their PCI ids or UUID. See - * \ref nvmlDeviceGetHandleByUUID() and \ref nvmlDeviceGetHandleByPciBusId(). - * - * Note: The NVML index may not correlate with other APIs, such as the CUDA device index. - * - * Starting from NVML 5, this API causes NVML to initialize the target GPU - * NVML may initialize additional GPUs if: - * - The target GPU is an SLI slave - * - * Note: New nvmlDeviceGetCount_v2 (default in NVML 5.319) returns count of all devices in the system - * even if nvmlDeviceGetHandleByIndex_v2 returns NVML_ERROR_NO_PERMISSION for such device. - * Update your code to handle this error, or use NVML 4.304 or older nvml header file. - * For backward binary compatibility reasons _v1 version of the API is still present in the shared - * library. - * Old _v1 version of nvmlDeviceGetCount doesn't count devices that NVML has no permission to talk to. - * - * This means that nvmlDeviceGetHandleByIndex_v2 and _v1 can return different devices for the same index. - * If you don't touch macros that map old (_v1) versions to _v2 versions at the top of the file you don't - * need to worry about that. - * - * @param index The index of the target GPU, >= 0 and < \a accessibleDevices - * @param device Reference in which to return the device handle - * - * @return - * - \ref NVML_SUCCESS if \a device has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a index is invalid or \a device is NULL - * - \ref NVML_ERROR_INSUFFICIENT_POWER if any attached devices have improperly attached external power cables - * - \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to talk to this device - * - \ref NVML_ERROR_IRQ_ISSUE if NVIDIA kernel detected an interrupt issue with the attached GPUs - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - * - * @see nvmlDeviceGetIndex - * @see nvmlDeviceGetCount - */ -nvmlReturn_t DECLDIR nvmlDeviceGetHandleByIndex(unsigned int index, nvmlDevice_t *device); - -/** - * Acquire the handle for a particular device, based on its board serial number. - * - * For Fermi &tm; or newer fully supported devices. - * - * This number corresponds to the value printed directly on the board, and to the value returned by - * \ref nvmlDeviceGetSerial(). - * - * @deprecated Since more than one GPU can exist on a single board this function is deprecated in favor - * of \ref nvmlDeviceGetHandleByUUID. - * For dual GPU boards this function will return NVML_ERROR_INVALID_ARGUMENT. - * - * Starting from NVML 5, this API causes NVML to initialize the target GPU - * NVML may initialize additional GPUs as it searches for the target GPU - * - * @param serial The board serial number of the target GPU - * @param device Reference in which to return the device handle - * - * @return - * - \ref NVML_SUCCESS if \a device has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a serial is invalid, \a device is NULL or more than one - * device has the same serial (dual GPU boards) - * - \ref NVML_ERROR_NOT_FOUND if \a serial does not match a valid device on the system - * - \ref NVML_ERROR_INSUFFICIENT_POWER if any attached devices have improperly attached external power cables - * - \ref NVML_ERROR_IRQ_ISSUE if NVIDIA kernel detected an interrupt issue with the attached GPUs - * - \ref NVML_ERROR_GPU_IS_LOST if any GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - * - * @see nvmlDeviceGetSerial - * @see nvmlDeviceGetHandleByUUID - */ -nvmlReturn_t DECLDIR nvmlDeviceGetHandleBySerial(const char *serial, nvmlDevice_t *device); - -/** - * Acquire the handle for a particular device, based on its globally unique immutable UUID associated with each device. - * - * For all products. - * - * @param uuid The UUID of the target GPU - * @param device Reference in which to return the device handle - * - * Starting from NVML 5, this API causes NVML to initialize the target GPU - * NVML may initialize additional GPUs as it searches for the target GPU - * - * @return - * - \ref NVML_SUCCESS if \a device has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a uuid is invalid or \a device is null - * - \ref NVML_ERROR_NOT_FOUND if \a uuid does not match a valid device on the system - * - \ref NVML_ERROR_INSUFFICIENT_POWER if any attached devices have improperly attached external power cables - * - \ref NVML_ERROR_IRQ_ISSUE if NVIDIA kernel detected an interrupt issue with the attached GPUs - * - \ref NVML_ERROR_GPU_IS_LOST if any GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - * - * @see nvmlDeviceGetUUID - */ -nvmlReturn_t DECLDIR nvmlDeviceGetHandleByUUID(const char *uuid, nvmlDevice_t *device); - -/** - * Acquire the handle for a particular device, based on its PCI bus id. - * - * For all products. - * - * This value corresponds to the nvmlPciInfo_t::busId returned by \ref nvmlDeviceGetPciInfo(). - * - * Starting from NVML 5, this API causes NVML to initialize the target GPU - * NVML may initialize additional GPUs if: - * - The target GPU is an SLI slave - * - * \note NVML 4.304 and older version of nvmlDeviceGetHandleByPciBusId"_v1" returns NVML_ERROR_NOT_FOUND - * instead of NVML_ERROR_NO_PERMISSION. - * - * @param pciBusId The PCI bus id of the target GPU - * @param device Reference in which to return the device handle - * - * @return - * - \ref NVML_SUCCESS if \a device has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a pciBusId is invalid or \a device is NULL - * - \ref NVML_ERROR_NOT_FOUND if \a pciBusId does not match a valid device on the system - * - \ref NVML_ERROR_INSUFFICIENT_POWER if the attached device has improperly attached external power cables - * - \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to talk to this device - * - \ref NVML_ERROR_IRQ_ISSUE if NVIDIA kernel detected an interrupt issue with the attached GPUs - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceGetHandleByPciBusId(const char *pciBusId, nvmlDevice_t *device); - -/** - * Retrieves the name of this device. - * - * For all products. - * - * The name is an alphanumeric string that denotes a particular product, e.g. Tesla &tm; C2070. It will not - * exceed 64 characters in length (including the NULL terminator). See \ref - * nvmlConstants::NVML_DEVICE_NAME_BUFFER_SIZE. - * - * @param device The identifier of the target device - * @param name Reference in which to return the product name - * @param length The maximum allowed length of the string returned in \a name - * - * @return - * - \ref NVML_SUCCESS if \a name has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, or \a name is NULL - * - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a length is too small - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceGetName(nvmlDevice_t device, char *name, unsigned int length); - -/** - * Retrieves the brand of this device. - * - * For all products. - * - * The type is a member of \ref nvmlBrandType_t defined above. - * - * @param device The identifier of the target device - * @param type Reference in which to return the product brand type - * - * @return - * - \ref NVML_SUCCESS if \a name has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, or \a type is NULL - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceGetBrand(nvmlDevice_t device, nvmlBrandType_t *type); - -/** - * Retrieves the NVML index of this device. - * - * For all products. - * - * Valid indices are derived from the \a accessibleDevices count returned by - * \ref nvmlDeviceGetCount(). For example, if \a accessibleDevices is 2 the valid indices - * are 0 and 1, corresponding to GPU 0 and GPU 1. - * - * The order in which NVML enumerates devices has no guarantees of consistency between reboots. For that reason it - * is recommended that devices be looked up by their PCI ids or GPU UUID. See - * \ref nvmlDeviceGetHandleByPciBusId() and \ref nvmlDeviceGetHandleByUUID(). - * - * Note: The NVML index may not correlate with other APIs, such as the CUDA device index. - * - * @param device The identifier of the target device - * @param index Reference in which to return the NVML index of the device - * - * @return - * - \ref NVML_SUCCESS if \a index has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, or \a index is NULL - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - * - * @see nvmlDeviceGetHandleByIndex() - * @see nvmlDeviceGetCount() - */ -nvmlReturn_t DECLDIR nvmlDeviceGetIndex(nvmlDevice_t device, unsigned int *index); - -/** - * Retrieves the globally unique board serial number associated with this device's board. - * - * For all products with an inforom. - * - * The serial number is an alphanumeric string that will not exceed 30 characters (including the NULL terminator). - * This number matches the serial number tag that is physically attached to the board. See \ref - * nvmlConstants::NVML_DEVICE_SERIAL_BUFFER_SIZE. - * - * @param device The identifier of the target device - * @param serial Reference in which to return the board/module serial number - * @param length The maximum allowed length of the string returned in \a serial - * - * @return - * - \ref NVML_SUCCESS if \a serial has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, or \a serial is NULL - * - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a length is too small - * - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceGetSerial(nvmlDevice_t device, char *serial, unsigned int length); - -/** - * Retrieves an array of unsigned ints (sized to cpuSetSize) of bitmasks with the ideal CPU affinity for the device - * For example, if processors 0, 1, 32, and 33 are ideal for the device and cpuSetSize == 2, - * result[0] = 0x3, result[1] = 0x3 - * - * For Kepler &tm; or newer fully supported devices. - * Supported on Linux only. - * - * @param device The identifier of the target device - * @param cpuSetSize The size of the cpuSet array that is safe to access - * @param cpuSet Array reference in which to return a bitmask of CPUs, 64 CPUs per - * unsigned long on 64-bit machines, 32 on 32-bit machines - * - * @return - * - \ref NVML_SUCCESS if \a cpuAffinity has been filled - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, cpuSetSize == 0, or cpuSet is NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceGetCpuAffinity(nvmlDevice_t device, unsigned int cpuSetSize, unsigned long *cpuSet); - -/** - * Sets the ideal affinity for the calling thread and device using the guidelines - * given in nvmlDeviceGetCpuAffinity(). Note, this is a change as of version 8.0. - * Older versions set the affinity for a calling process and all children. - * Currently supports up to 64 processors. - * - * For Kepler &tm; or newer fully supported devices. - * Supported on Linux only. - * - * @param device The identifier of the target device - * - * @return - * - \ref NVML_SUCCESS if the calling process has been successfully bound - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid - * - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceSetCpuAffinity(nvmlDevice_t device); - -/** - * Clear all affinity bindings for the calling thread. Note, this is a change as of version - * 8.0 as older versions cleared the affinity for a calling process and all children. - * - * For Kepler &tm; or newer fully supported devices. - * Supported on Linux only. - * - * @param device The identifier of the target device - * - * @return - * - \ref NVML_SUCCESS if the calling process has been successfully unbound - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceClearCpuAffinity(nvmlDevice_t device); - -/** - * Retrieve the common ancestor for two devices - * For all products. - * Supported on Linux only. - * - * @param device1 The identifier of the first device - * @param device2 The identifier of the second device - * @param pathInfo A \ref nvmlGpuTopologyLevel_t that gives the path type - * - * @return - * - \ref NVML_SUCCESS if \a pathInfo has been set - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device1, or \a device2 is invalid, or \a pathInfo is NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if the device or OS does not support this feature - * - \ref NVML_ERROR_UNKNOWN an error has occurred in underlying topology discovery - */ -nvmlReturn_t DECLDIR nvmlDeviceGetTopologyCommonAncestor(nvmlDevice_t device1, nvmlDevice_t device2, nvmlGpuTopologyLevel_t *pathInfo); - -/** - * Retrieve the set of GPUs that are nearest to a given device at a specific interconnectivity level - * For all products. - * Supported on Linux only. - * - * @param device The identifier of the first device - * @param level The \ref nvmlGpuTopologyLevel_t level to search for other GPUs - * @param count When zero, is set to the number of matching GPUs such that \a deviceArray - * can be malloc'd. When non-zero, \a deviceArray will be filled with \a count - * number of device handles. - * @param deviceArray An array of device handles for GPUs found at \a level - * - * @return - * - \ref NVML_SUCCESS if \a deviceArray or \a count (if initially zero) has been set - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device, \a level, or \a count is invalid, or \a deviceArray is NULL with a non-zero \a count - * - \ref NVML_ERROR_NOT_SUPPORTED if the device or OS does not support this feature - * - \ref NVML_ERROR_UNKNOWN an error has occurred in underlying topology discovery - */ -nvmlReturn_t DECLDIR nvmlDeviceGetTopologyNearestGpus(nvmlDevice_t device, nvmlGpuTopologyLevel_t level, unsigned int *count, nvmlDevice_t *deviceArray); - -/** - * Retrieve the set of GPUs that have a CPU affinity with the given CPU number - * For all products. - * Supported on Linux only. - * - * @param cpuNumber The CPU number - * @param count When zero, is set to the number of matching GPUs such that \a deviceArray - * can be malloc'd. When non-zero, \a deviceArray will be filled with \a count - * number of device handles. - * @param deviceArray An array of device handles for GPUs found with affinity to \a cpuNumber - * - * @return - * - \ref NVML_SUCCESS if \a deviceArray or \a count (if initially zero) has been set - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a cpuNumber, or \a count is invalid, or \a deviceArray is NULL with a non-zero \a count - * - \ref NVML_ERROR_NOT_SUPPORTED if the device or OS does not support this feature - * - \ref NVML_ERROR_UNKNOWN an error has occurred in underlying topology discovery - */ -nvmlReturn_t DECLDIR nvmlSystemGetTopologyGpuSet(unsigned int cpuNumber, unsigned int *count, nvmlDevice_t *deviceArray); - -/** - * Retrieve the status for a given p2p capability index between a given pair of GPU - * - * @param device1 The first device - * @param device2 The second device - * @param p2pIndex p2p Capability Index being looked for between \a device1 and \a device2 - * @param p2pStatus Reference in which to return the status of the \a p2pIndex - * between \a device1 and \a device2 - * @return - * - \ref NVML_SUCCESS if \a p2pStatus has been populated - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device1 or \a device2 or \a p2pIndex is invalid or \a p2pStatus is NULL - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceGetP2PStatus(nvmlDevice_t device1, nvmlDevice_t device2, nvmlGpuP2PCapsIndex_t p2pIndex,nvmlGpuP2PStatus_t *p2pStatus); - - -/** - * Retrieves the globally unique immutable UUID associated with this device, as a 5 part hexadecimal string, - * that augments the immutable, board serial identifier. - * - * For all products. - * - * The UUID is a globally unique identifier. It is the only available identifier for pre-Fermi-architecture products. - * It does NOT correspond to any identifier printed on the board. It will not exceed 80 characters in length - * (including the NULL terminator). See \ref nvmlConstants::NVML_DEVICE_UUID_BUFFER_SIZE. - * - * @param device The identifier of the target device - * @param uuid Reference in which to return the GPU UUID - * @param length The maximum allowed length of the string returned in \a uuid - * - * @return - * - \ref NVML_SUCCESS if \a uuid has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, or \a uuid is NULL - * - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a length is too small - * - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceGetUUID(nvmlDevice_t device, char *uuid, unsigned int length); - -/** - * Retrieves minor number for the device. The minor number for the device is such that the Nvidia device node file for - * each GPU will have the form /dev/nvidia[minor number]. - * - * For all products. - * Supported only for Linux - * - * @param device The identifier of the target device - * @param minorNumber Reference in which to return the minor number for the device - * @return - * - \ref NVML_SUCCESS if the minor number is successfully retrieved - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a minorNumber is NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceGetMinorNumber(nvmlDevice_t device, unsigned int *minorNumber); - -/** - * Retrieves the the device board part number which is programmed into the board's InfoROM - * - * For all products. - * - * @param device Identifier of the target device - * @param partNumber Reference to the buffer to return - * @param length Length of the buffer reference - * - * @return - * - \ref NVML_SUCCESS if \a partNumber has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_NOT_SUPPORTED if the needed VBIOS fields have not been filled - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a serial is NULL - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceGetBoardPartNumber(nvmlDevice_t device, char* partNumber, unsigned int length); - -/** - * Retrieves the version information for the device's infoROM object. - * - * For all products with an inforom. - * - * Fermi and higher parts have non-volatile on-board memory for persisting device info, such as aggregate - * ECC counts. The version of the data structures in this memory may change from time to time. It will not - * exceed 16 characters in length (including the NULL terminator). - * See \ref nvmlConstants::NVML_DEVICE_INFOROM_VERSION_BUFFER_SIZE. - * - * See \ref nvmlInforomObject_t for details on the available infoROM objects. - * - * @param device The identifier of the target device - * @param object The target infoROM object - * @param version Reference in which to return the infoROM version - * @param length The maximum allowed length of the string returned in \a version - * - * @return - * - \ref NVML_SUCCESS if \a version has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a version is NULL - * - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a length is too small - * - \ref NVML_ERROR_NOT_SUPPORTED if the device does not have an infoROM - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - * - * @see nvmlDeviceGetInforomImageVersion - */ -nvmlReturn_t DECLDIR nvmlDeviceGetInforomVersion(nvmlDevice_t device, nvmlInforomObject_t object, char *version, unsigned int length); - -/** - * Retrieves the global infoROM image version - * - * For all products with an inforom. - * - * Image version just like VBIOS version uniquely describes the exact version of the infoROM flashed on the board - * in contrast to infoROM object version which is only an indicator of supported features. - * Version string will not exceed 16 characters in length (including the NULL terminator). - * See \ref nvmlConstants::NVML_DEVICE_INFOROM_VERSION_BUFFER_SIZE. - * - * @param device The identifier of the target device - * @param version Reference in which to return the infoROM image version - * @param length The maximum allowed length of the string returned in \a version - * - * @return - * - \ref NVML_SUCCESS if \a version has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a version is NULL - * - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a length is too small - * - \ref NVML_ERROR_NOT_SUPPORTED if the device does not have an infoROM - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - * - * @see nvmlDeviceGetInforomVersion - */ -nvmlReturn_t DECLDIR nvmlDeviceGetInforomImageVersion(nvmlDevice_t device, char *version, unsigned int length); - -/** - * Retrieves the checksum of the configuration stored in the device's infoROM. - * - * For all products with an inforom. - * - * Can be used to make sure that two GPUs have the exact same configuration. - * Current checksum takes into account configuration stored in PWR and ECC infoROM objects. - * Checksum can change between driver releases or when user changes configuration (e.g. disable/enable ECC) - * - * @param device The identifier of the target device - * @param checksum Reference in which to return the infoROM configuration checksum - * - * @return - * - \ref NVML_SUCCESS if \a checksum has been set - * - \ref NVML_ERROR_CORRUPTED_INFOROM if the device's checksum couldn't be retrieved due to infoROM corruption - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a checksum is NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceGetInforomConfigurationChecksum(nvmlDevice_t device, unsigned int *checksum); - -/** - * Reads the infoROM from the flash and verifies the checksums. - * - * For all products with an inforom. - * - * @param device The identifier of the target device - * - * @return - * - \ref NVML_SUCCESS if infoROM is not corrupted - * - \ref NVML_ERROR_CORRUPTED_INFOROM if the device's infoROM is corrupted - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceValidateInforom(nvmlDevice_t device); - -/** - * Retrieves the display mode for the device. - * - * For all products. - * - * This method indicates whether a physical display (e.g. monitor) is currently connected to - * any of the device's connectors. - * - * See \ref nvmlEnableState_t for details on allowed modes. - * - * @param device The identifier of the target device - * @param display Reference in which to return the display mode - * - * @return - * - \ref NVML_SUCCESS if \a display has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a display is NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceGetDisplayMode(nvmlDevice_t device, nvmlEnableState_t *display); - -/** - * Retrieves the display active state for the device. - * - * For all products. - * - * This method indicates whether a display is initialized on the device. - * For example whether X Server is attached to this device and has allocated memory for the screen. - * - * Display can be active even when no monitor is physically attached. - * - * See \ref nvmlEnableState_t for details on allowed modes. - * - * @param device The identifier of the target device - * @param isActive Reference in which to return the display active state - * - * @return - * - \ref NVML_SUCCESS if \a isActive has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a isActive is NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceGetDisplayActive(nvmlDevice_t device, nvmlEnableState_t *isActive); - -/** - * Retrieves the persistence mode associated with this device. - * - * For all products. - * For Linux only. - * - * When driver persistence mode is enabled the driver software state is not torn down when the last - * client disconnects. By default this feature is disabled. - * - * See \ref nvmlEnableState_t for details on allowed modes. - * - * @param device The identifier of the target device - * @param mode Reference in which to return the current driver persistence mode - * - * @return - * - \ref NVML_SUCCESS if \a mode has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a mode is NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - * - * @see nvmlDeviceSetPersistenceMode() - */ -nvmlReturn_t DECLDIR nvmlDeviceGetPersistenceMode(nvmlDevice_t device, nvmlEnableState_t *mode); - -/** - * Retrieves the PCI attributes of this device. - * - * For all products. - * - * See \ref nvmlPciInfo_t for details on the available PCI info. - * - * @param device The identifier of the target device - * @param pci Reference in which to return the PCI info - * - * @return - * - \ref NVML_SUCCESS if \a pci has been populated - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a pci is NULL - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceGetPciInfo(nvmlDevice_t device, nvmlPciInfo_t *pci); - -/** - * Retrieves the maximum PCIe link generation possible with this device and system - * - * I.E. for a generation 2 PCIe device attached to a generation 1 PCIe bus the max link generation this function will - * report is generation 1. - * - * For Fermi &tm; or newer fully supported devices. - * - * @param device The identifier of the target device - * @param maxLinkGen Reference in which to return the max PCIe link generation - * - * @return - * - \ref NVML_SUCCESS if \a maxLinkGen has been populated - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a maxLinkGen is null - * - \ref NVML_ERROR_NOT_SUPPORTED if PCIe link information is not available - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceGetMaxPcieLinkGeneration(nvmlDevice_t device, unsigned int *maxLinkGen); - -/** - * Retrieves the maximum PCIe link width possible with this device and system - * - * I.E. for a device with a 16x PCIe bus width attached to a 8x PCIe system bus this function will report - * a max link width of 8. - * - * For Fermi &tm; or newer fully supported devices. - * - * @param device The identifier of the target device - * @param maxLinkWidth Reference in which to return the max PCIe link generation - * - * @return - * - \ref NVML_SUCCESS if \a maxLinkWidth has been populated - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a maxLinkWidth is null - * - \ref NVML_ERROR_NOT_SUPPORTED if PCIe link information is not available - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceGetMaxPcieLinkWidth(nvmlDevice_t device, unsigned int *maxLinkWidth); - -/** - * Retrieves the current PCIe link generation - * - * For Fermi &tm; or newer fully supported devices. - * - * @param device The identifier of the target device - * @param currLinkGen Reference in which to return the current PCIe link generation - * - * @return - * - \ref NVML_SUCCESS if \a currLinkGen has been populated - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a currLinkGen is null - * - \ref NVML_ERROR_NOT_SUPPORTED if PCIe link information is not available - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceGetCurrPcieLinkGeneration(nvmlDevice_t device, unsigned int *currLinkGen); - -/** - * Retrieves the current PCIe link width - * - * For Fermi &tm; or newer fully supported devices. - * - * @param device The identifier of the target device - * @param currLinkWidth Reference in which to return the current PCIe link generation - * - * @return - * - \ref NVML_SUCCESS if \a currLinkWidth has been populated - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a currLinkWidth is null - * - \ref NVML_ERROR_NOT_SUPPORTED if PCIe link information is not available - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceGetCurrPcieLinkWidth(nvmlDevice_t device, unsigned int *currLinkWidth); - -/** - * Retrieve PCIe utilization information. - * This function is querying a byte counter over a 20ms interval and thus is the - * PCIe throughput over that interval. - * - * For Maxwell &tm; or newer fully supported devices. - * - * This method is not supported on virtualized GPU environments. - * - * @param device The identifier of the target device - * @param counter The specific counter that should be queried \ref nvmlPcieUtilCounter_t - * @param value Reference in which to return throughput in KB/s - * - * @return - * - \ref NVML_SUCCESS if \a value has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device or \a counter is invalid, or \a value is NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceGetPcieThroughput(nvmlDevice_t device, nvmlPcieUtilCounter_t counter, unsigned int *value); - -/** - * Retrieve the PCIe replay counter. - * - * For Kepler &tm; or newer fully supported devices. - * - * @param device The identifier of the target device - * @param value Reference in which to return the counter's value - * - * @return - * - \ref NVML_SUCCESS if \a value and \a rollover have been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, or \a value or \a rollover are NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceGetPcieReplayCounter(nvmlDevice_t device, unsigned int *value); - -/** - * Retrieves the current clock speeds for the device. - * - * For Fermi &tm; or newer fully supported devices. - * - * See \ref nvmlClockType_t for details on available clock information. - * - * @param device The identifier of the target device - * @param type Identify which clock domain to query - * @param clock Reference in which to return the clock speed in MHz - * - * @return - * - \ref NVML_SUCCESS if \a clock has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a clock is NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if the device cannot report the specified clock - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceGetClockInfo(nvmlDevice_t device, nvmlClockType_t type, unsigned int *clock); - -/** - * Retrieves the maximum clock speeds for the device. - * - * For Fermi &tm; or newer fully supported devices. - * - * See \ref nvmlClockType_t for details on available clock information. - * - * \note On GPUs from Fermi family current P0 clocks (reported by \ref nvmlDeviceGetClockInfo) can differ from max clocks - * by few MHz. - * - * @param device The identifier of the target device - * @param type Identify which clock domain to query - * @param clock Reference in which to return the clock speed in MHz - * - * @return - * - \ref NVML_SUCCESS if \a clock has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a clock is NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if the device cannot report the specified clock - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceGetMaxClockInfo(nvmlDevice_t device, nvmlClockType_t type, unsigned int *clock); - -/** - * Retrieves the current setting of a clock that applications will use unless an overspec situation occurs. - * Can be changed using \ref nvmlDeviceSetApplicationsClocks. - * - * For Kepler &tm; or newer fully supported devices. - * - * @param device The identifier of the target device - * @param clockType Identify which clock domain to query - * @param clockMHz Reference in which to return the clock in MHz - * - * @return - * - \ref NVML_SUCCESS if \a clockMHz has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a clockMHz is NULL or \a clockType is invalid - * - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceGetApplicationsClock(nvmlDevice_t device, nvmlClockType_t clockType, unsigned int *clockMHz); - -/** - * Retrieves the default applications clock that GPU boots with or - * defaults to after \ref nvmlDeviceResetApplicationsClocks call. - * - * For Kepler &tm; or newer fully supported devices. - * - * @param device The identifier of the target device - * @param clockType Identify which clock domain to query - * @param clockMHz Reference in which to return the default clock in MHz - * - * @return - * - \ref NVML_SUCCESS if \a clockMHz has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a clockMHz is NULL or \a clockType is invalid - * - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - * - * \see nvmlDeviceGetApplicationsClock - */ -nvmlReturn_t DECLDIR nvmlDeviceGetDefaultApplicationsClock(nvmlDevice_t device, nvmlClockType_t clockType, unsigned int *clockMHz); - -/** - * Resets the application clock to the default value - * - * This is the applications clock that will be used after system reboot or driver reload. - * Default value is constant, but the current value an be changed using \ref nvmlDeviceSetApplicationsClocks. - * - * On Pascal and newer hardware, if clocks were previously locked with \ref nvmlDeviceSetApplicationsClocks, - * this call will unlock clocks. This returns clocks their default behavior ofautomatically boosting above - * base clocks as thermal limits allow. - * - * @see nvmlDeviceGetApplicationsClock - * @see nvmlDeviceSetApplicationsClocks - * - * For Fermi &tm; or newer non-GeForce fully supported devices and Maxwell or newer GeForce devices. - * - * @param device The identifier of the target device - * - * @return - * - \ref NVML_SUCCESS if new settings were successfully set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid - * - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceResetApplicationsClocks(nvmlDevice_t device); - -/** - * Retrieves the clock speed for the clock specified by the clock type and clock ID. - * - * For Kepler &tm; or newer fully supported devices. - * - * @param device The identifier of the target device - * @param clockType Identify which clock domain to query - * @param clockId Identify which clock in the domain to query - * @param clockMHz Reference in which to return the clock in MHz - * - * @return - * - \ref NVML_SUCCESS if \a clockMHz has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a clockMHz is NULL or \a clockType is invalid - * - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceGetClock(nvmlDevice_t device, nvmlClockType_t clockType, nvmlClockId_t clockId, unsigned int *clockMHz); - -/** - * Retrieves the customer defined maximum boost clock speed specified by the given clock type. - * - * For newer than Maxwell &tm; fully supported devices. - * - * @param device The identifier of the target device - * @param clockType Identify which clock domain to query - * @param clockMHz Reference in which to return the clock in MHz - * - * @return - * - \ref NVML_SUCCESS if \a clockMHz has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a clockMHz is NULL or \a clockType is invalid - * - \ref NVML_ERROR_NOT_SUPPORTED if the device or the \a clockType on this device does not support this feature - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceGetMaxCustomerBoostClock(nvmlDevice_t device, nvmlClockType_t clockType, unsigned int *clockMHz); - -/** - * Retrieves the list of possible memory clocks that can be used as an argument for \ref nvmlDeviceSetApplicationsClocks. - * - * For Kepler &tm; or newer fully supported devices. - * - * @param device The identifier of the target device - * @param count Reference in which to provide the \a clocksMHz array size, and - * to return the number of elements - * @param clocksMHz Reference in which to return the clock in MHz - * - * @return - * - \ref NVML_SUCCESS if \a count and \a clocksMHz have been populated - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a count is NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - * - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a count is too small (\a count is set to the number of - * required elements) - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - * - * @see nvmlDeviceSetApplicationsClocks - * @see nvmlDeviceGetSupportedGraphicsClocks - */ -nvmlReturn_t DECLDIR nvmlDeviceGetSupportedMemoryClocks(nvmlDevice_t device, unsigned int *count, unsigned int *clocksMHz); - -/** - * Retrieves the list of possible graphics clocks that can be used as an argument for \ref nvmlDeviceSetApplicationsClocks. - * - * For Kepler &tm; or newer fully supported devices. - * - * @param device The identifier of the target device - * @param memoryClockMHz Memory clock for which to return possible graphics clocks - * @param count Reference in which to provide the \a clocksMHz array size, and - * to return the number of elements - * @param clocksMHz Reference in which to return the clocks in MHz - * - * @return - * - \ref NVML_SUCCESS if \a count and \a clocksMHz have been populated - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_NOT_FOUND if the specified \a memoryClockMHz is not a supported frequency - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a clock is NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - * - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a count is too small - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - * - * @see nvmlDeviceSetApplicationsClocks - * @see nvmlDeviceGetSupportedMemoryClocks - */ -nvmlReturn_t DECLDIR nvmlDeviceGetSupportedGraphicsClocks(nvmlDevice_t device, unsigned int memoryClockMHz, unsigned int *count, unsigned int *clocksMHz); - -/** - * Retrieve the current state of Auto Boosted clocks on a device and store it in \a isEnabled - * - * For Kepler &tm; or newer fully supported devices. - * - * Auto Boosted clocks are enabled by default on some hardware, allowing the GPU to run at higher clock rates - * to maximize performance as thermal limits allow. - * - * On Pascal and newer hardware, Auto Aoosted clocks are controlled through application clocks. - * Use \ref nvmlDeviceSetApplicationsClocks and \ref nvmlDeviceResetApplicationsClocks to control Auto Boost - * behavior. - * - * @param device The identifier of the target device - * @param isEnabled Where to store the current state of Auto Boosted clocks of the target device - * @param defaultIsEnabled Where to store the default Auto Boosted clocks behavior of the target device that the device will - * revert to when no applications are using the GPU - * - * @return - * - \ref NVML_SUCCESS If \a isEnabled has been been set with the Auto Boosted clocks state of \a device - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a isEnabled is NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support Auto Boosted clocks - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - * - */ -nvmlReturn_t DECLDIR nvmlDeviceGetAutoBoostedClocksEnabled(nvmlDevice_t device, nvmlEnableState_t *isEnabled, nvmlEnableState_t *defaultIsEnabled); - -/** - * Try to set the current state of Auto Boosted clocks on a device. - * - * For Kepler &tm; or newer fully supported devices. - * - * Auto Boosted clocks are enabled by default on some hardware, allowing the GPU to run at higher clock rates - * to maximize performance as thermal limits allow. Auto Boosted clocks should be disabled if fixed clock - * rates are desired. - * - * Non-root users may use this API by default but can be restricted by root from using this API by calling - * \ref nvmlDeviceSetAPIRestriction with apiType=NVML_RESTRICTED_API_SET_AUTO_BOOSTED_CLOCKS. - * Note: Persistence Mode is required to modify current Auto Boost settings, therefore, it must be enabled. - * - * On Pascal and newer hardware, Auto Boosted clocks are controlled through application clocks. - * Use \ref nvmlDeviceSetApplicationsClocks and \ref nvmlDeviceResetApplicationsClocks to control Auto Boost - * behavior. - * - * @param device The identifier of the target device - * @param enabled What state to try to set Auto Boosted clocks of the target device to - * - * @return - * - \ref NVML_SUCCESS If the Auto Boosted clocks were successfully set to the state specified by \a enabled - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid - * - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support Auto Boosted clocks - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - * - */ -nvmlReturn_t DECLDIR nvmlDeviceSetAutoBoostedClocksEnabled(nvmlDevice_t device, nvmlEnableState_t enabled); - -/** - * Try to set the default state of Auto Boosted clocks on a device. This is the default state that Auto Boosted clocks will - * return to when no compute running processes (e.g. CUDA application which have an active context) are running - * - * For Kepler &tm; or newer non-GeForce fully supported devices and Maxwell or newer GeForce devices. - * Requires root/admin permissions. - * - * Auto Boosted clocks are enabled by default on some hardware, allowing the GPU to run at higher clock rates - * to maximize performance as thermal limits allow. Auto Boosted clocks should be disabled if fixed clock - * rates are desired. - * - * On Pascal and newer hardware, Auto Boosted clocks are controlled through application clocks. - * Use \ref nvmlDeviceSetApplicationsClocks and \ref nvmlDeviceResetApplicationsClocks to control Auto Boost - * behavior. - * - * @param device The identifier of the target device - * @param enabled What state to try to set default Auto Boosted clocks of the target device to - * @param flags Flags that change the default behavior. Currently Unused. - * - * @return - * - \ref NVML_SUCCESS If the Auto Boosted clock's default state was successfully set to the state specified by \a enabled - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_NO_PERMISSION If the calling user does not have permission to change Auto Boosted clock's default state. - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid - * - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support Auto Boosted clocks - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - * - */ -nvmlReturn_t DECLDIR nvmlDeviceSetDefaultAutoBoostedClocksEnabled(nvmlDevice_t device, nvmlEnableState_t enabled, unsigned int flags); - - -/** - * Retrieves the intended operating speed of the device's fan. - * - * Note: The reported speed is the intended fan speed. If the fan is physically blocked and unable to spin, the - * output will not match the actual fan speed. - * - * For all discrete products with dedicated fans. - * - * The fan speed is expressed as a percent of the maximum, i.e. full speed is 100%. - * - * @param device The identifier of the target device - * @param speed Reference in which to return the fan speed percentage - * - * @return - * - \ref NVML_SUCCESS if \a speed has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a speed is NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if the device does not have a fan - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceGetFanSpeed(nvmlDevice_t device, unsigned int *speed); - -/** - * Retrieves the current temperature readings for the device, in degrees C. - * - * For all products. - * - * See \ref nvmlTemperatureSensors_t for details on available temperature sensors. - * - * @param device The identifier of the target device - * @param sensorType Flag that indicates which sensor reading to retrieve - * @param temp Reference in which to return the temperature reading - * - * @return - * - \ref NVML_SUCCESS if \a temp has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, \a sensorType is invalid or \a temp is NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if the device does not have the specified sensor - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceGetTemperature(nvmlDevice_t device, nvmlTemperatureSensors_t sensorType, unsigned int *temp); - -/** - * Retrieves the temperature threshold for the GPU with the specified threshold type in degrees C. - * - * For Kepler &tm; or newer fully supported devices. - * - * See \ref nvmlTemperatureThresholds_t for details on available temperature thresholds. - * - * @param device The identifier of the target device - * @param thresholdType The type of threshold value queried - * @param temp Reference in which to return the temperature reading - * @return - * - \ref NVML_SUCCESS if \a temp has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, \a thresholdType is invalid or \a temp is NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if the device does not have a temperature sensor or is unsupported - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceGetTemperatureThreshold(nvmlDevice_t device, nvmlTemperatureThresholds_t thresholdType, unsigned int *temp); - -/** - * Retrieves the current performance state for the device. - * - * For Fermi &tm; or newer fully supported devices. - * - * See \ref nvmlPstates_t for details on allowed performance states. - * - * @param device The identifier of the target device - * @param pState Reference in which to return the performance state reading - * - * @return - * - \ref NVML_SUCCESS if \a pState has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a pState is NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceGetPerformanceState(nvmlDevice_t device, nvmlPstates_t *pState); - -/** - * Retrieves current clocks throttling reasons. - * - * For all fully supported products. - * - * \note More than one bit can be enabled at the same time. Multiple reasons can be affecting clocks at once. - * - * @param device The identifier of the target device - * @param clocksThrottleReasons Reference in which to return bitmask of active clocks throttle - * reasons - * - * @return - * - \ref NVML_SUCCESS if \a clocksThrottleReasons has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a clocksThrottleReasons is NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - * - * @see nvmlClocksThrottleReasons - * @see nvmlDeviceGetSupportedClocksThrottleReasons - */ -nvmlReturn_t DECLDIR nvmlDeviceGetCurrentClocksThrottleReasons(nvmlDevice_t device, unsigned long long *clocksThrottleReasons); - -/** - * Retrieves bitmask of supported clocks throttle reasons that can be returned by - * \ref nvmlDeviceGetCurrentClocksThrottleReasons - * - * For all fully supported products. - * - * This method is not supported on virtualized GPU environments. - * - * @param device The identifier of the target device - * @param supportedClocksThrottleReasons Reference in which to return bitmask of supported - * clocks throttle reasons - * - * @return - * - \ref NVML_SUCCESS if \a supportedClocksThrottleReasons has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a supportedClocksThrottleReasons is NULL - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - * - * @see nvmlClocksThrottleReasons - * @see nvmlDeviceGetCurrentClocksThrottleReasons - */ -nvmlReturn_t DECLDIR nvmlDeviceGetSupportedClocksThrottleReasons(nvmlDevice_t device, unsigned long long *supportedClocksThrottleReasons); - -/** - * Deprecated: Use \ref nvmlDeviceGetPerformanceState. This function exposes an incorrect generalization. - * - * Retrieve the current performance state for the device. - * - * For Fermi &tm; or newer fully supported devices. - * - * See \ref nvmlPstates_t for details on allowed performance states. - * - * @param device The identifier of the target device - * @param pState Reference in which to return the performance state reading - * - * @return - * - \ref NVML_SUCCESS if \a pState has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a pState is NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceGetPowerState(nvmlDevice_t device, nvmlPstates_t *pState); - -/** - * This API has been deprecated. - * - * Retrieves the power management mode associated with this device. - * - * For products from the Fermi family. - * - Requires \a NVML_INFOROM_POWER version 3.0 or higher. - * - * For from the Kepler or newer families. - * - Does not require \a NVML_INFOROM_POWER object. - * - * This flag indicates whether any power management algorithm is currently active on the device. An - * enabled state does not necessarily mean the device is being actively throttled -- only that - * that the driver will do so if the appropriate conditions are met. - * - * See \ref nvmlEnableState_t for details on allowed modes. - * - * @param device The identifier of the target device - * @param mode Reference in which to return the current power management mode - * - * @return - * - \ref NVML_SUCCESS if \a mode has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a mode is NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceGetPowerManagementMode(nvmlDevice_t device, nvmlEnableState_t *mode); - -/** - * Retrieves the power management limit associated with this device. - * - * For Fermi &tm; or newer fully supported devices. - * - * The power limit defines the upper boundary for the card's power draw. If - * the card's total power draw reaches this limit the power management algorithm kicks in. - * - * This reading is only available if power management mode is supported. - * See \ref nvmlDeviceGetPowerManagementMode. - * - * @param device The identifier of the target device - * @param limit Reference in which to return the power management limit in milliwatts - * - * @return - * - \ref NVML_SUCCESS if \a limit has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a limit is NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceGetPowerManagementLimit(nvmlDevice_t device, unsigned int *limit); - -/** - * Retrieves information about possible values of power management limits on this device. - * - * For Kepler &tm; or newer fully supported devices. - * - * @param device The identifier of the target device - * @param minLimit Reference in which to return the minimum power management limit in milliwatts - * @param maxLimit Reference in which to return the maximum power management limit in milliwatts - * - * @return - * - \ref NVML_SUCCESS if \a minLimit and \a maxLimit have been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a minLimit or \a maxLimit is NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - * - * @see nvmlDeviceSetPowerManagementLimit - */ -nvmlReturn_t DECLDIR nvmlDeviceGetPowerManagementLimitConstraints(nvmlDevice_t device, unsigned int *minLimit, unsigned int *maxLimit); - -/** - * Retrieves default power management limit on this device, in milliwatts. - * Default power management limit is a power management limit that the device boots with. - * - * For Kepler &tm; or newer fully supported devices. - * - * @param device The identifier of the target device - * @param defaultLimit Reference in which to return the default power management limit in milliwatts - * - * @return - * - \ref NVML_SUCCESS if \a defaultLimit has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a defaultLimit is NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceGetPowerManagementDefaultLimit(nvmlDevice_t device, unsigned int *defaultLimit); - -/** - * Retrieves power usage for this GPU in milliwatts and its associated circuitry (e.g. memory) - * - * For Fermi &tm; or newer fully supported devices. - * - * On Fermi and Kepler GPUs the reading is accurate to within +/- 5% of current power draw. - * - * It is only available if power management mode is supported. See \ref nvmlDeviceGetPowerManagementMode. - * - * @param device The identifier of the target device - * @param power Reference in which to return the power usage information - * - * @return - * - \ref NVML_SUCCESS if \a power has been populated - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a power is NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support power readings - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceGetPowerUsage(nvmlDevice_t device, unsigned int *power); - -/** - * Get the effective power limit that the driver enforces after taking into account all limiters - * - * Note: This can be different from the \ref nvmlDeviceGetPowerManagementLimit if other limits are set elsewhere - * This includes the out of band power limit interface - * - * For Kepler &tm; or newer fully supported devices. - * - * @param device The device to communicate with - * @param limit Reference in which to return the power management limit in milliwatts - * - * @return - * - \ref NVML_SUCCESS if \a limit has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a limit is NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceGetEnforcedPowerLimit(nvmlDevice_t device, unsigned int *limit); - -/** - * Retrieves the current GOM and pending GOM (the one that GPU will switch to after reboot). - * - * For GK110 M-class and X-class Tesla &tm; products from the Kepler family. - * Modes \ref NVML_GOM_LOW_DP and \ref NVML_GOM_ALL_ON are supported on fully supported GeForce products. - * Not supported on Quadro ® and Tesla &tm; C-class products. - * - * @param device The identifier of the target device - * @param current Reference in which to return the current GOM - * @param pending Reference in which to return the pending GOM - * - * @return - * - \ref NVML_SUCCESS if \a mode has been populated - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a current or \a pending is NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - * - * @see nvmlGpuOperationMode_t - * @see nvmlDeviceSetGpuOperationMode - */ -nvmlReturn_t DECLDIR nvmlDeviceGetGpuOperationMode(nvmlDevice_t device, nvmlGpuOperationMode_t *current, nvmlGpuOperationMode_t *pending); - -/** - * Retrieves the amount of used, free and total memory available on the device, in bytes. - * - * For all products. - * - * Enabling ECC reduces the amount of total available memory, due to the extra required parity bits. - * Under WDDM most device memory is allocated and managed on startup by Windows. - * - * Under Linux and Windows TCC, the reported amount of used memory is equal to the sum of memory allocated - * by all active channels on the device. - * - * See \ref nvmlMemory_t for details on available memory info. - * - * @param device The identifier of the target device - * @param memory Reference in which to return the memory information - * - * @return - * - \ref NVML_SUCCESS if \a memory has been populated - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a memory is NULL - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceGetMemoryInfo(nvmlDevice_t device, nvmlMemory_t *memory); - -/** - * Retrieves the current compute mode for the device. - * - * For all products. - * - * See \ref nvmlComputeMode_t for details on allowed compute modes. - * - * @param device The identifier of the target device - * @param mode Reference in which to return the current compute mode - * - * @return - * - \ref NVML_SUCCESS if \a mode has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a mode is NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - * - * @see nvmlDeviceSetComputeMode() - */ -nvmlReturn_t DECLDIR nvmlDeviceGetComputeMode(nvmlDevice_t device, nvmlComputeMode_t *mode); - -/** - * Retrieves the current and pending ECC modes for the device. - * - * For Fermi &tm; or newer fully supported devices. - * Only applicable to devices with ECC. - * Requires \a NVML_INFOROM_ECC version 1.0 or higher. - * - * Changing ECC modes requires a reboot. The "pending" ECC mode refers to the target mode following - * the next reboot. - * - * See \ref nvmlEnableState_t for details on allowed modes. - * - * @param device The identifier of the target device - * @param current Reference in which to return the current ECC mode - * @param pending Reference in which to return the pending ECC mode - * - * @return - * - \ref NVML_SUCCESS if \a current and \a pending have been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or either \a current or \a pending is NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - * - * @see nvmlDeviceSetEccMode() - */ -nvmlReturn_t DECLDIR nvmlDeviceGetEccMode(nvmlDevice_t device, nvmlEnableState_t *current, nvmlEnableState_t *pending); - -/** - * Retrieves the device boardId from 0-N. - * Devices with the same boardId indicate GPUs connected to the same PLX. Use in conjunction with - * \ref nvmlDeviceGetMultiGpuBoard() to decide if they are on the same board as well. - * The boardId returned is a unique ID for the current configuration. Uniqueness and ordering across - * reboots and system configurations is not guaranteed (i.e. if a Tesla K40c returns 0x100 and - * the two GPUs on a Tesla K10 in the same system returns 0x200 it is not guaranteed they will - * always return those values but they will always be different from each other). - * - * - * For Fermi &tm; or newer fully supported devices. - * - * @param device The identifier of the target device - * @param boardId Reference in which to return the device's board ID - * - * @return - * - \ref NVML_SUCCESS if \a boardId has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a boardId is NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceGetBoardId(nvmlDevice_t device, unsigned int *boardId); - -/** - * Retrieves whether the device is on a Multi-GPU Board - * Devices that are on multi-GPU boards will set \a multiGpuBool to a non-zero value. - * - * For Fermi &tm; or newer fully supported devices. - * - * @param device The identifier of the target device - * @param multiGpuBool Reference in which to return a zero or non-zero value - * to indicate whether the device is on a multi GPU board - * - * @return - * - \ref NVML_SUCCESS if \a multiGpuBool has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a multiGpuBool is NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceGetMultiGpuBoard(nvmlDevice_t device, unsigned int *multiGpuBool); - -/** - * Retrieves the total ECC error counts for the device. - * - * For Fermi &tm; or newer fully supported devices. - * Only applicable to devices with ECC. - * Requires \a NVML_INFOROM_ECC version 1.0 or higher. - * Requires ECC Mode to be enabled. - * - * The total error count is the sum of errors across each of the separate memory systems, i.e. the total set of - * errors across the entire device. - * - * See \ref nvmlMemoryErrorType_t for a description of available error types.\n - * See \ref nvmlEccCounterType_t for a description of available counter types. - * - * @param device The identifier of the target device - * @param errorType Flag that specifies the type of the errors. - * @param counterType Flag that specifies the counter-type of the errors. - * @param eccCounts Reference in which to return the specified ECC errors - * - * @return - * - \ref NVML_SUCCESS if \a eccCounts has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device, \a errorType or \a counterType is invalid, or \a eccCounts is NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - * - * @see nvmlDeviceClearEccErrorCounts() - */ -nvmlReturn_t DECLDIR nvmlDeviceGetTotalEccErrors(nvmlDevice_t device, nvmlMemoryErrorType_t errorType, nvmlEccCounterType_t counterType, unsigned long long *eccCounts); - -/** - * Retrieves the detailed ECC error counts for the device. - * - * @deprecated This API supports only a fixed set of ECC error locations - * On different GPU architectures different locations are supported - * See \ref nvmlDeviceGetMemoryErrorCounter - * - * For Fermi &tm; or newer fully supported devices. - * Only applicable to devices with ECC. - * Requires \a NVML_INFOROM_ECC version 2.0 or higher to report aggregate location-based ECC counts. - * Requires \a NVML_INFOROM_ECC version 1.0 or higher to report all other ECC counts. - * Requires ECC Mode to be enabled. - * - * Detailed errors provide separate ECC counts for specific parts of the memory system. - * - * Reports zero for unsupported ECC error counters when a subset of ECC error counters are supported. - * - * See \ref nvmlMemoryErrorType_t for a description of available bit types.\n - * See \ref nvmlEccCounterType_t for a description of available counter types.\n - * See \ref nvmlEccErrorCounts_t for a description of provided detailed ECC counts. - * - * @param device The identifier of the target device - * @param errorType Flag that specifies the type of the errors. - * @param counterType Flag that specifies the counter-type of the errors. - * @param eccCounts Reference in which to return the specified ECC errors - * - * @return - * - \ref NVML_SUCCESS if \a eccCounts has been populated - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device, \a errorType or \a counterType is invalid, or \a eccCounts is NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - * - * @see nvmlDeviceClearEccErrorCounts() - */ -nvmlReturn_t DECLDIR nvmlDeviceGetDetailedEccErrors(nvmlDevice_t device, nvmlMemoryErrorType_t errorType, nvmlEccCounterType_t counterType, nvmlEccErrorCounts_t *eccCounts); - -/** - * Retrieves the requested memory error counter for the device. - * - * For Fermi &tm; or newer fully supported devices. - * Requires \a NVML_INFOROM_ECC version 2.0 or higher to report aggregate location-based memory error counts. - * Requires \a NVML_INFOROM_ECC version 1.0 or higher to report all other memory error counts. - * - * Only applicable to devices with ECC. - * - * Requires ECC Mode to be enabled. - * - * See \ref nvmlMemoryErrorType_t for a description of available memory error types.\n - * See \ref nvmlEccCounterType_t for a description of available counter types.\n - * See \ref nvmlMemoryLocation_t for a description of available counter locations.\n - * - * @param device The identifier of the target device - * @param errorType Flag that specifies the type of error. - * @param counterType Flag that specifies the counter-type of the errors. - * @param locationType Specifies the location of the counter. - * @param count Reference in which to return the ECC counter - * - * @return - * - \ref NVML_SUCCESS if \a count has been populated - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device, \a bitTyp,e \a counterType or \a locationType is - * invalid, or \a count is NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support ECC error reporting in the specified memory - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceGetMemoryErrorCounter(nvmlDevice_t device, nvmlMemoryErrorType_t errorType, - nvmlEccCounterType_t counterType, - nvmlMemoryLocation_t locationType, unsigned long long *count); - -/** - * Retrieves the current utilization rates for the device's major subsystems. - * - * For Fermi &tm; or newer fully supported devices. - * - * See \ref nvmlUtilization_t for details on available utilization rates. - * - * \note During driver initialization when ECC is enabled one can see high GPU and Memory Utilization readings. - * This is caused by ECC Memory Scrubbing mechanism that is performed during driver initialization. - * - * @param device The identifier of the target device - * @param utilization Reference in which to return the utilization information - * - * @return - * - \ref NVML_SUCCESS if \a utilization has been populated - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a utilization is NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceGetUtilizationRates(nvmlDevice_t device, nvmlUtilization_t *utilization); - -/** - * Retrieves the current utilization and sampling size in microseconds for the Encoder - * - * For Kepler &tm; or newer fully supported devices. - * - * @param device The identifier of the target device - * @param utilization Reference to an unsigned int for encoder utilization info - * @param samplingPeriodUs Reference to an unsigned int for the sampling period in US - * - * @return - * - \ref NVML_SUCCESS if \a utilization has been populated - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, \a utilization is NULL, or \a samplingPeriodUs is NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceGetEncoderUtilization(nvmlDevice_t device, unsigned int *utilization, unsigned int *samplingPeriodUs); - -/** - * Retrieves the current utilization and sampling size in microseconds for the Decoder - * - * For Kepler &tm; or newer fully supported devices. - * - * @param device The identifier of the target device - * @param utilization Reference to an unsigned int for decoder utilization info - * @param samplingPeriodUs Reference to an unsigned int for the sampling period in US - * - * @return - * - \ref NVML_SUCCESS if \a utilization has been populated - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, \a utilization is NULL, or \a samplingPeriodUs is NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceGetDecoderUtilization(nvmlDevice_t device, unsigned int *utilization, unsigned int *samplingPeriodUs); - -/** - * Retrieves the current and pending driver model for the device. - * - * For Fermi &tm; or newer fully supported devices. - * For windows only. - * - * On Windows platforms the device driver can run in either WDDM or WDM (TCC) mode. If a display is attached - * to the device it must run in WDDM mode. TCC mode is preferred if a display is not attached. - * - * See \ref nvmlDriverModel_t for details on available driver models. - * - * @param device The identifier of the target device - * @param current Reference in which to return the current driver model - * @param pending Reference in which to return the pending driver model - * - * @return - * - \ref NVML_SUCCESS if either \a current and/or \a pending have been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or both \a current and \a pending are NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if the platform is not windows - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - * - * @see nvmlDeviceSetDriverModel() - */ -nvmlReturn_t DECLDIR nvmlDeviceGetDriverModel(nvmlDevice_t device, nvmlDriverModel_t *current, nvmlDriverModel_t *pending); - -/** - * Get VBIOS version of the device. - * - * For all products. - * - * The VBIOS version may change from time to time. It will not exceed 32 characters in length - * (including the NULL terminator). See \ref nvmlConstants::NVML_DEVICE_VBIOS_VERSION_BUFFER_SIZE. - * - * @param device The identifier of the target device - * @param version Reference to which to return the VBIOS version - * @param length The maximum allowed length of the string returned in \a version - * - * @return - * - \ref NVML_SUCCESS if \a version has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, or \a version is NULL - * - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a length is too small - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceGetVbiosVersion(nvmlDevice_t device, char *version, unsigned int length); - -/** - * Get Bridge Chip Information for all the bridge chips on the board. - * - * For all fully supported products. - * Only applicable to multi-GPU products. - * - * @param device The identifier of the target device - * @param bridgeHierarchy Reference to the returned bridge chip Hierarchy - * - * @return - * - \ref NVML_SUCCESS if bridge chip exists - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, or \a bridgeInfo is NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if bridge chip not supported on the device - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - * - */ -nvmlReturn_t DECLDIR nvmlDeviceGetBridgeChipInfo(nvmlDevice_t device, nvmlBridgeChipHierarchy_t *bridgeHierarchy); - -/** - * Get information about processes with a compute context on a device - * - * For Fermi &tm; or newer fully supported devices. - * - * This function returns information only about compute running processes (e.g. CUDA application which have - * active context). Any graphics applications (e.g. using OpenGL, DirectX) won't be listed by this function. - * - * To query the current number of running compute processes, call this function with *infoCount = 0. The - * return code will be NVML_ERROR_INSUFFICIENT_SIZE, or NVML_SUCCESS if none are running. For this call - * \a infos is allowed to be NULL. - * - * The usedGpuMemory field returned is all of the memory used by the application. - * - * Keep in mind that information returned by this call is dynamic and the number of elements might change in - * time. Allocate more space for \a infos table in case new compute processes are spawned. - * - * @param device The identifier of the target device - * @param infoCount Reference in which to provide the \a infos array size, and - * to return the number of returned elements - * @param infos Reference in which to return the process information - * - * @return - * - \ref NVML_SUCCESS if \a infoCount and \a infos have been populated - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a infoCount indicates that the \a infos array is too small - * \a infoCount will contain minimal amount of space necessary for - * the call to complete - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, either of \a infoCount or \a infos is NULL - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - * - * @see \ref nvmlSystemGetProcessName - */ -nvmlReturn_t DECLDIR nvmlDeviceGetComputeRunningProcesses(nvmlDevice_t device, unsigned int *infoCount, nvmlProcessInfo_t *infos); - -/** - * Get information about processes with a graphics context on a device - * - * For Kepler &tm; or newer fully supported devices. - * - * This function returns information only about graphics based processes - * (eg. applications using OpenGL, DirectX) - * - * To query the current number of running graphics processes, call this function with *infoCount = 0. The - * return code will be NVML_ERROR_INSUFFICIENT_SIZE, or NVML_SUCCESS if none are running. For this call - * \a infos is allowed to be NULL. - * - * The usedGpuMemory field returned is all of the memory used by the application. - * - * Keep in mind that information returned by this call is dynamic and the number of elements might change in - * time. Allocate more space for \a infos table in case new graphics processes are spawned. - * - * @param device The identifier of the target device - * @param infoCount Reference in which to provide the \a infos array size, and - * to return the number of returned elements - * @param infos Reference in which to return the process information - * - * @return - * - \ref NVML_SUCCESS if \a infoCount and \a infos have been populated - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a infoCount indicates that the \a infos array is too small - * \a infoCount will contain minimal amount of space necessary for - * the call to complete - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, either of \a infoCount or \a infos is NULL - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - * - * @see \ref nvmlSystemGetProcessName - */ -nvmlReturn_t DECLDIR nvmlDeviceGetGraphicsRunningProcesses(nvmlDevice_t device, unsigned int *infoCount, nvmlProcessInfo_t *infos); - -/** - * Check if the GPU devices are on the same physical board. - * - * For all fully supported products. - * - * @param device1 The first GPU device - * @param device2 The second GPU device - * @param onSameBoard Reference in which to return the status. - * Non-zero indicates that the GPUs are on the same board. - * - * @return - * - \ref NVML_SUCCESS if \a onSameBoard has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a dev1 or \a dev2 are invalid or \a onSameBoard is NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if this check is not supported by the device - * - \ref NVML_ERROR_GPU_IS_LOST if the either GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceOnSameBoard(nvmlDevice_t device1, nvmlDevice_t device2, int *onSameBoard); - -/** - * Retrieves the root/admin permissions on the target API. See \a nvmlRestrictedAPI_t for the list of supported APIs. - * If an API is restricted only root users can call that API. See \a nvmlDeviceSetAPIRestriction to change current permissions. - * - * For all fully supported products. - * - * @param device The identifier of the target device - * @param apiType Target API type for this operation - * @param isRestricted Reference in which to return the current restriction - * NVML_FEATURE_ENABLED indicates that the API is root-only - * NVML_FEATURE_DISABLED indicates that the API is accessible to all users - * - * @return - * - \ref NVML_SUCCESS if \a isRestricted has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, \a apiType incorrect or \a isRestricted is NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device or the device does not support - * the feature that is being queried (E.G. Enabling/disabling Auto Boosted clocks is - * not supported by the device) - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - * - * @see nvmlRestrictedAPI_t - */ -nvmlReturn_t DECLDIR nvmlDeviceGetAPIRestriction(nvmlDevice_t device, nvmlRestrictedAPI_t apiType, nvmlEnableState_t *isRestricted); - -/** - * Gets recent samples for the GPU. - * - * For Kepler &tm; or newer fully supported devices. - * - * Based on type, this method can be used to fetch the power, utilization or clock samples maintained in the buffer by - * the driver. - * - * Power, Utilization and Clock samples are returned as type "unsigned int" for the union nvmlValue_t. - * - * To get the size of samples that user needs to allocate, the method is invoked with samples set to NULL. - * The returned samplesCount will provide the number of samples that can be queried. The user needs to - * allocate the buffer with size as samplesCount * sizeof(nvmlSample_t). - * - * lastSeenTimeStamp represents CPU timestamp in microseconds. Set it to 0 to fetch all the samples maintained by the - * underlying buffer. Set lastSeenTimeStamp to one of the timeStamps retrieved from the date of the previous query - * to get more recent samples. - * - * This method fetches the number of entries which can be accommodated in the provided samples array, and the - * reference samplesCount is updated to indicate how many samples were actually retrieved. The advantage of using this - * method for samples in contrast to polling via existing methods is to get get higher frequency data at lower polling cost. - * - * @param device The identifier for the target device - * @param type Type of sampling event - * @param lastSeenTimeStamp Return only samples with timestamp greater than lastSeenTimeStamp. - * @param sampleValType Output parameter to represent the type of sample value as described in nvmlSampleVal_t - * @param sampleCount Reference to provide the number of elements which can be queried in samples array - * @param samples Reference in which samples are returned - - * @return - * - \ref NVML_SUCCESS if samples are successfully retrieved - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, \a samplesCount is NULL or - * reference to \a sampleCount is 0 for non null \a samples - * - \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_NOT_FOUND if sample entries are not found - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceGetSamples(nvmlDevice_t device, nvmlSamplingType_t type, unsigned long long lastSeenTimeStamp, - nvmlValueType_t *sampleValType, unsigned int *sampleCount, nvmlSample_t *samples); - -/** - * Gets Total, Available and Used size of BAR1 memory. - * - * BAR1 is used to map the FB (device memory) so that it can be directly accessed by the CPU or by 3rd party - * devices (peer-to-peer on the PCIE bus). - * - * For Kepler &tm; or newer fully supported devices. - * - * @param device The identifier of the target device - * @param bar1Memory Reference in which BAR1 memory - * information is returned. - * - * @return - * - \ref NVML_SUCCESS if BAR1 memory is successfully retrieved - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, \a bar1Memory is NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - * - */ -nvmlReturn_t DECLDIR nvmlDeviceGetBAR1MemoryInfo(nvmlDevice_t device, nvmlBAR1Memory_t *bar1Memory); - - -/** - * Gets the duration of time during which the device was throttled (lower than requested clocks) due to power - * or thermal constraints. - * - * The method is important to users who are tying to understand if their GPUs throttle at any point during their applications. The - * difference in violation times at two different reference times gives the indication of GPU throttling event. - * - * Violation for thermal capping is not supported at this time. - * - * For Kepler &tm; or newer fully supported devices. - * - * @param device The identifier of the target device - * @param perfPolicyType Represents Performance policy which can trigger GPU throttling - * @param violTime Reference to which violation time related information is returned - * - * - * @return - * - \ref NVML_SUCCESS if violation time is successfully retrieved - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, \a perfPolicyType is invalid, or \a violTime is NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - */ -nvmlReturn_t DECLDIR nvmlDeviceGetViolationStatus(nvmlDevice_t device, nvmlPerfPolicyType_t perfPolicyType, nvmlViolationTime_t *violTime); - -/** - * @} - */ - -/** @addtogroup nvmlAccountingStats - * @{ - */ - -/** - * Queries the state of per process accounting mode. - * - * For Kepler &tm; or newer fully supported devices. - * - * See \ref nvmlDeviceGetAccountingStats for more details. - * See \ref nvmlDeviceSetAccountingMode - * - * @param device The identifier of the target device - * @param mode Reference in which to return the current accounting mode - * - * @return - * - \ref NVML_SUCCESS if the mode has been successfully retrieved - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a mode are NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceGetAccountingMode(nvmlDevice_t device, nvmlEnableState_t *mode); - -/** - * Queries process's accounting stats. - * - * For Kepler &tm; or newer fully supported devices. - * - * Accounting stats capture GPU utilization and other statistics across the lifetime of a process. - * Accounting stats can be queried during life time of the process and after its termination. - * The time field in \ref nvmlAccountingStats_t is reported as 0 during the lifetime of the process and - * updated to actual running time after its termination. - * Accounting stats are kept in a circular buffer, newly created processes overwrite information about old - * processes. - * - * See \ref nvmlAccountingStats_t for description of each returned metric. - * List of processes that can be queried can be retrieved from \ref nvmlDeviceGetAccountingPids. - * - * @note Accounting Mode needs to be on. See \ref nvmlDeviceGetAccountingMode. - * @note Only compute and graphics applications stats can be queried. Monitoring applications stats can't be - * queried since they don't contribute to GPU utilization. - * @note In case of pid collision stats of only the latest process (that terminated last) will be reported - * - * @warning On Kepler devices per process statistics are accurate only if there's one process running on a GPU. - * - * @param device The identifier of the target device - * @param pid Process Id of the target process to query stats for - * @param stats Reference in which to return the process's accounting stats - * - * @return - * - \ref NVML_SUCCESS if stats have been successfully retrieved - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a stats are NULL - * - \ref NVML_ERROR_NOT_FOUND if process stats were not found - * - \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature or accounting mode is disabled - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - * - * @see nvmlDeviceGetAccountingBufferSize - */ -nvmlReturn_t DECLDIR nvmlDeviceGetAccountingStats(nvmlDevice_t device, unsigned int pid, nvmlAccountingStats_t *stats); - -/** - * Queries list of processes that can be queried for accounting stats. The list of processes returned - * can be in running or terminated state. - * - * For Kepler &tm; or newer fully supported devices. - * - * To just query the number of processes ready to be queried, call this function with *count = 0 and - * pids=NULL. The return code will be NVML_ERROR_INSUFFICIENT_SIZE, or NVML_SUCCESS if list is empty. - * - * For more details see \ref nvmlDeviceGetAccountingStats. - * - * @note In case of PID collision some processes might not be accessible before the circular buffer is full. - * - * @param device The identifier of the target device - * @param count Reference in which to provide the \a pids array size, and - * to return the number of elements ready to be queried - * @param pids Reference in which to return list of process ids - * - * @return - * - \ref NVML_SUCCESS if pids were successfully retrieved - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a count is NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature or accounting mode is disabled - * - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a count is too small (\a count is set to - * expected value) - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - * - * @see nvmlDeviceGetAccountingBufferSize - */ -nvmlReturn_t DECLDIR nvmlDeviceGetAccountingPids(nvmlDevice_t device, unsigned int *count, unsigned int *pids); - -/** - * Returns the number of processes that the circular buffer with accounting pids can hold. - * - * For Kepler &tm; or newer fully supported devices. - * - * This is the maximum number of processes that accounting information will be stored for before information - * about oldest processes will get overwritten by information about new processes. - * - * @param device The identifier of the target device - * @param bufferSize Reference in which to provide the size (in number of elements) - * of the circular buffer for accounting stats. - * - * @return - * - \ref NVML_SUCCESS if buffer size was successfully retrieved - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a bufferSize is NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature or accounting mode is disabled - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - * - * @see nvmlDeviceGetAccountingStats - * @see nvmlDeviceGetAccountingPids - */ -nvmlReturn_t DECLDIR nvmlDeviceGetAccountingBufferSize(nvmlDevice_t device, unsigned int *bufferSize); - -/** @} */ - -/** @addtogroup nvmlDeviceQueries - * @{ - */ - -/** - * Returns the list of retired pages by source, including pages that are pending retirement - * The address information provided from this API is the hardware address of the page that was retired. Note - * that this does not match the virtual address used in CUDA, but will match the address information in XID 63 - * - * For Kepler &tm; or newer fully supported devices. - * - * @param device The identifier of the target device - * @param cause Filter page addresses by cause of retirement - * @param pageCount Reference in which to provide the \a addresses buffer size, and - * to return the number of retired pages that match \a cause - * Set to 0 to query the size without allocating an \a addresses buffer - * @param addresses Buffer to write the page addresses into - * - * @return - * - \ref NVML_SUCCESS if \a pageCount was populated and \a addresses was filled - * - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a pageCount indicates the buffer is not large enough to store all the - * matching page addresses. \a pageCount is set to the needed size. - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, \a pageCount is NULL, \a cause is invalid, or - * \a addresses is NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceGetRetiredPages(nvmlDevice_t device, nvmlPageRetirementCause_t cause, - unsigned int *pageCount, unsigned long long *addresses); - -/** - * Check if any pages are pending retirement and need a reboot to fully retire. - * - * For Kepler &tm; or newer fully supported devices. - * - * @param device The identifier of the target device - * @param isPending Reference in which to return the pending status - * - * @return - * - \ref NVML_SUCCESS if \a isPending was populated - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a isPending is NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceGetRetiredPagesPendingStatus(nvmlDevice_t device, nvmlEnableState_t *isPending); - -/** @} */ - -/***************************************************************************************************/ -/** @defgroup nvmlUnitCommands Unit Commands - * This chapter describes NVML operations that change the state of the unit. For S-class products. - * Each of these requires root/admin access. Non-admin users will see an NVML_ERROR_NO_PERMISSION - * error code when invoking any of these methods. - * @{ - */ -/***************************************************************************************************/ - -/** - * Set the LED state for the unit. The LED can be either green (0) or amber (1). - * - * For S-class products. - * Requires root/admin permissions. - * - * This operation takes effect immediately. - * - * - * Current S-Class products don't provide unique LEDs for each unit. As such, both front - * and back LEDs will be toggled in unison regardless of which unit is specified with this command. - * - * See \ref nvmlLedColor_t for available colors. - * - * @param unit The identifier of the target unit - * @param color The target LED color - * - * @return - * - \ref NVML_SUCCESS if the LED color has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a unit or \a color is invalid - * - \ref NVML_ERROR_NOT_SUPPORTED if this is not an S-class product - * - \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to perform this operation - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - * - * @see nvmlUnitGetLedState() - */ -nvmlReturn_t DECLDIR nvmlUnitSetLedState(nvmlUnit_t unit, nvmlLedColor_t color); - -/** @} */ - -/***************************************************************************************************/ -/** @defgroup nvmlDeviceCommands Device Commands - * This chapter describes NVML operations that change the state of the device. - * Each of these requires root/admin access. Non-admin users will see an NVML_ERROR_NO_PERMISSION - * error code when invoking any of these methods. - * @{ - */ -/***************************************************************************************************/ - -/** - * Set the persistence mode for the device. - * - * For all products. - * For Linux only. - * Requires root/admin permissions. - * - * The persistence mode determines whether the GPU driver software is torn down after the last client - * exits. - * - * This operation takes effect immediately. It is not persistent across reboots. After each reboot the - * persistence mode is reset to "Disabled". - * - * See \ref nvmlEnableState_t for available modes. - * - * @param device The identifier of the target device - * @param mode The target persistence mode - * - * @return - * - \ref NVML_SUCCESS if the persistence mode was set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a mode is invalid - * - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - * - \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to perform this operation - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - * - * @see nvmlDeviceGetPersistenceMode() - */ -nvmlReturn_t DECLDIR nvmlDeviceSetPersistenceMode(nvmlDevice_t device, nvmlEnableState_t mode); - -/** - * Set the compute mode for the device. - * - * For all products. - * Requires root/admin permissions. - * - * The compute mode determines whether a GPU can be used for compute operations and whether it can - * be shared across contexts. - * - * This operation takes effect immediately. Under Linux it is not persistent across reboots and - * always resets to "Default". Under windows it is persistent. - * - * Under windows compute mode may only be set to DEFAULT when running in WDDM - * - * See \ref nvmlComputeMode_t for details on available compute modes. - * - * @param device The identifier of the target device - * @param mode The target compute mode - * - * @return - * - \ref NVML_SUCCESS if the compute mode was set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a mode is invalid - * - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - * - \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to perform this operation - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - * - * @see nvmlDeviceGetComputeMode() - */ -nvmlReturn_t DECLDIR nvmlDeviceSetComputeMode(nvmlDevice_t device, nvmlComputeMode_t mode); - -/** - * Set the ECC mode for the device. - * - * For Kepler &tm; or newer fully supported devices. - * Only applicable to devices with ECC. - * Requires \a NVML_INFOROM_ECC version 1.0 or higher. - * Requires root/admin permissions. - * - * The ECC mode determines whether the GPU enables its ECC support. - * - * This operation takes effect after the next reboot. - * - * See \ref nvmlEnableState_t for details on available modes. - * - * @param device The identifier of the target device - * @param ecc The target ECC mode - * - * @return - * - \ref NVML_SUCCESS if the ECC mode was set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a ecc is invalid - * - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - * - \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to perform this operation - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - * - * @see nvmlDeviceGetEccMode() - */ -nvmlReturn_t DECLDIR nvmlDeviceSetEccMode(nvmlDevice_t device, nvmlEnableState_t ecc); - -/** - * Clear the ECC error and other memory error counts for the device. - * - * For Kepler &tm; or newer fully supported devices. - * Only applicable to devices with ECC. - * Requires \a NVML_INFOROM_ECC version 2.0 or higher to clear aggregate location-based ECC counts. - * Requires \a NVML_INFOROM_ECC version 1.0 or higher to clear all other ECC counts. - * Requires root/admin permissions. - * Requires ECC Mode to be enabled. - * - * Sets all of the specified ECC counters to 0, including both detailed and total counts. - * - * This operation takes effect immediately. - * - * See \ref nvmlMemoryErrorType_t for details on available counter types. - * - * @param device The identifier of the target device - * @param counterType Flag that indicates which type of errors should be cleared. - * - * @return - * - \ref NVML_SUCCESS if the error counts were cleared - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a counterType is invalid - * - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - * - \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to perform this operation - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - * - * @see - * - nvmlDeviceGetDetailedEccErrors() - * - nvmlDeviceGetTotalEccErrors() - */ -nvmlReturn_t DECLDIR nvmlDeviceClearEccErrorCounts(nvmlDevice_t device, nvmlEccCounterType_t counterType); - -/** - * Set the driver model for the device. - * - * For Fermi &tm; or newer fully supported devices. - * For windows only. - * Requires root/admin permissions. - * - * On Windows platforms the device driver can run in either WDDM or WDM (TCC) mode. If a display is attached - * to the device it must run in WDDM mode. - * - * It is possible to force the change to WDM (TCC) while the display is still attached with a force flag (nvmlFlagForce). - * This should only be done if the host is subsequently powered down and the display is detached from the device - * before the next reboot. - * - * This operation takes effect after the next reboot. - * - * Windows driver model may only be set to WDDM when running in DEFAULT compute mode. - * - * Change driver model to WDDM is not supported when GPU doesn't support graphics acceleration or - * will not support it after reboot. See \ref nvmlDeviceSetGpuOperationMode. - * - * See \ref nvmlDriverModel_t for details on available driver models. - * See \ref nvmlFlagDefault and \ref nvmlFlagForce - * - * @param device The identifier of the target device - * @param driverModel The target driver model - * @param flags Flags that change the default behavior - * - * @return - * - \ref NVML_SUCCESS if the driver model has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a driverModel is invalid - * - \ref NVML_ERROR_NOT_SUPPORTED if the platform is not windows or the device does not support this feature - * - \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to perform this operation - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - * - * @see nvmlDeviceGetDriverModel() - */ -nvmlReturn_t DECLDIR nvmlDeviceSetDriverModel(nvmlDevice_t device, nvmlDriverModel_t driverModel, unsigned int flags); - -/** - * Set clocks that applications will lock to. - * - * Sets the clocks that compute and graphics applications will be running at. - * e.g. CUDA driver requests these clocks during context creation which means this property - * defines clocks at which CUDA applications will be running unless some overspec event - * occurs (e.g. over power, over thermal or external HW brake). - * - * Can be used as a setting to request constant performance. - * - * On Pascal and newer hardware, this will automatically disable automatic boosting of clocks. - * - * On K80 and newer Kepler and Maxwell GPUs, users desiring fixed performance should also call - * \ref nvmlDeviceSetAutoBoostedClocksEnabled to prevent clocks from automatically boosting - * above the clock value being set. - * - * For Kepler &tm; or newer non-GeForce fully supported devices and Maxwell or newer GeForce devices. - * Requires root/admin permissions. - * - * See \ref nvmlDeviceGetSupportedMemoryClocks and \ref nvmlDeviceGetSupportedGraphicsClocks - * for details on how to list available clocks combinations. - * - * After system reboot or driver reload applications clocks go back to their default value. - * See \ref nvmlDeviceResetApplicationsClocks. - * - * @param device The identifier of the target device - * @param memClockMHz Requested memory clock in MHz - * @param graphicsClockMHz Requested graphics clock in MHz - * - * @return - * - \ref NVML_SUCCESS if new settings were successfully set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a memClockMHz and \a graphicsClockMHz - * is not a valid clock combination - * - \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to perform this operation - * - \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceSetApplicationsClocks(nvmlDevice_t device, unsigned int memClockMHz, unsigned int graphicsClockMHz); - -/** - * Set new power limit of this device. - * - * For Kepler &tm; or newer fully supported devices. - * Requires root/admin permissions. - * - * See \ref nvmlDeviceGetPowerManagementLimitConstraints to check the allowed ranges of values. - * - * \note Limit is not persistent across reboots or driver unloads. - * Enable persistent mode to prevent driver from unloading when no application is using the device. - * - * @param device The identifier of the target device - * @param limit Power management limit in milliwatts to set - * - * @return - * - \ref NVML_SUCCESS if \a limit has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a defaultLimit is out of range - * - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - * - * @see nvmlDeviceGetPowerManagementLimitConstraints - * @see nvmlDeviceGetPowerManagementDefaultLimit - */ -nvmlReturn_t DECLDIR nvmlDeviceSetPowerManagementLimit(nvmlDevice_t device, unsigned int limit); - -/** - * Sets new GOM. See \a nvmlGpuOperationMode_t for details. - * - * For GK110 M-class and X-class Tesla &tm; products from the Kepler family. - * Modes \ref NVML_GOM_LOW_DP and \ref NVML_GOM_ALL_ON are supported on fully supported GeForce products. - * Not supported on Quadro ® and Tesla &tm; C-class products. - * Requires root/admin permissions. - * - * Changing GOMs requires a reboot. - * The reboot requirement might be removed in the future. - * - * Compute only GOMs don't support graphics acceleration. Under windows switching to these GOMs when - * pending driver model is WDDM is not supported. See \ref nvmlDeviceSetDriverModel. - * - * @param device The identifier of the target device - * @param mode Target GOM - * - * @return - * - \ref NVML_SUCCESS if \a mode has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a mode incorrect - * - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support GOM or specific mode - * - \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to perform this operation - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - * - * @see nvmlGpuOperationMode_t - * @see nvmlDeviceGetGpuOperationMode - */ -nvmlReturn_t DECLDIR nvmlDeviceSetGpuOperationMode(nvmlDevice_t device, nvmlGpuOperationMode_t mode); - -/** - * Changes the root/admin restructions on certain APIs. See \a nvmlRestrictedAPI_t for the list of supported APIs. - * This method can be used by a root/admin user to give non-root/admin access to certain otherwise-restricted APIs. - * The new setting lasts for the lifetime of the NVIDIA driver; it is not persistent. See \a nvmlDeviceGetAPIRestriction - * to query the current restriction settings. - * - * For Kepler &tm; or newer fully supported devices. - * Requires root/admin permissions. - * - * @param device The identifier of the target device - * @param apiType Target API type for this operation - * @param isRestricted The target restriction - * - * @return - * - \ref NVML_SUCCESS if \a isRestricted has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a apiType incorrect - * - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support changing API restrictions or the device does not support - * the feature that api restrictions are being set for (E.G. Enabling/disabling auto - * boosted clocks is not supported by the device) - * - \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to perform this operation - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - * - * @see nvmlRestrictedAPI_t - */ -nvmlReturn_t DECLDIR nvmlDeviceSetAPIRestriction(nvmlDevice_t device, nvmlRestrictedAPI_t apiType, nvmlEnableState_t isRestricted); - -/** - * @} - */ - -/** @addtogroup nvmlAccountingStats - * @{ - */ - -/** - * Enables or disables per process accounting. - * - * For Kepler &tm; or newer fully supported devices. - * Requires root/admin permissions. - * - * @note This setting is not persistent and will default to disabled after driver unloads. - * Enable persistence mode to be sure the setting doesn't switch off to disabled. - * - * @note Enabling accounting mode has no negative impact on the GPU performance. - * - * @note Disabling accounting clears all accounting pids information. - * - * See \ref nvmlDeviceGetAccountingMode - * See \ref nvmlDeviceGetAccountingStats - * See \ref nvmlDeviceClearAccountingPids - * - * @param device The identifier of the target device - * @param mode The target accounting mode - * - * @return - * - \ref NVML_SUCCESS if the new mode has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device or \a mode are invalid - * - \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature - * - \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to perform this operation - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceSetAccountingMode(nvmlDevice_t device, nvmlEnableState_t mode); - -/** - * Clears accounting information about all processes that have already terminated. - * - * For Kepler &tm; or newer fully supported devices. - * Requires root/admin permissions. - * - * See \ref nvmlDeviceGetAccountingMode - * See \ref nvmlDeviceGetAccountingStats - * See \ref nvmlDeviceSetAccountingMode - * - * @param device The identifier of the target device - * - * @return - * - \ref NVML_SUCCESS if accounting information has been cleared - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device are invalid - * - \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature - * - \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to perform this operation - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceClearAccountingPids(nvmlDevice_t device); - -/** @} */ - -/***************************************************************************************************/ -/** @defgroup NvLink NvLink Methods - * This chapter describes methods that NVML can perform on NVLINK enabled devices. - * @{ - */ -/***************************************************************************************************/ - -/** - * Retrieves the state of the device's NvLink for the link specified - * - * For newer than Maxwell &tm; fully supported devices. - * - * @param device The identifier of the target device - * @param link Specifies the NvLink link to be queried - * @param isActive \a nvmlEnableState_t where NVML_FEATURE_ENABLED indicates that - * the link is active and NVML_FEATURE_DISABLED indicates it - * is inactive - * - * @return - * - \ref NVML_SUCCESS if \a isActive has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device or \a link is invalid or \a isActive is NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceGetNvLinkState(nvmlDevice_t device, unsigned int link, nvmlEnableState_t *isActive); - -/** - * Retrieves the version of the device's NvLink for the link specified - * - * For newer than Maxwell &tm; fully supported devices. - * - * @param device The identifier of the target device - * @param link Specifies the NvLink link to be queried - * @param version Requested NvLink version - * - * @return - * - \ref NVML_SUCCESS if \a version has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device or \a link is invalid or \a version is NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceGetNvLinkVersion(nvmlDevice_t device, unsigned int link, unsigned int *version); - -/** - * Retrieves the requested capability from the device's NvLink for the link specified - * Please refer to the \a nvmlNvLinkCapability_t structure for the specific caps that can be queried - * The return value should be treated as a boolean. - * - * For newer than Maxwell &tm; fully supported devices. - * - * @param device The identifier of the target device - * @param link Specifies the NvLink link to be queried - * @param capability Specifies the \a nvmlNvLinkCapability_t to be queried - * @param capResult A boolean for the queried capability indicating that feature is available - * - * @return - * - \ref NVML_SUCCESS if \a capResult has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device, \a link, or \a capability is invalid or \a capResult is NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceGetNvLinkCapability(nvmlDevice_t device, unsigned int link, - nvmlNvLinkCapability_t capability, unsigned int *capResult); - -/** - * Retrieves the PCI information for the remote node on a NvLink link - * Note: pciSubSystemId is not filled in this function and is indeterminate - * - * For newer than Maxwell &tm; fully supported devices. - * - * @param device The identifier of the target device - * @param link Specifies the NvLink link to be queried - * @param pci \a nvmlPciInfo_t of the remote node for the specified link - * - * @return - * - \ref NVML_SUCCESS if \a pci has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device or \a link is invalid or \a pci is NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceGetNvLinkRemotePciInfo(nvmlDevice_t device, unsigned int link, nvmlPciInfo_t *pci); - -/** - * Retrieves the specified error counter value - * Please refer to \a nvmlNvLinkErrorCounter_t for error counters that are available - * - * For newer than Maxwell &tm; fully supported devices. - * - * @param device The identifier of the target device - * @param link Specifies the NvLink link to be queried - * @param counter Specifies the NvLink counter to be queried - * @param counterValue Returned counter value - * - * @return - * - \ref NVML_SUCCESS if \a counter has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device, \a link, or \a counter is invalid or \a counterValue is NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceGetNvLinkErrorCounter(nvmlDevice_t device, unsigned int link, - nvmlNvLinkErrorCounter_t counter, unsigned long long *counterValue); - -/** - * Resets all error counters to zero - * Please refer to \a nvmlNvLinkErrorCounter_t for the list of error counters that are reset - * - * For newer than Maxwell &tm; fully supported devices. - * - * @param device The identifier of the target device - * @param link Specifies the NvLink link to be queried - * - * @return - * - \ref NVML_SUCCESS if the reset is successful - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device or \a link is invalid - * - \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceResetNvLinkErrorCounters(nvmlDevice_t device, unsigned int link); - -/** - * Set the NVLINK utilization counter control information for the specified counter, 0 or 1. - * Please refer to \a nvmlNvLinkUtilizationControl_t for the structure definition. Performs a reset - * of the counters if the reset parameter is non-zero. - * - * For newer than Maxwell &tm; fully supported devices. - * - * @param device The identifier of the target device - * @param counter Specifies the counter that should be set (0 or 1). - * @param link Specifies the NvLink link to be queried - * @param control A reference to the \a nvmlNvLinkUtilizationControl_t to set - * @param reset Resets the counters on set if non-zero - * - * @return - * - \ref NVML_SUCCESS if the control has been set successfully - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device, \a counter, \a link, or \a control is invalid - * - \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceSetNvLinkUtilizationControl(nvmlDevice_t device, unsigned int link, unsigned int counter, - nvmlNvLinkUtilizationControl_t *control, unsigned int reset); - -/** - * Get the NVLINK utilization counter control information for the specified counter, 0 or 1. - * Please refer to \a nvmlNvLinkUtilizationControl_t for the structure definition - * - * For newer than Maxwell &tm; fully supported devices. - * - * @param device The identifier of the target device - * @param counter Specifies the counter that should be set (0 or 1). - * @param link Specifies the NvLink link to be queried - * @param control A reference to the \a nvmlNvLinkUtilizationControl_t to place information - * - * @return - * - \ref NVML_SUCCESS if the control has been set successfully - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device, \a counter, \a link, or \a control is invalid - * - \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceGetNvLinkUtilizationControl(nvmlDevice_t device, unsigned int link, unsigned int counter, - nvmlNvLinkUtilizationControl_t *control); - - -/** - * Retrieve the NVLINK utilization counter based on the current control for a specified counter. - * In general it is good practice to use \a nvmlDeviceSetNvLinkUtilizationControl - * before reading the utilization counters as they have no default state - * - * For newer than Maxwell &tm; fully supported devices. - * - * @param device The identifier of the target device - * @param link Specifies the NvLink link to be queried - * @param counter Specifies the counter that should be read (0 or 1). - * @param rxcounter Receive counter return value - * @param txcounter Transmit counter return value - * - * @return - * - \ref NVML_SUCCESS if \a rxcounter and \a txcounter have been successfully set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device, \a counter, or \a link is invalid or \a rxcounter or \a txcounter are NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceGetNvLinkUtilizationCounter(nvmlDevice_t device, unsigned int link, unsigned int counter, - unsigned long long *rxcounter, unsigned long long *txcounter); - -/** - * Freeze the NVLINK utilization counters - * Both the receive and transmit counters are operated on by this function - * - * For newer than Maxwell &tm; fully supported devices. - * - * @param device The identifier of the target device - * @param link Specifies the NvLink link to be queried - * @param counter Specifies the counter that should be frozen (0 or 1). - * @param freeze NVML_FEATURE_ENABLED = freeze the receive and transmit counters - * NVML_FEATURE_DISABLED = unfreeze the receive and transmit counters - * - * @return - * - \ref NVML_SUCCESS if counters were successfully frozen or unfrozen - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device, \a link, \a counter, or \a freeze is invalid - * - \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceFreezeNvLinkUtilizationCounter (nvmlDevice_t device, unsigned int link, - unsigned int counter, nvmlEnableState_t freeze); - -/** - * Reset the NVLINK utilization counters - * Both the receive and transmit counters are operated on by this function - * - * For newer than Maxwell &tm; fully supported devices. - * - * @param device The identifier of the target device - * @param link Specifies the NvLink link to be reset - * @param counter Specifies the counter that should be reset (0 or 1) - * - * @return - * - \ref NVML_SUCCESS if counters were successfully reset - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device, \a link, or \a counter is invalid - * - \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceResetNvLinkUtilizationCounter (nvmlDevice_t device, unsigned int link, unsigned int counter); - -/** @} */ - -/***************************************************************************************************/ -/** @defgroup nvmlEvents Event Handling Methods - * This chapter describes methods that NVML can perform against each device to register and wait for - * some event to occur. - * @{ - */ -/***************************************************************************************************/ - -/** - * Create an empty set of events. - * Event set should be freed by \ref nvmlEventSetFree - * - * For Fermi &tm; or newer fully supported devices. - * @param set Reference in which to return the event handle - * - * @return - * - \ref NVML_SUCCESS if the event has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a set is NULL - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - * - * @see nvmlEventSetFree - */ -nvmlReturn_t DECLDIR nvmlEventSetCreate(nvmlEventSet_t *set); - -/** - * Starts recording of events on a specified devices and add the events to specified \ref nvmlEventSet_t - * - * For Fermi &tm; or newer fully supported devices. - * Ecc events are available only on ECC enabled devices (see \ref nvmlDeviceGetTotalEccErrors) - * Power capping events are available only on Power Management enabled devices (see \ref nvmlDeviceGetPowerManagementMode) - * - * For Linux only. - * - * \b IMPORTANT: Operations on \a set are not thread safe - * - * This call starts recording of events on specific device. - * All events that occurred before this call are not recorded. - * Checking if some event occurred can be done with \ref nvmlEventSetWait - * - * If function reports NVML_ERROR_UNKNOWN, event set is in undefined state and should be freed. - * If function reports NVML_ERROR_NOT_SUPPORTED, event set can still be used. None of the requested eventTypes - * are registered in that case. - * - * @param device The identifier of the target device - * @param eventTypes Bitmask of \ref nvmlEventType to record - * @param set Set to which add new event types - * - * @return - * - \ref NVML_SUCCESS if the event has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a eventTypes is invalid or \a set is NULL - * - \ref NVML_ERROR_NOT_SUPPORTED if the platform does not support this feature or some of requested event types - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - * - * @see nvmlEventType - * @see nvmlDeviceGetSupportedEventTypes - * @see nvmlEventSetWait - * @see nvmlEventSetFree - */ -nvmlReturn_t DECLDIR nvmlDeviceRegisterEvents(nvmlDevice_t device, unsigned long long eventTypes, nvmlEventSet_t set); - -/** - * Returns information about events supported on device - * - * For Fermi &tm; or newer fully supported devices. - * - * Events are not supported on Windows. So this function returns an empty mask in \a eventTypes on Windows. - * - * @param device The identifier of the target device - * @param eventTypes Reference in which to return bitmask of supported events - * - * @return - * - \ref NVML_SUCCESS if the eventTypes has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a eventType is NULL - * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - * - * @see nvmlEventType - * @see nvmlDeviceRegisterEvents - */ -nvmlReturn_t DECLDIR nvmlDeviceGetSupportedEventTypes(nvmlDevice_t device, unsigned long long *eventTypes); - -/** - * Waits on events and delivers events - * - * For Fermi &tm; or newer fully supported devices. - * - * If some events are ready to be delivered at the time of the call, function returns immediately. - * If there are no events ready to be delivered, function sleeps till event arrives - * but not longer than specified timeout. This function in certain conditions can return before - * specified timeout passes (e.g. when interrupt arrives) - * - * In case of xid error, the function returns the most recent xid error type seen by the system. If there are multiple - * xid errors generated before nvmlEventSetWait is invoked then the last seen xid error type is returned for all - * xid error events. - * - * @param set Reference to set of events to wait on - * @param data Reference in which to return event data - * @param timeoutms Maximum amount of wait time in milliseconds for registered event - * - * @return - * - \ref NVML_SUCCESS if the data has been set - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a data is NULL - * - \ref NVML_ERROR_TIMEOUT if no event arrived in specified timeout or interrupt arrived - * - \ref NVML_ERROR_GPU_IS_LOST if a GPU has fallen off the bus or is otherwise inaccessible - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - * - * @see nvmlEventType - * @see nvmlDeviceRegisterEvents - */ -nvmlReturn_t DECLDIR nvmlEventSetWait(nvmlEventSet_t set, nvmlEventData_t * data, unsigned int timeoutms); - -/** - * Releases events in the set - * - * For Fermi &tm; or newer fully supported devices. - * - * @param set Reference to events to be released - * - * @return - * - \ref NVML_SUCCESS if the event has been successfully released - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - * - * @see nvmlDeviceRegisterEvents - */ -nvmlReturn_t DECLDIR nvmlEventSetFree(nvmlEventSet_t set); - -/** @} */ - -/***************************************************************************************************/ -/** @defgroup nvmlZPI Drain states - * This chapter describes methods that NVML can perform against each device to control their drain state - * and recognition by NVML and NVIDIA kernel driver. These methods can be used with out-of-band tools to - * power on/off GPUs, enable robust reset scenarios, etc. - * @{ - */ -/***************************************************************************************************/ - -/** - * Modify the drain state of a GPU. This method forces a GPU to no longer accept new incoming requests. - * Any new NVML process will no longer see this GPU. Persistence mode for this GPU must be turned off before - * this call is made. - * Must be called as administrator. - * For Linux only. - * - * For newer than Maxwell &tm; fully supported devices. - * Some Kepler devices supported. - * - * @param pciInfo The PCI address of the GPU drain state to be modified - * @param newState The drain state that should be entered, see \ref nvmlEnableState_t - * - * @return - * - \ref NVML_SUCCESS if counters were successfully reset - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a nvmlIndex or \a newState is invalid - * - \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature - * - \ref NVML_ERROR_NO_PERMISSION if the calling process has insufficient permissions to perform operation - * - \ref NVML_ERROR_IN_USE if the device has persistence mode turned on - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceModifyDrainState (nvmlPciInfo_t *pciInfo, nvmlEnableState_t newState); - -/** - * Query the drain state of a GPU. This method is used to check if a GPU is in a currently draining - * state. - * For Linux only. - * - * For newer than Maxwell &tm; fully supported devices. - * Some Kepler devices supported. - * - * @param pciInfo The PCI address of the GPU drain state to be queried - * @param currentState The current drain state for this GPU, see \ref nvmlEnableState_t - * - * @return - * - \ref NVML_SUCCESS if counters were successfully reset - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a nvmlIndex or \a currentState is invalid - * - \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceQueryDrainState (nvmlPciInfo_t *pciInfo, nvmlEnableState_t *currentState); - -/** - * This method will remove the specified GPU from the view of both NVML and the NVIDIA kernel driver - * as long as no other processes are attached. If other processes are attached, this call will return - * NVML_ERROR_IN_USE and the GPU will be returned to its original "draining" state. Note: the - * only situation where a process can still be attached after nvmlDeviceModifyDrainState() is called - * to initiate the draining state is if that process was using, and is still using, a GPU before the - * call was made. Also note, persistence mode counts as an attachment to the GPU thus it must be disabled - * prior to this call. - * - * For long-running NVML processes please note that this will change the enumeration of current GPUs. - * For example, if there are four GPUs present and GPU1 is removed, the new enumeration will be 0-2. - * Also, device handles after the removed GPU will not be valid and must be re-established. - * Must be run as administrator. - * For Linux only. - * - * For newer than Maxwell &tm; fully supported devices. - * Some Kepler devices supported. - * - * @param pciInfo The PCI address of the GPU to be removed - * - * @return - * - \ref NVML_SUCCESS if counters were successfully reset - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a nvmlIndex is invalid - * - \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature - * - \ref NVML_ERROR_IN_USE if the device is still in use and cannot be removed - */ -nvmlReturn_t DECLDIR nvmlDeviceRemoveGpu (nvmlPciInfo_t *pciInfo); - -/** - * Request the OS and the NVIDIA kernel driver to rediscover a portion of the PCI subsystem looking for GPUs that - * were previously removed. The portion of the PCI tree can be narrowed by specifying a domain, bus, and device. - * If all are zeroes then the entire PCI tree will be searched. Please note that for long-running NVML processes - * the enumeration will change based on how many GPUs are discovered and where they are inserted in bus order. - * - * In addition, all newly discovered GPUs will be initialized and their ECC scrubbed which may take several seconds - * per GPU. Also, all device handles are no longer guaranteed to be valid post discovery. - * - * Must be run as administrator. - * For Linux only. - * - * For newer than Maxwell &tm; fully supported devices. - * Some Kepler devices supported. - * - * @param pciInfo The PCI tree to be searched. Only the domain, bus, and device - * fields are used in this call. - * - * @return - * - \ref NVML_SUCCESS if counters were successfully reset - * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - * - \ref NVML_ERROR_INVALID_ARGUMENT if \a pciInfo is invalid - * - \ref NVML_ERROR_NOT_SUPPORTED if the operating system does not support this feature - * - \ref NVML_ERROR_OPERATING_SYSTEM if the operating system is denying this feature - * - \ref NVML_ERROR_NO_PERMISSION if the calling process has insufficient permissions to perform operation - * - \ref NVML_ERROR_UNKNOWN on any unexpected error - */ -nvmlReturn_t DECLDIR nvmlDeviceDiscoverGpus (nvmlPciInfo_t *pciInfo); - -/** @} */ - -/** - * NVML API versioning support - */ -#if defined(__NVML_API_VERSION_INTERNAL) -#undef nvmlDeviceGetPciInfo -#undef nvmlDeviceGetCount -#undef nvmlDeviceGetHandleByIndex -#undef nvmlDeviceGetHandleByPciBusId -#undef nvmlInit -#endif - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/plugins/media-keys/gsd-media-keys-manager.c b/plugins/media-keys/gsd-media-keys-manager.c index d6c5fdd..fd6a5ec 100644 --- a/plugins/media-keys/gsd-media-keys-manager.c +++ b/plugins/media-keys/gsd-media-keys-manager.c @@ -211,7 +211,6 @@ struct GsdMediaKeysManagerPrivate guint screencast_timeout_id; gboolean screencast_recording; GCancellable *screencast_cancellable; - guint screencast_stopped_signal_id; /* Rotation */ guint iio_sensor_watch_id; @@ -2348,26 +2347,20 @@ do_rfkill_action (GsdMediaKeysManager *manager, } static void -screencast_stopped (GsdMediaKeysManager *manager) +screencast_stop (GsdMediaKeysManager *manager) { if (manager->priv->screencast_timeout_id > 0) { g_source_remove (manager->priv->screencast_timeout_id); manager->priv->screencast_timeout_id = 0; } - manager->priv->screencast_recording = FALSE; -} - -static void -screencast_stop (GsdMediaKeysManager *manager) -{ - screencast_stopped (manager); - g_dbus_proxy_call (manager->priv->screencast_proxy, "StopScreencast", NULL, G_DBUS_CALL_FLAGS_NONE, -1, manager->priv->screencast_cancellable, NULL, NULL); + + manager->priv->screencast_recording = FALSE; } static gboolean @@ -2843,21 +2836,6 @@ initialize_volume_handler (GsdMediaKeysManager *manager) gnome_settings_profile_end ("gvc_mixer_control_new"); } - -static void -on_screencast_stopped (GDBusConnection *connection, - const gchar *sender_name, - const gchar *object_path, - const gchar *interface_name, - const gchar *signal_name, - GVariant *parameters, - gpointer data) -{ - GsdMediaKeysManager *manager = data; - - screencast_stopped (manager); -} - static void on_screencast_proxy_ready (GObject *source, GAsyncResult *result, @@ -2873,20 +2851,7 @@ on_screencast_proxy_ready (GObject *source, if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) g_warning ("Failed to create proxy for screencast: %s", error->message); g_error_free (error); - return; } - - manager->priv->screencast_stopped_signal_id = - g_dbus_connection_signal_subscribe (manager->priv->connection, - SHELL_DBUS_NAME ".Screencast", - SHELL_DBUS_NAME ".Screencast", - "Stopped", - SHELL_DBUS_PATH "/Screencast", - NULL, - G_DBUS_SIGNAL_FLAGS_NONE, - on_screencast_stopped, - manager, - NULL); } static void @@ -2937,11 +2902,6 @@ shell_presence_changed (GsdMediaKeysManager *manager) on_screencast_proxy_ready, manager); g_free (name_owner); } else { - if (manager->priv->screencast_stopped_signal_id) - g_dbus_connection_signal_unsubscribe (manager->priv->connection, - manager->priv->screencast_stopped_signal_id); - manager->priv->screencast_stopped_signal_id = 0; - g_ptr_array_set_size (manager->priv->keys, 0); g_clear_object (&manager->priv->key_grabber); g_clear_object (&manager->priv->screencast_proxy); @@ -3132,12 +3092,6 @@ gsd_media_keys_manager_stop (GsdMediaKeysManager *manager) priv->reenable_power_button_timer_id = 0; } - if (priv->screencast_stopped_signal_id) { - g_dbus_connection_signal_unsubscribe (priv->connection, - priv->screencast_stopped_signal_id); - priv->screencast_stopped_signal_id = 0; - } - g_clear_pointer (&manager->priv->ca, ca_context_destroy); #if HAVE_GUDEV diff --git a/plugins/meson.build b/plugins/meson.build index 3c4d42a..3db69da 100644 --- a/plugins/meson.build +++ b/plugins/meson.build @@ -1,6 +1,5 @@ enabled_plugins = [ ['a11y-settings', 'A11ySettings'], - ['account', 'Account'], ['clipboard', 'Clipboard'], ['color', 'Color'], ['datetime', 'Datetime'], diff --git a/plugins/smartcard/gsd-smartcard-manager.c b/plugins/smartcard/gsd-smartcard-manager.c index 09ccecc..94ffdd9 100644 --- a/plugins/smartcard/gsd-smartcard-manager.c +++ b/plugins/smartcard/gsd-smartcard-manager.c @@ -184,7 +184,7 @@ watch_one_event_from_driver (GsdSmartcardManager *self, GError **error) { GsdSmartcardManagerPrivate *priv = self->priv; - PK11SlotInfo *card = NULL, *old_card; + PK11SlotInfo *card, *old_card; CK_SLOT_ID slot_id; gulong handler_id; int old_slot_series = -1, slot_series; @@ -194,8 +194,7 @@ watch_one_event_from_driver (GsdSmartcardManager *self, operation, NULL); - if (handler_id != 0) - card = SECMOD_WaitForAnyTokenEvent (operation->driver, 0, PR_SecondsToInterval (1)); + card = SECMOD_WaitForAnyTokenEvent (operation->driver, 0, PR_SecondsToInterval (1)); g_cancellable_disconnect (cancellable, handler_id); @@ -792,8 +791,6 @@ gsd_smartcard_manager_stop (GsdSmartcardManager *self) g_debug ("Stopping smartcard manager"); - g_cancellable_cancel (priv->cancellable); - unload_nss (self); g_clear_object (&priv->settings); diff --git a/plugins/xsettings/gsd-xsettings-manager.c b/plugins/xsettings/gsd-xsettings-manager.c index 8121621..72e42d8 100644 --- a/plugins/xsettings/gsd-xsettings-manager.c +++ b/plugins/xsettings/gsd-xsettings-manager.c @@ -478,7 +478,6 @@ static TranslationEntry translations [] = { { "org.gnome.desktop.interface", "icon-theme", "Net/IconThemeName", translate_string_string }, { "org.gnome.desktop.interface", "cursor-theme", "Gtk/CursorThemeName", translate_string_string }, { "org.gnome.desktop.interface", "gtk-enable-primary-paste", "Gtk/EnablePrimaryPaste", translate_bool_int }, - { "org.gnome.desktop.interface", "overlay-scrolling", "Gtk/OverlayScrolling", translate_bool_int }, /* cursor-size is handled via the Xft side as it needs the scaling factor */ { "org.gnome.desktop.sound", "theme-name", "Net/SoundThemeName", translate_string_string },