summaryrefslogtreecommitdiff
path: root/src/display-server.c
diff options
context:
space:
mode:
authorRobert Ancell <robert.ancell@canonical.com>2011-09-16 12:10:21 +1000
committerRobert Ancell <robert.ancell@canonical.com>2011-09-16 12:10:21 +1000
commit9c0a1b73b6e99a24af52e7d716f22be2da8134c6 (patch)
tree60f3405fbcb09201d0727c3637c26e85c0287830 /src/display-server.c
parent1e21160c3bdbdd973dd58490e28cb178afd0eee4 (diff)
downloadlightdm-9c0a1b73b6e99a24af52e7d716f22be2da8134c6.tar.gz
Refactor X code out of display.c and seat.c. Drop obsolete GetSeatForCookie and GetSessionForCookie D-Bus calls
Diffstat (limited to 'src/display-server.c')
-rw-r--r--src/display-server.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/display-server.c b/src/display-server.c
index f856873a..0644aab3 100644
--- a/src/display-server.c
+++ b/src/display-server.c
@@ -20,8 +20,46 @@ enum {
};
static guint signals[LAST_SIGNAL] = { 0 };
+struct DisplayServerPrivate
+{
+ /* Unique name for this display server */
+ gchar *name;
+
+ /* TRUE if sessions should be automatically started on this display server */
+ gboolean start_local_sessions;
+};
+
G_DEFINE_TYPE (DisplayServer, display_server, G_TYPE_OBJECT);
+void
+display_server_set_name (DisplayServer *server, const gchar *name)
+{
+ g_return_if_fail (server != NULL);
+ g_free (server->priv->name);
+ server->priv->name = g_strdup (name);
+}
+
+const gchar *
+display_server_get_name (DisplayServer *server)
+{
+ g_return_val_if_fail (server != NULL, NULL);
+ return server->priv->name;
+}
+
+void
+display_server_set_start_local_sessions (DisplayServer *server, gboolean start_local_sessions)
+{
+ g_return_if_fail (server != NULL);
+ server->priv->start_local_sessions = start_local_sessions;
+}
+
+gboolean
+display_server_get_start_local_sessions (DisplayServer *server)
+{
+ g_return_val_if_fail (server != NULL, FALSE);
+ return server->priv->start_local_sessions;
+}
+
static gboolean
display_server_real_start (DisplayServer *server)
{
@@ -52,6 +90,8 @@ display_server_stop (DisplayServer *server)
static void
display_server_init (DisplayServer *server)
{
+ server->priv = G_TYPE_INSTANCE_GET_PRIVATE (server, DISPLAY_SERVER_TYPE, DisplayServerPrivate);
+ server->priv->start_local_sessions = TRUE;
}
static void
@@ -60,6 +100,8 @@ display_server_class_init (DisplayServerClass *klass)
klass->start = display_server_real_start;
klass->stop = display_server_real_stop;
+ g_type_class_add_private (klass, sizeof (DisplayServerPrivate));
+
signals[READY] =
g_signal_new ("ready",
G_TYPE_FROM_CLASS (klass),