Back to index

lightdm  1.3.2
Classes | Defines | Typedefs | Functions
seat.h File Reference
#include <glib-object.h>
#include "display.h"
#include "process.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Seat
struct  SeatClass

Defines

#define SEAT_TYPE   (seat_get_type())
#define SEAT(obj)   (G_TYPE_CHECK_INSTANCE_CAST ((obj), SEAT_TYPE, Seat))
#define SEAT_CLASS(klass)   (G_TYPE_CHECK_CLASS_CAST ((klass), SEAT_TYPE, SeatClass))
#define SEAT_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), SEAT_TYPE, SeatClass))

Typedefs

typedef struct SeatPrivate

Functions

GType seat_get_type (void)
void seat_register_module (const gchar *name, GType type)
Seatseat_new (const gchar *module_name)
void seat_set_property (Seat *seat, const gchar *name, const gchar *value)
gboolean seat_has_property (Seat *seat, const gchar *name)
const gchar * seat_get_string_property (Seat *seat, const gchar *name)
gboolean seat_get_boolean_property (Seat *seat, const gchar *name)
gint seat_get_integer_property (Seat *seat, const gchar *name)
void seat_set_can_switch (Seat *seat, gboolean can_switch)
gboolean seat_start (Seat *seat)
GList * seat_get_displays (Seat *seat)
void seat_set_active_display (Seat *seat, Display *display)
Displayseat_get_active_display (Seat *seat)
gboolean seat_get_can_switch (Seat *seat)
gboolean seat_get_allow_guest (Seat *seat)
gboolean seat_get_greeter_allow_guest (Seat *seat)
gboolean seat_switch_to_greeter (Seat *seat)
gboolean seat_switch_to_user (Seat *seat, const gchar *username, const gchar *session_name)
gboolean seat_switch_to_guest (Seat *seat, const gchar *session_name)
gboolean seat_lock (Seat *seat, const gchar *username)
void seat_stop (Seat *seat)
gboolean seat_get_is_stopping (Seat *seat)

Class Documentation

struct Seat

Definition at line 28 of file seat.h.

Collaboration diagram for Seat:
Class Members
GObject parent_instance
SeatPrivate * priv

Define Documentation

#define SEAT (   obj)    (G_TYPE_CHECK_INSTANCE_CAST ((obj), SEAT_TYPE, Seat))

Definition at line 22 of file seat.h.

#define SEAT_CLASS (   klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), SEAT_TYPE, SeatClass))

Definition at line 23 of file seat.h.

#define SEAT_GET_CLASS (   obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), SEAT_TYPE, SeatClass))

Definition at line 24 of file seat.h.

#define SEAT_TYPE   (seat_get_type())

Definition at line 21 of file seat.h.


Typedef Documentation

typedef struct SeatPrivate

Definition at line 26 of file seat.h.


Function Documentation

Definition at line 162 of file seat.c.

{
    g_return_val_if_fail (seat != NULL, NULL);
    return seat->priv->active_display;
}

Here is the caller graph for this function:

gboolean seat_get_allow_guest ( Seat seat)

Definition at line 176 of file seat.c.

{
    g_return_val_if_fail (seat != NULL, FALSE);  
    return seat_get_boolean_property (seat, "allow-guest") && guest_account_is_installed ();
}

Here is the call graph for this function:

Here is the caller graph for this function:

gboolean seat_get_boolean_property ( Seat seat,
const gchar *  name 
)

Definition at line 116 of file seat.c.

{
    return g_strcmp0 (seat_get_string_property (seat, name), "true") == 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

gboolean seat_get_can_switch ( Seat seat)

Definition at line 169 of file seat.c.

{
    g_return_val_if_fail (seat != NULL, FALSE);
    return seat->priv->can_switch;
}

Here is the caller graph for this function:

GList* seat_get_displays ( Seat seat)

Definition at line 148 of file seat.c.

{
    g_return_val_if_fail (seat != NULL, NULL);
    return seat->priv->displays;
}

Here is the caller graph for this function:

gboolean seat_get_greeter_allow_guest ( Seat seat)

Definition at line 183 of file seat.c.

{
    g_return_val_if_fail (seat != NULL, FALSE);  
    return seat_get_allow_guest (seat) && seat_get_boolean_property (seat, "greeter-allow-guest");
}

Here is the call graph for this function:

Here is the caller graph for this function:

gint seat_get_integer_property ( Seat seat,
const gchar *  name 
)

Definition at line 122 of file seat.c.

{
    const gchar *value;

    value = seat_get_string_property (seat, name);
    return value ? atoi (value) : 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

gboolean seat_get_is_stopping ( Seat seat)

Definition at line 577 of file seat.c.

{
    g_return_val_if_fail (seat != NULL, FALSE);
    return seat->priv->stopping;
}

Here is the caller graph for this function:

const gchar* seat_get_string_property ( Seat seat,
const gchar *  name 
)

Definition at line 109 of file seat.c.

{
    g_return_val_if_fail (seat != NULL, NULL);
    return g_hash_table_lookup (seat->priv->properties, name);
}

Here is the caller graph for this function:

GType seat_get_type ( void  )
gboolean seat_has_property ( Seat seat,
const gchar *  name 
)

Definition at line 102 of file seat.c.

{
    g_return_val_if_fail (seat != NULL, FALSE);
    return g_hash_table_lookup (seat->priv->properties, name) != NULL;
}
gboolean seat_lock ( Seat seat,
const gchar *  username 
)

Definition at line 552 of file seat.c.

{
    g_return_val_if_fail (seat != NULL, FALSE);

    if (!seat->priv->can_switch)
        return FALSE;

    g_debug ("Locking seat");
    return switch_to_user_or_start_greeter (seat, username, FALSE, FALSE, NULL, TRUE, FALSE);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Seat* seat_new ( const gchar *  module_name)

Definition at line 77 of file seat.c.

{
    Seat *seat;
    SeatModule *m = NULL;
  
    g_return_val_if_fail (module_name != NULL, NULL);

    if (seat_modules)
        m = g_hash_table_lookup (seat_modules, module_name);
    if (!m)
        return NULL;

    seat = g_object_new (m->type, NULL);

    return seat;
}

Here is the caller graph for this function:

void seat_register_module ( const gchar *  name,
GType  type 
)

Definition at line 61 of file seat.c.

{
    SeatModule *module;

    if (!seat_modules)
        seat_modules = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);

    g_debug ("Registered seat module %s", name);

    module = g_malloc0 (sizeof (SeatModule));
    module->name = g_strdup (name);
    module->type = type;
    g_hash_table_insert (seat_modules, g_strdup (name), module);
}

Here is the caller graph for this function:

void seat_set_active_display ( Seat seat,
Display display 
)

Definition at line 155 of file seat.c.

{
    g_return_if_fail (seat != NULL);
    SEAT_GET_CLASS (seat)->set_active_display (seat, display);
}

Here is the caller graph for this function:

void seat_set_can_switch ( Seat seat,
gboolean  can_switch 
)

Definition at line 131 of file seat.c.

{
    g_return_if_fail (seat != NULL);

    seat->priv->can_switch = can_switch;
}

Here is the caller graph for this function:

void seat_set_property ( Seat seat,
const gchar *  name,
const gchar *  value 
)

Definition at line 95 of file seat.c.

{
    g_return_if_fail (seat != NULL);
    g_hash_table_insert (seat->priv->properties, g_strdup (name), g_strdup (value));
}

Here is the caller graph for this function:

gboolean seat_start ( Seat seat)

Definition at line 139 of file seat.c.

{
    g_return_val_if_fail (seat != NULL, FALSE);
  
    SEAT_GET_CLASS (seat)->setup (seat);
    return SEAT_GET_CLASS (seat)->start (seat);
}

Here is the caller graph for this function:

void seat_stop ( Seat seat)

Definition at line 564 of file seat.c.

{
    g_return_if_fail (seat != NULL);

    if (seat->priv->stopping)
        return;

    g_debug ("Stopping seat");
    seat->priv->stopping = TRUE;
    SEAT_GET_CLASS (seat)->stop (seat);
}

Here is the caller graph for this function:

gboolean seat_switch_to_greeter ( Seat seat)

Definition at line 512 of file seat.c.

{
    g_return_val_if_fail (seat != NULL, FALSE);

    if (!seat->priv->can_switch)
        return FALSE;

    g_debug ("Switching to greeter");
    return switch_to_user_or_start_greeter (seat, NULL, TRUE, FALSE, NULL, FALSE, FALSE);
}

Here is the call graph for this function:

Here is the caller graph for this function:

gboolean seat_switch_to_guest ( Seat seat,
const gchar *  session_name 
)

Definition at line 537 of file seat.c.

{
    g_return_val_if_fail (seat != NULL, FALSE);

    if (!seat->priv->can_switch || !seat_get_allow_guest (seat))
        return FALSE;

    if (seat->priv->guest_username)
        g_debug ("Switching to existing guest account %s", seat->priv->guest_username);
    else
        g_debug ("Switching to new guest account");
    return switch_to_user_or_start_greeter (seat, seat->priv->guest_username, TRUE, TRUE, session_name, FALSE, TRUE);
}

Here is the call graph for this function:

Here is the caller graph for this function:

gboolean seat_switch_to_user ( Seat seat,
const gchar *  username,
const gchar *  session_name 
)

Definition at line 524 of file seat.c.

{
    g_return_val_if_fail (seat != NULL, FALSE);
    g_return_val_if_fail (username != NULL, FALSE);

    if (!seat->priv->can_switch)
        return FALSE;

    g_debug ("Switching to user %s", username);
    return switch_to_user_or_start_greeter (seat, username, TRUE, FALSE, session_name, FALSE, FALSE);
}

Here is the call graph for this function:

Here is the caller graph for this function: