Back to index

indicator-session  12.10.0
Classes | Defines | Typedefs | Functions
users-service-dbus.h File Reference
#include <glib.h>
#include <glib-object.h>
#include "dbus-user.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _UsersServiceDbus
 A facade class which interacts with multiple DBus services to track info which is useful to the interactor's user menu: More...
struct  _UsersServiceDbusClass

Defines

#define USERS_SERVICE_DBUS_TYPE   (users_service_dbus_get_type ())
#define USERS_SERVICE_DBUS(o)   (G_TYPE_CHECK_INSTANCE_CAST ((o), USERS_SERVICE_DBUS_TYPE, UsersServiceDbus))
#define IS_USERS_SERVICE_DBUS(o)   (G_TYPE_CHECK_INSTANCE_TYPE ((o), USERS_SERVICE_DBUS_TYPE))

Typedefs

typedef struct _UsersServiceDbus
typedef struct _UsersServiceDbusClass
typedef struct _UsersServiceDbusPrivate

Functions

GType users_service_dbus_get_type (void) G_GNUC_CONST
GList * users_service_dbus_get_user_list (UsersServiceDbus *self)
 users_service_dbus_get_user_list:
gboolean users_service_dbus_is_guest_logged_in (UsersServiceDbus *self)
gboolean users_service_dbus_is_user_logged_in (UsersServiceDbus *self, AccountsUser *user)
void users_service_dbus_show_greeter (UsersServiceDbus *self)
 users_service_dbus_show_greeter:
gboolean users_service_dbus_guest_session_enabled (UsersServiceDbus *self)
 users_service_dbus_guest_session_enabled:
gboolean users_service_dbus_can_activate_session (UsersServiceDbus *self)
void users_service_dbus_activate_guest_session (UsersServiceDbus *self)
 users_service_dbus_activate_guest_session:
void users_service_dbus_activate_user_session (UsersServiceDbus *self, AccountsUser *user)
 users_service_dbus_activate_user_session:

Class Documentation

struct _UsersServiceDbus

A facade class which interacts with multiple DBus services to track info which is useful to the interactor's user menu:

  1. A list of users to add to the user menu.

    Each user is an AccountsUser object, which is a GDBusProxy to an org.freedesktop.Accounts.User object.

    We initially build this list by calling org.freedesktop.Accounts' GetCachedUsers method. We also monitor o.f.Accounts' UserAdded and UserDeleted and update the list accordingly.

  1. Track which users currently have X sessions. This is used for the menuitems' USER_ITEM_PROP_LOGGED_IN property.

    We initially build this list by calling org.freedesktop.ConsoleKit.Seat's GetDevices method. We also monitor the seat for SessionAdded and SessionRemoved and update the list accordingly.

  1. Provide an API for user switching and guest sessions. These are typically pass-through functions to GDBusProxies.

Definition at line 63 of file users-service-dbus.h.

Class Members
GObject parent
UsersServiceDbusPrivate * priv

Define Documentation

#define IS_USERS_SERVICE_DBUS (   o)    (G_TYPE_CHECK_INSTANCE_TYPE ((o), USERS_SERVICE_DBUS_TYPE))

Definition at line 33 of file users-service-dbus.h.

#define USERS_SERVICE_DBUS (   o)    (G_TYPE_CHECK_INSTANCE_CAST ((o), USERS_SERVICE_DBUS_TYPE, UsersServiceDbus))

Definition at line 32 of file users-service-dbus.h.

Definition at line 31 of file users-service-dbus.h.


Typedef Documentation

typedef struct _UsersServiceDbus

Definition at line 35 of file users-service-dbus.h.

typedef struct _UsersServiceDbusClass

Definition at line 36 of file users-service-dbus.h.

typedef struct _UsersServiceDbusPrivate

Definition at line 37 of file users-service-dbus.h.


Function Documentation

void users_service_dbus_activate_guest_session ( UsersServiceDbus *  self)

users_service_dbus_activate_guest_session:

Activates the guest account.

Definition at line 943 of file users-service-dbus.c.

{
  g_return_if_fail(IS_USERS_SERVICE_DBUS(self));

  DisplayManagerSeat * dp = create_display_proxy (self);
  display_manager_seat_call_switch_to_guest_sync (dp, "", NULL, NULL);
  g_clear_object (&dp);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void users_service_dbus_activate_user_session ( UsersServiceDbus *  self,
AccountsUser *  user 
)

users_service_dbus_activate_user_session:

Activates a specific user.

Definition at line 958 of file users-service-dbus.c.

{
  g_return_if_fail (IS_USERS_SERVICE_DBUS(self));

  const char * const username = accounts_user_get_user_name (user);
  DisplayManagerSeat * dp = create_display_proxy (self);
  display_manager_seat_call_switch_to_user_sync (dp, username, "", NULL, NULL);
  g_clear_object (&dp);
}

Here is the call graph for this function:

Here is the caller graph for this function:

gboolean users_service_dbus_can_activate_session ( UsersServiceDbus *  self)

Definition at line 986 of file users-service-dbus.c.

{
  gboolean can_activate = FALSE;

  g_return_val_if_fail (IS_USERS_SERVICE_DBUS(self), can_activate);

  GError * error = NULL;
  console_kit_seat_call_can_activate_sessions_sync (self->priv->seat_proxy,
                                                    &can_activate,
                                                    NULL,
                                                    &error);
  if (error != NULL)
    {
      g_warning ("%s: %s", G_STRLOC, error->message);
      g_error_free (error);
    }

  return can_activate;
}

Here is the call graph for this function:

Here is the caller graph for this function:

GType users_service_dbus_get_type ( void  )
GList* users_service_dbus_get_user_list ( UsersServiceDbus *  self)

users_service_dbus_get_user_list:

Returns: (transfer container): a list of AccountsUser objects

Definition at line 915 of file users-service-dbus.c.

{
  g_return_val_if_fail(IS_USERS_SERVICE_DBUS(self), NULL);

  return g_hash_table_get_values (self->priv->users);
}

Here is the caller graph for this function:

gboolean users_service_dbus_guest_session_enabled ( UsersServiceDbus *  self)

users_service_dbus_guest_session_enabled:

Tells whether or not guest sessions are allowed.

Definition at line 975 of file users-service-dbus.c.

{
  g_return_val_if_fail(IS_USERS_SERVICE_DBUS(self), FALSE);

  DisplayManagerSeat * dp = create_display_proxy (self);
  const gboolean enabled = display_manager_seat_get_has_guest_account (dp);
  g_clear_object (&dp);
  return enabled;
}

Here is the call graph for this function:

Here is the caller graph for this function:

gboolean users_service_dbus_is_guest_logged_in ( UsersServiceDbus *  self)

Definition at line 1007 of file users-service-dbus.c.

{
  g_return_val_if_fail (IS_USERS_SERVICE_DBUS(self), FALSE);

  return self->priv->guest_ssid != NULL;
}

Here is the caller graph for this function:

gboolean users_service_dbus_is_user_logged_in ( UsersServiceDbus *  self,
AccountsUser *  user 
)

Definition at line 1015 of file users-service-dbus.c.

{
  g_return_val_if_fail (IS_USERS_SERVICE_DBUS(self), FALSE);
  g_return_val_if_fail (IS_ACCOUNTS_USER(user), FALSE);

  return user_count_sessions (user) > 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void users_service_dbus_show_greeter ( UsersServiceDbus *  self)

users_service_dbus_show_greeter:

Ask the Display Mnaager to switch to the greeter screen.

Definition at line 928 of file users-service-dbus.c.

{
  g_return_if_fail (IS_USERS_SERVICE_DBUS(self));

  DisplayManagerSeat * dp = create_display_proxy (self);
  display_manager_seat_call_switch_to_greeter_sync (dp, NULL, NULL);
  g_clear_object (&dp);
}

Here is the call graph for this function:

Here is the caller graph for this function: