Commit ef9a787a authored by William Jon McCann's avatar William Jon McCann Committed by William Jon McCann

Remove libgreeter stuff.

2007-10-24  William Jon McCann  <mccann@jhu.edu>

	* Makefile.am:
	* configure.ac:
	* gui/simple-greeter/Makefile.am:
	* libgreeter/Makefile.am:
	* libgreeter/gdm-greeter.c:
	* libgreeter/gdm-greeter.h:
	Remove libgreeter stuff.


svn path=/trunk/; revision=5403
parent e8a8121e
2007-10-24 William Jon McCann <mccann@jhu.edu>
* Makefile.am:
* configure.ac:
* gui/simple-greeter/Makefile.am:
* libgreeter/Makefile.am:
* libgreeter/gdm-greeter.c:
* libgreeter/gdm-greeter.h:
Remove libgreeter stuff.
2007-10-24 William Jon McCann <mccann@jhu.edu>
* configure.ac:
......
......@@ -5,7 +5,6 @@ SUBDIRS = \
config \
common \
daemon \
libgreeter \
gui \
utils \
po \
......
......@@ -1278,7 +1278,6 @@ AC_DEFINE_UNQUOTED(X_XNEST_UNSCALED_FONTPATH,"$X_XNEST_UNSCALED_FONTPATH")
AC_OUTPUT([
Makefile
daemon/Makefile
libgreeter/Makefile
gui/Makefile
gui/simple-greeter/Makefile
gui/simple-greeter/libnotificationarea/Makefile
......
......@@ -6,7 +6,6 @@ SUBDIRS = \
INCLUDES = \
-I$(top_srcdir)/common \
-I$(top_srcdir)/libgreeter \
-I$(top_srcdir)/gui/simple-greeter/libnotificationarea \
-DDMCONFDIR=\""$(dmconfdir)"\" \
-DGDMCONFDIR=\"$(gdmconfdir)\" \
......@@ -153,8 +152,6 @@ gdm_simple_greeter_SOURCES = \
gdm_simple_greeter_LDADD = \
$(EXTRA_GREETER_LIBS) \
-L$(top_builddir)/libgreeter \
-lgreeter \
$(top_builddir)/gui/simple-greeter/libnotificationarea/libnotificationarea.la \
$(SIMPLE_GREETER_LIBS) \
$(NULL)
......
NULL =
noinst_LTLIBRARIES = libgreeter.la
libgreeter_la_SOURCES = \
gdm-greeter.c \
gdm-greeter.h \
$(NULL)
libgreeter_la_CPPFLAGS = \
$(WARN_CFLAGS) \
$(DISABLE_DEPRECATED_CFLAGS) \
$(NULL)
libgreeter_la_CFLAGS = \
$(GREETER_CFLAGS) \
-I$(top_srcdir)/common/ \
$(NULL)
libgreeter_la_LIBADD = \
$(top_builddir)/common/libgdmcommon.la \
$(NULL)
libgreeter_la_LDFLAGS = \
-export-dynamic \
$(NULL)
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright (C) 2007 William Jon McCann <mccann@jhu.edu>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <signal.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <glib.h>
#include <glib/gi18n.h>
#include <glib-object.h>
#define DBUS_API_SUBJECT_TO_CHANGE
#include <dbus/dbus-glib.h>
#include <dbus/dbus-glib-lowlevel.h>
#include "gdm-greeter.h"
#define GDM_GREETER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GDM_TYPE_GREETER, GdmGreeterPrivate))
#define GDM_DBUS_NAME "org.gnome.DisplayManager"
#define GDM_DBUS_DISPLAY_INTERFACE "org.gnome.DisplayManager.Display"
struct GdmGreeterPrivate
{
char *display_id;
gboolean display_is_local;
};
enum {
PROP_0,
PROP_DISPLAY_ID,
};
enum {
BEGIN_VERIFICATION,
QUERY_ANSWER,
SESSION_SELECTED,
LANGUAGE_SELECTED,
USER_SELECTED,
HOSTNAME_SELECTED,
DISCONNECTED,
CANCELLED,
LAST_SIGNAL
};
static guint signals [LAST_SIGNAL] = { 0, };
static void gdm_greeter_class_init (GdmGreeterClass *klass);
static void gdm_greeter_init (GdmGreeter *greeter);
static void gdm_greeter_finalize (GObject *object);
G_DEFINE_ABSTRACT_TYPE (GdmGreeter, gdm_greeter, G_TYPE_OBJECT)
GQuark
gdm_greeter_error_quark (void)
{
static GQuark ret = 0;
if (ret == 0) {
ret = g_quark_from_static_string ("gdm_greeter_error");
}
return ret;
}
gboolean
gdm_greeter_display_is_local (GdmGreeter *greeter)
{
g_return_val_if_fail (GDM_IS_GREETER (greeter), FALSE);
return greeter->priv->display_is_local;
}
static gboolean
gdm_greeter_real_start (GdmGreeter *greeter)
{
g_return_val_if_fail (GDM_IS_GREETER (greeter), FALSE);
return TRUE;
}
gboolean
gdm_greeter_start (GdmGreeter *greeter)
{
gboolean ret;
g_return_val_if_fail (GDM_IS_GREETER (greeter), FALSE);
g_object_ref (greeter);
ret = GDM_GREETER_GET_CLASS (greeter)->start (greeter);
g_object_unref (greeter);
return ret;
}
static gboolean
gdm_greeter_real_stop (GdmGreeter *greeter)
{
g_return_val_if_fail (GDM_IS_GREETER (greeter), FALSE);
return TRUE;
}
gboolean
gdm_greeter_stop (GdmGreeter *greeter)
{
gboolean ret;
g_return_val_if_fail (GDM_IS_GREETER (greeter), FALSE);
g_object_ref (greeter);
ret = GDM_GREETER_GET_CLASS (greeter)->stop (greeter);
g_object_unref (greeter);
return ret;
}
static gboolean
gdm_greeter_real_ready (GdmGreeter *greeter)
{
g_return_val_if_fail (GDM_IS_GREETER (greeter), FALSE);
return TRUE;
}
static gboolean
gdm_greeter_real_reset (GdmGreeter *greeter)
{
g_return_val_if_fail (GDM_IS_GREETER (greeter), FALSE);
return TRUE;
}
gboolean
gdm_greeter_ready (GdmGreeter *greeter)
{
gboolean ret;
g_return_val_if_fail (GDM_IS_GREETER (greeter), FALSE);
g_object_ref (greeter);
ret = GDM_GREETER_GET_CLASS (greeter)->ready (greeter);
g_object_unref (greeter);
return ret;
}
gboolean
gdm_greeter_reset (GdmGreeter *greeter)
{
gboolean ret;
g_return_val_if_fail (GDM_IS_GREETER (greeter), FALSE);
g_object_ref (greeter);
ret = GDM_GREETER_GET_CLASS (greeter)->reset (greeter);
g_object_unref (greeter);
return ret;
}
static gboolean
gdm_greeter_real_info (GdmGreeter *greeter,
const char *text)
{
g_return_val_if_fail (GDM_IS_GREETER (greeter), FALSE);
return TRUE;
}
gboolean
gdm_greeter_info (GdmGreeter *greeter,
const char *text)
{
gboolean ret;
g_return_val_if_fail (GDM_IS_GREETER (greeter), FALSE);
g_object_ref (greeter);
ret = GDM_GREETER_GET_CLASS (greeter)->info (greeter, text);
g_object_unref (greeter);
return ret;
}
static gboolean
gdm_greeter_real_problem (GdmGreeter *greeter,
const char *text)
{
g_return_val_if_fail (GDM_IS_GREETER (greeter), FALSE);
return TRUE;
}
gboolean
gdm_greeter_problem (GdmGreeter *greeter,
const char *text)
{
gboolean ret;
g_return_val_if_fail (GDM_IS_GREETER (greeter), FALSE);
g_object_ref (greeter);
ret = GDM_GREETER_GET_CLASS (greeter)->problem (greeter, text);
g_object_unref (greeter);
return ret;
}
static gboolean
gdm_greeter_real_info_query (GdmGreeter *greeter,
const char *text)
{
g_return_val_if_fail (GDM_IS_GREETER (greeter), FALSE);
return TRUE;
}
gboolean
gdm_greeter_info_query (GdmGreeter *greeter,
const char *text)
{
gboolean ret;
g_return_val_if_fail (GDM_IS_GREETER (greeter), FALSE);
g_object_ref (greeter);
ret = GDM_GREETER_GET_CLASS (greeter)->info_query (greeter, text);
g_object_unref (greeter);
return ret;
}
static gboolean
gdm_greeter_real_secret_info_query (GdmGreeter *greeter,
const char *text)
{
g_return_val_if_fail (GDM_IS_GREETER (greeter), FALSE);
return TRUE;
}
gboolean
gdm_greeter_secret_info_query (GdmGreeter *greeter,
const char *text)
{
gboolean ret;
g_return_val_if_fail (GDM_IS_GREETER (greeter), FALSE);
g_object_ref (greeter);
ret = GDM_GREETER_GET_CLASS (greeter)->secret_info_query (greeter, text);
g_object_unref (greeter);
return ret;
}
gboolean
gdm_greeter_emit_begin_verification (GdmGreeter *greeter,
const char *username)
{
g_return_val_if_fail (GDM_IS_GREETER (greeter), FALSE);
g_debug ("Begin Verification: %s", username);
g_signal_emit (greeter, signals[BEGIN_VERIFICATION], 0, username);
return TRUE;
}
gboolean
gdm_greeter_emit_answer_query (GdmGreeter *greeter,
const char *text)
{
g_return_val_if_fail (GDM_IS_GREETER (greeter), FALSE);
g_debug ("Answer query");
g_signal_emit (greeter, signals[QUERY_ANSWER], 0, text);
return TRUE;
}
gboolean
gdm_greeter_emit_select_session (GdmGreeter *greeter,
const char *text)
{
g_return_val_if_fail (GDM_IS_GREETER (greeter), FALSE);
g_debug ("Select session: %s", text);
g_signal_emit (greeter, signals[SESSION_SELECTED], 0, text);
return TRUE;
}
gboolean
gdm_greeter_emit_select_language (GdmGreeter *greeter,
const char *text)
{
g_return_val_if_fail (GDM_IS_GREETER (greeter), FALSE);
g_debug ("Select language: %s", text);
g_signal_emit (greeter, signals[LANGUAGE_SELECTED], 0, text);
return TRUE;
}
gboolean
gdm_greeter_emit_select_user (GdmGreeter *greeter,
const char *text)
{
g_return_val_if_fail (GDM_IS_GREETER (greeter), FALSE);
g_debug ("Select user: %s", text);
g_signal_emit (greeter, signals[USER_SELECTED], 0, text);
return TRUE;
}
gboolean
gdm_greeter_emit_cancelled (GdmGreeter *greeter)
{
g_return_val_if_fail (GDM_IS_GREETER (greeter), FALSE);
g_debug ("Cancelled");
g_signal_emit (greeter, signals[CANCELLED], 0);
return TRUE;
}
gboolean
gdm_greeter_emit_disconnected (GdmGreeter *greeter)
{
g_return_val_if_fail (GDM_IS_GREETER (greeter), FALSE);
g_debug ("Disconnected");
g_signal_emit (greeter, signals[DISCONNECTED], 0);
return TRUE;
}
static void
_gdm_greeter_set_display_id (GdmGreeter *greeter,
const char *id)
{
g_free (greeter->priv->display_id);
greeter->priv->display_id = g_strdup (id);
}
static void
gdm_greeter_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
GdmGreeter *self;
self = GDM_GREETER (object);
switch (prop_id) {
case PROP_DISPLAY_ID:
_gdm_greeter_set_display_id (self, g_value_get_string (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
gdm_greeter_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
GdmGreeter *self;
self = GDM_GREETER (object);
switch (prop_id) {
case PROP_DISPLAY_ID:
g_value_set_string (value, self->priv->display_id);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
cache_display_values (GdmGreeter *greeter)
{
DBusGProxy *display_proxy;
DBusGConnection *connection;
GError *error;
gboolean res;
error = NULL;
connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error);
if (connection == NULL) {
if (error != NULL) {
g_critical ("error getting system bus: %s", error->message);
g_error_free (error);
}
exit (1);
}
g_debug ("Creating proxy for %s", greeter->priv->display_id);
display_proxy = dbus_g_proxy_new_for_name (connection,
GDM_DBUS_NAME,
greeter->priv->display_id,
GDM_DBUS_DISPLAY_INTERFACE);
/* cache some values up front */
error = NULL;
res = dbus_g_proxy_call (display_proxy,
"IsLocal",
&error,
G_TYPE_INVALID,
G_TYPE_BOOLEAN, &greeter->priv->display_is_local,
G_TYPE_INVALID);
if (! res) {
if (error != NULL) {
g_warning ("Failed to get value: %s", error->message);
g_error_free (error);
} else {
g_warning ("Failed to get value");
}
}
}
static GObject *
gdm_greeter_constructor (GType type,
guint n_construct_properties,
GObjectConstructParam *construct_properties)
{
GdmGreeter *greeter;
GdmGreeterClass *klass;
klass = GDM_GREETER_CLASS (g_type_class_peek (GDM_TYPE_GREETER));
greeter = GDM_GREETER (G_OBJECT_CLASS (gdm_greeter_parent_class)->constructor (type,
n_construct_properties,
construct_properties));
cache_display_values (greeter);
return G_OBJECT (greeter);
}
static void
gdm_greeter_dispose (GObject *object)
{
GdmGreeter *greeter;
greeter = GDM_GREETER (object);
g_debug ("Disposing greeter");
gdm_greeter_stop (greeter);
G_OBJECT_CLASS (gdm_greeter_parent_class)->dispose (object);
}
static void
gdm_greeter_class_init (GdmGreeterClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->get_property = gdm_greeter_get_property;
object_class->set_property = gdm_greeter_set_property;
object_class->constructor = gdm_greeter_constructor;
object_class->dispose = gdm_greeter_dispose;
object_class->finalize = gdm_greeter_finalize;
klass->start = gdm_greeter_real_start;
klass->stop = gdm_greeter_real_stop;
klass->ready = gdm_greeter_real_ready;
klass->reset = gdm_greeter_real_reset;
klass->info = gdm_greeter_real_info;
klass->problem = gdm_greeter_real_problem;
klass->info_query = gdm_greeter_real_info_query;
klass->secret_info_query = gdm_greeter_real_secret_info_query;
signals [BEGIN_VERIFICATION] =
g_signal_new ("begin-verification",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GdmGreeterClass, begin_verification),
NULL,
NULL,
g_cclosure_marshal_VOID__STRING,
G_TYPE_NONE,
1, G_TYPE_STRING);
signals [QUERY_ANSWER] =
g_signal_new ("query-answer",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GdmGreeterClass, query_answer),
NULL,
NULL,
g_cclosure_marshal_VOID__STRING,
G_TYPE_NONE,
1, G_TYPE_STRING);
signals [LANGUAGE_SELECTED] =
g_signal_new ("language-selected",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GdmGreeterClass, language_selected),
NULL,
NULL,
g_cclosure_marshal_VOID__STRING,
G_TYPE_NONE,
1, G_TYPE_STRING);
signals [USER_SELECTED] =
g_signal_new ("user-selected",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GdmGreeterClass, user_selected),
NULL,
NULL,
g_cclosure_marshal_VOID__STRING,
G_TYPE_NONE,
1, G_TYPE_STRING);
signals [SESSION_SELECTED] =
g_signal_new ("session-selected",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GdmGreeterClass, session_selected),
NULL,
NULL,
g_cclosure_marshal_VOID__STRING,
G_TYPE_NONE,
1, G_TYPE_STRING);
signals [HOSTNAME_SELECTED] =
g_signal_new ("hostname-selected",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GdmGreeterClass, hostname_selected),
NULL,
NULL,
g_cclosure_marshal_VOID__STRING,
G_TYPE_NONE,
1, G_TYPE_STRING);
signals [CANCELLED] =
g_signal_new ("cancelled",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GdmGreeterClass, cancelled),
NULL,
NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE,
0);
signals [DISCONNECTED] =
g_signal_new ("disconnected",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GdmGreeterClass, disconnected),
NULL,
NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE,
0);
g_object_class_install_property (object_class,
PROP_DISPLAY_ID,
g_param_spec_string ("display-id",
"id",
"id",
NULL,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
g_type_class_add_private (klass, sizeof (GdmGreeterPrivate));
}
static void
gdm_greeter_init (GdmGreeter *greeter)
{
greeter->priv = GDM_GREETER_GET_PRIVATE (greeter);
}
static void
gdm_greeter_finalize (GObject *object)
{
GdmGreeter *greeter;
g_return_if_fail (object != NULL);
g_return_if_fail (GDM_IS_GREETER (object));
greeter = GDM_GREETER (object);
g_return_if_fail (greeter->priv != NULL);
g_free (greeter->priv->display_id);
G_OBJECT_CLASS (gdm_greeter_parent_class)->finalize (object);
}
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright (C) 2007 William Jon McCann <mccann@jhu.edu>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
#ifndef __GDM_GREETER_H
#define __GDM_GREETER_H
#include <glib-object.h>
G_BEGIN_DECLS
#define GDM_TYPE_GREETER (gdm_greeter_get_type ())
#define GDM_GREETER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDM_TYPE_GREETER, GdmGreeter))
#define GDM_GREETER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDM_TYPE_GREETER, GdmGreeterClass))
#define GDM_IS_GREETER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDM_TYPE_GREETER))
#define GDM_IS_GREETER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDM_TYPE_GREETER))
#define GDM_GREETER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDM_TYPE_GREETER, GdmGreeterClass))
typedef struct GdmGreeterPrivate GdmGreeterPrivate;
typedef struct
{
GObject parent;
GdmGreeterPrivate *priv;
} GdmGreeter;
typedef struct
{
GObjectClass parent_class;
/* signals */
void (* begin_verification) (GdmGreeter *greeter,
const char *username);
void (* query_answer) (GdmGreeter *greeter,