source: proiecte/PPPP/gdm/daemon/gdm-chooser-session.c @ 134

Last change on this file since 134 was 134, checked in by (none), 14 years ago

gdm sources with the modifications for webcam

File size: 5.4 KB
Line 
1/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
2 *
3 * Copyright (C) 2008 William Jon McCann <jmccann@redhat.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 *
19 */
20
21#include "config.h"
22
23#include <stdlib.h>
24#include <stdio.h>
25#include <fcntl.h>
26#include <unistd.h>
27#include <string.h>
28#include <sys/types.h>
29#include <sys/wait.h>
30#include <errno.h>
31#include <ctype.h>
32#include <pwd.h>
33#include <grp.h>
34#include <signal.h>
35
36#include <glib.h>
37#include <glib/gi18n.h>
38#include <glib-object.h>
39
40#include "gdm-common.h"
41
42#include "gdm-welcome-session.h"
43#include "gdm-chooser-session.h"
44
45#define GDM_CHOOSER_SERVER_DBUS_PATH      "/org/gnome/DisplayManager/ChooserServer"
46#define GDM_CHOOSER_SERVER_DBUS_INTERFACE "org.gnome.DisplayManager.ChooserServer"
47
48#define GDM_CHOOSER_SESSION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GDM_TYPE_CHOOSER_SESSION, GdmChooserSessionPrivate))
49
50struct GdmChooserSessionPrivate
51{
52        gpointer dummy;
53};
54
55enum {
56        PROP_0,
57};
58
59static void     gdm_chooser_session_class_init    (GdmChooserSessionClass *klass);
60static void     gdm_chooser_session_init          (GdmChooserSession      *chooser_session);
61static void     gdm_chooser_session_finalize      (GObject                *object);
62
63G_DEFINE_TYPE (GdmChooserSession, gdm_chooser_session, GDM_TYPE_WELCOME_SESSION)
64
65static void
66gdm_chooser_session_set_property (GObject      *object,
67                                  guint         prop_id,
68                                  const GValue *value,
69                                  GParamSpec   *pspec)
70{
71        switch (prop_id) {
72        default:
73                G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
74                break;
75        }
76}
77
78static void
79gdm_chooser_session_get_property (GObject    *object,
80                                  guint       prop_id,
81                                  GValue     *value,
82                                  GParamSpec *pspec)
83{
84        switch (prop_id) {
85        default:
86                G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
87                break;
88        }
89}
90
91static GObject *
92gdm_chooser_session_constructor (GType                  type,
93                                 guint                  n_construct_properties,
94                                 GObjectConstructParam *construct_properties)
95{
96        GdmChooserSession      *chooser_session;
97
98        chooser_session = GDM_CHOOSER_SESSION (G_OBJECT_CLASS (gdm_chooser_session_parent_class)->constructor (type,
99                                                                                                               n_construct_properties,
100                                                                                                               construct_properties));
101
102        return G_OBJECT (chooser_session);
103}
104
105static void
106gdm_chooser_session_class_init (GdmChooserSessionClass *klass)
107{
108        GObjectClass    *object_class = G_OBJECT_CLASS (klass);
109
110        object_class->get_property = gdm_chooser_session_get_property;
111        object_class->set_property = gdm_chooser_session_set_property;
112        object_class->constructor = gdm_chooser_session_constructor;
113        object_class->finalize = gdm_chooser_session_finalize;
114
115        g_type_class_add_private (klass, sizeof (GdmChooserSessionPrivate));
116}
117
118static void
119gdm_chooser_session_init (GdmChooserSession *chooser_session)
120{
121
122        chooser_session->priv = GDM_CHOOSER_SESSION_GET_PRIVATE (chooser_session);
123}
124
125static void
126gdm_chooser_session_finalize (GObject *object)
127{
128        GdmChooserSession *chooser_session;
129
130        g_return_if_fail (object != NULL);
131        g_return_if_fail (GDM_IS_CHOOSER_SESSION (object));
132
133        chooser_session = GDM_CHOOSER_SESSION (object);
134
135        g_return_if_fail (chooser_session->priv != NULL);
136
137        G_OBJECT_CLASS (gdm_chooser_session_parent_class)->finalize (object);
138}
139
140GdmChooserSession *
141gdm_chooser_session_new (const char *display_name,
142                         const char *display_device,
143                         const char *display_hostname)
144{
145        GObject *object;
146
147        object = g_object_new (GDM_TYPE_CHOOSER_SESSION,
148                               "command", LIBEXECDIR "/gdm-simple-chooser",
149                               "server-dbus-path", GDM_CHOOSER_SERVER_DBUS_PATH,
150                               "server-dbus-interface", GDM_CHOOSER_SERVER_DBUS_INTERFACE,
151                               "server-env-var-name", "GDM_CHOOSER_DBUS_ADDRESS",
152                               "register-ck-session", FALSE,
153                               "x11-display-name", display_name,
154                               "x11-display-device", display_device,
155                               "x11-display-hostname", display_hostname,
156                               NULL);
157
158        return GDM_CHOOSER_SESSION (object);
159}
Note: See TracBrowser for help on using the repository browser.