Back to index

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

Go to the source code of this file.

Classes

struct  VNCServer
struct  VNCServerClass

Defines

#define VNC_SERVER_TYPE   (vnc_server_get_type())
#define VNC_SERVER(obj)   (G_TYPE_CHECK_INSTANCE_CAST ((obj), VNC_SERVER_TYPE, VNCServer));

Typedefs

typedef struct VNCServerPrivate

Functions

GType vnc_server_get_type (void)
VNCServervnc_server_new (void)
void vnc_server_set_port (VNCServer *server, guint port)
guint vnc_server_get_port (VNCServer *server)
gboolean vnc_server_start (VNCServer *server)

Class Documentation

struct VNCServer

Definition at line 24 of file vnc-server.h.

Collaboration diagram for VNCServer:
Class Members
GObject parent_instance
VNCServerPrivate * priv

Define Documentation

#define VNC_SERVER (   obj)    (G_TYPE_CHECK_INSTANCE_CAST ((obj), VNC_SERVER_TYPE, VNCServer));

Definition at line 20 of file vnc-server.h.

Definition at line 19 of file vnc-server.h.


Typedef Documentation

typedef struct VNCServerPrivate

Definition at line 22 of file vnc-server.h.


Function Documentation

guint vnc_server_get_port ( VNCServer server)

Definition at line 47 of file vnc-server.c.

{
    g_return_val_if_fail (server != NULL, 0);
    return server->priv->port;
}

Here is the caller graph for this function:

GType vnc_server_get_type ( void  )

Definition at line 34 of file vnc-server.c.

{
    return g_object_new (VNC_SERVER_TYPE, NULL);
}

Here is the caller graph for this function:

void vnc_server_set_port ( VNCServer server,
guint  port 
)

Definition at line 40 of file vnc-server.c.

{
    g_return_if_fail (server != NULL);
    server->priv->port = port;
}

Here is the caller graph for this function:

gboolean vnc_server_start ( VNCServer server)

Definition at line 102 of file vnc-server.c.

{
    GSource *source;
    GError *error = NULL;

    g_return_val_if_fail (server != NULL, FALSE);
  
    server->priv->socket = open_tcp_socket (G_SOCKET_FAMILY_IPV4, server->priv->port, &error);
    if (error)
        g_warning ("Failed to create IPv4 VNC socket: %s", error->message);
    g_clear_error (&error);
  
    if (server->priv->socket)
    {
        source = g_socket_create_source (server->priv->socket, G_IO_IN, NULL);
        g_source_set_callback (source, (GSourceFunc) read_cb, server, NULL);
        g_source_attach (source, NULL);
    }
    
    server->priv->socket6 = open_tcp_socket (G_SOCKET_FAMILY_IPV6, server->priv->port, &error);
    if (error)
        g_warning ("Failed to create IPv6 VNC socket: %s", error->message);
    g_clear_error (&error);

    if (server->priv->socket6)
    {
        source = g_socket_create_source (server->priv->socket6, G_IO_IN, NULL);
        g_source_set_callback (source, (GSourceFunc) read_cb, server, NULL);
        g_source_attach (source, NULL);
    }

    if (!server->priv->socket && !server->priv->socket6)
        return FALSE;

    return TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function: