Back to index

lightdm  1.3.2
Classes | Functions
seat-xvnc.c File Reference
#include "seat-xvnc.h"
#include "xserver-xvnc.h"
#include "xsession.h"
#include "configuration.h"

Go to the source code of this file.

Classes

struct  SeatXVNCPrivate

Functions

 G_DEFINE_TYPE (SeatXVNC, seat_xvnc, SEAT_TYPE)
SeatXVNCseat_xvnc_new (GSocket *connection)
static DisplayServerseat_xvnc_create_display_server (Seat *seat)
static Sessionseat_xvnc_create_session (Seat *seat, Display *display)
static void seat_xvnc_run_script (Seat *seat, Display *display, Process *script)
static void seat_xvnc_display_removed (Seat *seat, Display *display)
static void seat_xvnc_init (SeatXVNC *seat)
static void seat_xdmcp_session_finalize (GObject *object)
static void seat_xvnc_class_init (SeatXVNCClass *klass)

Class Documentation

struct SeatXVNCPrivate

Definition at line 19 of file seat-xvnc.c.

Class Members
GSocket * connection

Function Documentation

G_DEFINE_TYPE ( SeatXVNC  ,
seat_xvnc  ,
SEAT_TYPE   
)
static void seat_xdmcp_session_finalize ( GObject *  object) [static]

Definition at line 119 of file seat-xvnc.c.

{
    SeatXVNC *self;

    self = SEAT_XVNC (object);

    g_object_unref (self->priv->connection);

    G_OBJECT_CLASS (seat_xvnc_parent_class)->finalize (object);
}

Here is the caller graph for this function:

static void seat_xvnc_class_init ( SeatXVNCClass klass) [static]

Definition at line 131 of file seat-xvnc.c.

{
    SeatClass *seat_class = SEAT_CLASS (klass);
    GObjectClass *object_class = G_OBJECT_CLASS (klass);

    seat_class->create_display_server = seat_xvnc_create_display_server;
    seat_class->create_session = seat_xvnc_create_session;
    seat_class->run_script = seat_xvnc_run_script;
    seat_class->display_removed = seat_xvnc_display_removed;
    object_class->finalize = seat_xdmcp_session_finalize;

    g_type_class_add_private (klass, sizeof (SeatXVNCPrivate));
}

Here is the call graph for this function:

static DisplayServer* seat_xvnc_create_display_server ( Seat seat) [static]

Definition at line 36 of file seat-xvnc.c.

{
    XServerXVNC *xserver;

    xserver = xserver_xvnc_new ();
    xserver_xvnc_set_socket (xserver, g_socket_get_fd (SEAT_XVNC (seat)->priv->connection));

    if (config_has_key (config_get_instance (), "VNCServer", "width") &&
        config_has_key (config_get_instance (), "VNCServer", "height"))
    {
        gint width, height;
        width = config_get_integer (config_get_instance (), "VNCServer", "width");
        height = config_get_integer (config_get_instance (), "VNCServer", "height");
        if (height > 0 && width > 0)
            xserver_xvnc_set_geometry (xserver, width, height);
    }
    if (config_has_key (config_get_instance (), "VNCServer", "depth"))
    {
        gint depth;
        depth = config_get_integer (config_get_instance (), "VNCServer", "depth");
        if (depth == 8 || depth == 16 || depth == 24 || depth == 32)
            xserver_xvnc_set_depth (xserver, depth);
    }

    return DISPLAY_SERVER (xserver);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static Session* seat_xvnc_create_session ( Seat seat,
Display display 
) [static]

Definition at line 64 of file seat-xvnc.c.

{
    XServerXVNC *xserver;
    XSession *session;
    GInetSocketAddress *address;
    gchar *hostname;

    xserver = XSERVER_XVNC (display_get_display_server (display));

    session = xsession_new (XSERVER (xserver));
    address = G_INET_SOCKET_ADDRESS (g_socket_get_remote_address (SEAT_XVNC (seat)->priv->connection, NULL));
    hostname = g_inet_address_to_string (g_inet_socket_address_get_address (address));
    session_set_remote_host_name (SESSION (session), hostname);
    g_free (hostname);

    return SESSION (session);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void seat_xvnc_display_removed ( Seat seat,
Display display 
) [static]

Definition at line 107 of file seat-xvnc.c.

{
    seat_stop (seat);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void seat_xvnc_init ( SeatXVNC seat) [static]

Definition at line 113 of file seat-xvnc.c.

{
    seat->priv = G_TYPE_INSTANCE_GET_PRIVATE (seat, SEAT_XVNC_TYPE, SeatXVNCPrivate);
}
SeatXVNC* seat_xvnc_new ( GSocket *  connection)

Definition at line 25 of file seat-xvnc.c.

{
    SeatXVNC *seat;

    seat = g_object_new (SEAT_XVNC_TYPE, NULL);
    seat->priv->connection = g_object_ref (connection);

    return seat;
}

Here is the caller graph for this function:

static void seat_xvnc_run_script ( Seat seat,
Display display,
Process script 
) [static]

Definition at line 83 of file seat-xvnc.c.

{
    XServerXVNC *xserver;
    GInetSocketAddress *address;
    gchar *hostname;
    gchar *path;

    xserver = XSERVER_XVNC (display_get_display_server (display));

    address = G_INET_SOCKET_ADDRESS (g_socket_get_remote_address (SEAT_XVNC (seat)->priv->connection, NULL));
    hostname = g_inet_address_to_string (g_inet_socket_address_get_address (address));
    path = xserver_xvnc_get_authority_file_path (xserver);

    process_set_env (script, "REMOTE_HOST", hostname);
    process_set_env (script, "DISPLAY", xserver_get_address (XSERVER (xserver)));
    process_set_env (script, "XAUTHORITY", path);

    g_free (hostname);
    g_free (path);

    SEAT_CLASS (seat_xvnc_parent_class)->run_script (seat, display, script);
}

Here is the call graph for this function:

Here is the caller graph for this function: