Commit 001f7308 authored by William Jon McCann's avatar William Jon McCann Committed by William Jon McCann

Drop ServiceClient for now. Move MethodClient stuff into DBusClient.

2008-07-15  William Jon McCann  <jmccann@redhat.com>

	* gnome-session/Makefile.am:
	* gnome-session/gsm-dbus-client.c (gsm_dbus_client_new):
	* gnome-session/gsm-dbus-client.h:
	* gnome-session/gsm-manager.c (register_client_for_name),
	(gsm_manager_register_client):
	* gnome-session/gsm-method-client.c:
	* gnome-session/gsm-method-client.h:
	* gnome-session/gsm-service-client.c:
	* gnome-session/gsm-service-client.h:
	* gnome-session/test-client-method.c:
	Drop ServiceClient for now.  Move MethodClient stuff
	into DBusClient.


svn path=/branches/dbus_based/; revision=4802
parent 64e833b6
2008-07-15 William Jon McCann <jmccann@redhat.com>
* gnome-session/Makefile.am:
* gnome-session/gsm-dbus-client.c (gsm_dbus_client_new):
* gnome-session/gsm-dbus-client.h:
* gnome-session/gsm-manager.c (register_client_for_name),
(gsm_manager_register_client):
* gnome-session/gsm-method-client.c:
* gnome-session/gsm-method-client.h:
* gnome-session/gsm-service-client.c:
* gnome-session/gsm-service-client.h:
* gnome-session/test-client-method.c:
Drop ServiceClient for now. Move MethodClient stuff
into DBusClient.
2008-07-15 William Jon McCann <jmccann@redhat.com>
* gnome-session/gsm-dbus-client.c (dbus_client_stop),
......
......@@ -5,7 +5,7 @@ bin_PROGRAMS = gnome-session
noinst_LTLIBRARIES = libgsmutil.la
noinst_PROGRAMS = \
test-client-method \
test-client-dbus \
test-inhibit \
$(NULL)
......@@ -37,11 +37,11 @@ test_inhibit_LDADD = \
$(DBUS_GLIB_LIBS) \
$(NULL)
test_client_method_SOURCES = \
test-client-method.c \
test_client_dbus_SOURCES = \
test-client-dbus.c \
$(NULL)
test_client_method_LDADD = \
test_client_dbus_LDADD = \
$(DBUS_GLIB_LIBS) \
$(NULL)
......@@ -67,10 +67,6 @@ gnome_session_SOURCES = \
gsm-xsmp-client.c \
gsm-dbus-client.h \
gsm-dbus-client.c \
gsm-method-client.h \
gsm-method-client.c \
gsm-service-client.h \
gsm-service-client.c \
gsm-marshal.h \
gsm-marshal.c \
gsm-consolekit.c \
......
......@@ -50,7 +50,7 @@ enum {
PROP_BUS_NAME,
};
G_DEFINE_ABSTRACT_TYPE (GsmDBusClient, gsm_dbus_client, GSM_TYPE_CLIENT)
G_DEFINE_TYPE (GsmDBusClient, gsm_dbus_client, GSM_TYPE_CLIENT)
static GObject *
gsm_dbus_client_constructor (GType type,
......@@ -212,3 +212,17 @@ gsm_dbus_client_class_init (GsmDBusClientClass *klass)
g_type_class_add_private (klass, sizeof (GsmDBusClientPrivate));
}
GsmClient *
gsm_dbus_client_new (const char *client_id,
const char *bus_name)
{
GsmDBusClient *client;
client = g_object_new (GSM_TYPE_DBUS_CLIENT,
"client-id", client_id,
"bus-name", bus_name,
NULL);
return GSM_CLIENT (client);
}
......@@ -51,6 +51,8 @@ struct _GsmDBusClientClass
GType gsm_dbus_client_get_type (void) G_GNUC_CONST;
GsmClient * gsm_dbus_client_new (const char *client_id,
const char *bus_name);
const char * gsm_dbus_client_get_bus_name (GsmDBusClient *client);
G_END_DECLS
......
......@@ -49,8 +49,7 @@
#include "gsm-inhibitor.h"
#include "gsm-xsmp-client.h"
#include "gsm-method-client.h"
#include "gsm-service-client.h"
#include "gsm-dbus-client.h"
#include "gsm-autostart-app.h"
#include "gsm-resumed-app.h"
......@@ -586,6 +585,7 @@ static void
register_client_for_name (GsmManager *manager,
const char *dbus_name)
{
#if 0
GsmApp *app;
GsmClient *client;
......@@ -606,6 +606,7 @@ register_client_for_name (GsmManager *manager,
gsm_app_registered (app);
gsm_client_set_status (client, GSM_CLIENT_REGISTERED);
#endif
}
static void
......@@ -2050,7 +2051,7 @@ gsm_manager_register_client (GsmManager *manager,
}
sender = dbus_g_method_get_sender (context);
client = gsm_method_client_new (client_id, sender);
client = gsm_dbus_client_new (client_id, sender);
g_free (sender);
if (client == NULL) {
GError *new_error;
......
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright (C) 2008 Red Hat, Inc.
*
* 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
* Lesser 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.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include "gsm-method-client.h"
#include "gsm-marshal.h"
#include "gsm-manager.h"
#define GSM_METHOD_CLIENT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GSM_TYPE_METHOD_CLIENT, GsmMethodClientPrivate))
struct GsmMethodClientPrivate
{
gpointer dummy;
};
enum {
PROP_0,
};
G_DEFINE_TYPE (GsmMethodClient, gsm_method_client, GSM_TYPE_DBUS_CLIENT)
static GObject *
gsm_method_client_constructor (GType type,
guint n_construct_properties,
GObjectConstructParam *construct_properties)
{
GsmMethodClient *client;
client = GSM_METHOD_CLIENT (G_OBJECT_CLASS (gsm_method_client_parent_class)->constructor (type,
n_construct_properties,
construct_properties));
return G_OBJECT (client);
}
static void
gsm_method_client_init (GsmMethodClient *client)
{
client->priv = GSM_METHOD_CLIENT_GET_PRIVATE (client);
}
static void
gsm_method_client_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
GsmMethodClient *self;
self = GSM_METHOD_CLIENT (object);
switch (prop_id) {
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
gsm_method_client_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
GsmMethodClient *self;
self = GSM_METHOD_CLIENT (object);
switch (prop_id) {
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
gsm_method_client_finalize (GObject *object)
{
G_OBJECT_CLASS (gsm_method_client_parent_class)->finalize (object);
}
static gboolean
gsm_method_client_stop (GsmClient *client,
GError **error)
{
return FALSE;
}
static void
gsm_method_client_class_init (GsmMethodClientClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GsmClientClass *client_class = GSM_CLIENT_CLASS (klass);
object_class->finalize = gsm_method_client_finalize;
object_class->constructor = gsm_method_client_constructor;
object_class->get_property = gsm_method_client_get_property;
object_class->set_property = gsm_method_client_set_property;
client_class->stop = gsm_method_client_stop;
g_type_class_add_private (klass, sizeof (GsmMethodClientPrivate));
}
GsmClient *
gsm_method_client_new (const char *client_id,
const char *bus_name)
{
GsmMethodClient *method;
method = g_object_new (GSM_TYPE_METHOD_CLIENT,
"client-id", client_id,
"bus-name", bus_name,
NULL);
return GSM_CLIENT (method);
}
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright (C) 2008 Red Hat, Inc.
*
* 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
* Lesser 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 __GSM_METHOD_CLIENT_H__
#define __GSM_METHOD_CLIENT_H__
#include "gsm-dbus-client.h"
G_BEGIN_DECLS
#define GSM_TYPE_METHOD_CLIENT (gsm_method_client_get_type ())
#define GSM_METHOD_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GSM_TYPE_METHOD_CLIENT, GsmMethodClient))
#define GSM_METHOD_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GSM_TYPE_METHOD_CLIENT, GsmMethodClientClass))
#define GSM_IS_METHOD_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GSM_TYPE_METHOD_CLIENT))
#define GSM_IS_METHOD_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GSM_TYPE_METHOD_CLIENT))
#define GSM_METHOD_CLIENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GSM_TYPE_METHOD_CLIENT, GsmMethodClientClass))
typedef struct _GsmMethodClient GsmMethodClient;
typedef struct _GsmMethodClientClass GsmMethodClientClass;
typedef struct GsmMethodClientPrivate GsmMethodClientPrivate;
struct _GsmMethodClient
{
GsmDBusClient parent;
GsmMethodClientPrivate *priv;
};
struct _GsmMethodClientClass
{
GsmDBusClientClass parent_class;
};
GType gsm_method_client_get_type (void) G_GNUC_CONST;
GsmClient *gsm_method_client_new (const char *client_id,
const char *bus_name);
G_END_DECLS
#endif /* __GSM_METHOD_CLIENT_H__ */
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright (C) 2008 Red Hat, Inc.
*
* 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
* Lesser 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.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include "gsm-service-client.h"
#include "gsm-marshal.h"
#include "gsm-manager.h"
#define GSM_SERVICE_CLIENT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GSM_TYPE_SERVICE_CLIENT, GsmServiceClientPrivate))
struct GsmServiceClientPrivate
{
};
enum {
PROP_0,
};
G_DEFINE_TYPE (GsmServiceClient, gsm_service_client, GSM_TYPE_DBUS_CLIENT)
static GObject *
gsm_service_client_constructor (GType type,
guint n_construct_properties,
GObjectConstructParam *construct_properties)
{
GsmServiceClient *client;
client = GSM_SERVICE_CLIENT (G_OBJECT_CLASS (gsm_service_client_parent_class)->constructor (type,
n_construct_properties,
construct_properties));
return G_OBJECT (client);
}
static void
gsm_service_client_init (GsmServiceClient *client)
{
client->priv = GSM_SERVICE_CLIENT_GET_PRIVATE (client);
}
static void
gsm_service_client_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
GsmServiceClient *self;
self = GSM_SERVICE_CLIENT (object);
switch (prop_id) {
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
gsm_service_client_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
GsmServiceClient *self;
self = GSM_SERVICE_CLIENT (object);
switch (prop_id) {
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
gsm_service_client_finalize (GObject *object)
{
G_OBJECT_CLASS (gsm_service_client_parent_class)->finalize (object);
}
static gboolean
gsm_service_client_stop (GsmClient *client,
GError **error)
{
return FALSE;
}
static void
gsm_service_client_class_init (GsmServiceClientClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GsmClientClass *client_class = GSM_CLIENT_CLASS (klass);
object_class->finalize = gsm_service_client_finalize;
object_class->constructor = gsm_service_client_constructor;
object_class->get_property = gsm_service_client_get_property;
object_class->set_property = gsm_service_client_set_property;
client_class->stop = gsm_service_client_stop;
g_type_class_add_private (klass, sizeof (GsmServiceClientPrivate));
}
GsmClient *
gsm_service_client_new (const char *bus_name)
{
GsmServiceClient *service;
service = g_object_new (GSM_TYPE_SERVICE_CLIENT,
"bus-name", bus_name,
NULL);
return GSM_CLIENT (service);
}
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright (C) 2008 Red Hat, Inc.
*
* 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
* Lesser 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 __GSM_SERVICE_CLIENT_H__
#define __GSM_SERVICE_CLIENT_H__
#include "gsm-dbus-client.h"
G_BEGIN_DECLS
#define GSM_TYPE_SERVICE_CLIENT (gsm_service_client_get_type ())
#define GSM_SERVICE_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GSM_TYPE_SERVICE_CLIENT, GsmServiceClient))
#define GSM_SERVICE_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GSM_TYPE_SERVICE_CLIENT, GsmServiceClientClass))
#define GSM_IS_SERVICE_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GSM_TYPE_SERVICE_CLIENT))
#define GSM_IS_SERVICE_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GSM_TYPE_SERVICE_CLIENT))
#define GSM_SERVICE_CLIENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GSM_TYPE_SERVICE_CLIENT, GsmServiceClientClass))
typedef struct _GsmServiceClient GsmServiceClient;
typedef struct _GsmServiceClientClass GsmServiceClientClass;
typedef struct GsmServiceClientPrivate GsmServiceClientPrivate;
struct _GsmServiceClient
{
GsmDBusClient parent;
GsmServiceClientPrivate *priv;
};
struct _GsmServiceClientClass
{
GsmDBusClientClass parent_class;
};
GType gsm_service_client_get_type (void) G_GNUC_CONST;
GsmClient *gsm_service_client_new (const char *bus_name);
G_END_DECLS
#endif /* __GSM_SERVICE_CLIENT_H__ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment