gnome-session r4800 - in branches/dbus_based: . gnome-session
- From: mccann svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-session r4800 - in branches/dbus_based: . gnome-session
- Date: Tue, 15 Jul 2008 18:21:30 +0000 (UTC)
Author: mccann
Date: Tue Jul 15 18:21:29 2008
New Revision: 4800
URL: http://svn.gnome.org/viewvc/gnome-session?rev=4800&view=rev
Log:
2008-07-15 William Jon McCann <jmccann redhat com>
* gnome-session/gsm-app.c (gsm_app_class_init), (gsm_app_get_id),
(gsm_app_is_disabled), (gsm_app_is_running),
(gsm_app_get_autorestart), (gsm_app_provides), (gsm_app_start),
(gsm_app_restart), (gsm_app_stop):
* gnome-session/gsm-app.h:
* gnome-session/gsm-autostart-app.c (gsm_autostart_app_class_init):
* gnome-session/gsm-client.c (default_stop),
(gsm_client_class_init), (gsm_client_notify_session_over),
(gsm_client_stop):
* gnome-session/gsm-client.h:
* gnome-session/gsm-resumed-app.c (gsm_resumed_app_class_init):
* gnome-session/gsm-resumed-app.h:
* gnome-session/gsm-xsmp-client.c (gsm_xsmp_client_class_init):
By default emit stop signal from client.
Modified:
branches/dbus_based/ChangeLog
branches/dbus_based/gnome-session/gsm-app.c
branches/dbus_based/gnome-session/gsm-app.h
branches/dbus_based/gnome-session/gsm-autostart-app.c
branches/dbus_based/gnome-session/gsm-client.c
branches/dbus_based/gnome-session/gsm-client.h
branches/dbus_based/gnome-session/gsm-resumed-app.c
branches/dbus_based/gnome-session/gsm-resumed-app.h
branches/dbus_based/gnome-session/gsm-xsmp-client.c
Modified: branches/dbus_based/gnome-session/gsm-app.c
==============================================================================
--- branches/dbus_based/gnome-session/gsm-app.c (original)
+++ branches/dbus_based/gnome-session/gsm-app.c Tue Jul 15 18:21:29 2008
@@ -174,11 +174,11 @@
object_class->get_property = gsm_app_get_property;
object_class->dispose = gsm_app_dispose;
- klass->get_id = NULL;
- klass->start = NULL;
- klass->get_autorestart = NULL;
- klass->provides = NULL;
- klass->is_running = NULL;
+ klass->impl_get_id = NULL;
+ klass->impl_start = NULL;
+ klass->impl_get_autorestart = NULL;
+ klass->impl_provides = NULL;
+ klass->impl_is_running = NULL;
g_object_class_install_property (object_class,
PROP_PHASE,
@@ -239,7 +239,7 @@
const char *
gsm_app_get_id (GsmApp *app)
{
- return GSM_APP_GET_CLASS (app)->get_id (app);
+ return GSM_APP_GET_CLASS (app)->impl_get_id (app);
}
const char *
@@ -269,8 +269,8 @@
{
g_return_val_if_fail (GSM_IS_APP (app), FALSE);
- if (GSM_APP_GET_CLASS (app)->is_disabled) {
- return GSM_APP_GET_CLASS (app)->is_disabled (app);
+ if (GSM_APP_GET_CLASS (app)->impl_is_disabled) {
+ return GSM_APP_GET_CLASS (app)->impl_is_disabled (app);
} else {
return FALSE;
}
@@ -281,8 +281,8 @@
{
g_return_val_if_fail (GSM_IS_APP (app), FALSE);
- if (GSM_APP_GET_CLASS (app)->is_running) {
- return GSM_APP_GET_CLASS (app)->is_running (app);
+ if (GSM_APP_GET_CLASS (app)->impl_is_running) {
+ return GSM_APP_GET_CLASS (app)->impl_is_running (app);
} else {
return FALSE;
}
@@ -293,8 +293,8 @@
{
g_return_val_if_fail (GSM_IS_APP (app), FALSE);
- if (GSM_APP_GET_CLASS (app)->get_autorestart) {
- return GSM_APP_GET_CLASS (app)->get_autorestart (app);
+ if (GSM_APP_GET_CLASS (app)->impl_get_autorestart) {
+ return GSM_APP_GET_CLASS (app)->impl_get_autorestart (app);
} else {
return FALSE;
}
@@ -304,8 +304,8 @@
gsm_app_provides (GsmApp *app, const char *service)
{
- if (GSM_APP_GET_CLASS (app)->provides) {
- return GSM_APP_GET_CLASS (app)->provides (app, service);
+ if (GSM_APP_GET_CLASS (app)->impl_provides) {
+ return GSM_APP_GET_CLASS (app)->impl_provides (app, service);
} else {
return FALSE;
}
@@ -317,7 +317,7 @@
{
g_debug ("Starting app: %s", app->priv->id);
- return GSM_APP_GET_CLASS (app)->start (app, error);
+ return GSM_APP_GET_CLASS (app)->impl_start (app, error);
}
gboolean
@@ -326,14 +326,14 @@
{
g_debug ("Re-starting app: %s", app->priv->id);
- return GSM_APP_GET_CLASS (app)->restart (app, error);
+ return GSM_APP_GET_CLASS (app)->impl_restart (app, error);
}
gboolean
gsm_app_stop (GsmApp *app,
GError **error)
{
- return GSM_APP_GET_CLASS (app)->stop (app, error);
+ return GSM_APP_GET_CLASS (app)->impl_stop (app, error);
}
void
Modified: branches/dbus_based/gnome-session/gsm-app.h
==============================================================================
--- branches/dbus_based/gnome-session/gsm-app.h (original)
+++ branches/dbus_based/gnome-session/gsm-app.h Tue Jul 15 18:21:29 2008
@@ -59,21 +59,21 @@
void (*registered) (GsmApp *app);
/* virtual methods */
- gboolean (*start) (GsmApp *app,
- GError **error);
- gboolean (*restart) (GsmApp *app,
- GError **error);
- gboolean (*stop) (GsmApp *app,
- GError **error);
- gboolean (*provides) (GsmApp *app,
- const char *service);
- gboolean (*is_running) (GsmApp *app);
-
- gboolean (*get_autorestart) (GsmApp *app);
- const char *(*get_id) (GsmApp *app);
- gboolean (*is_disabled) (GsmApp *app);
- void (*set_client) (GsmApp *app,
- GsmClient *client);
+ gboolean (*impl_start) (GsmApp *app,
+ GError **error);
+ gboolean (*impl_restart) (GsmApp *app,
+ GError **error);
+ gboolean (*impl_stop) (GsmApp *app,
+ GError **error);
+ gboolean (*impl_provides) (GsmApp *app,
+ const char *service);
+ gboolean (*impl_is_running) (GsmApp *app);
+
+ gboolean (*impl_get_autorestart) (GsmApp *app);
+ const char *(*impl_get_id) (GsmApp *app);
+ gboolean (*impl_is_disabled) (GsmApp *app);
+ void (*impl_set_client) (GsmApp *app,
+ GsmClient *client);
};
typedef enum
Modified: branches/dbus_based/gnome-session/gsm-autostart-app.c
==============================================================================
--- branches/dbus_based/gnome-session/gsm-autostart-app.c (original)
+++ branches/dbus_based/gnome-session/gsm-autostart-app.c Tue Jul 15 18:21:29 2008
@@ -871,14 +871,14 @@
object_class->dispose = gsm_autostart_app_dispose;
object_class->constructor = gsm_autostart_app_constructor;
- app_class->is_disabled = is_disabled;
- app_class->is_running = is_running;
- app_class->start = gsm_autostart_app_start;
- app_class->restart = gsm_autostart_app_restart;
- app_class->stop = gsm_autostart_app_stop;
- app_class->provides = gsm_autostart_app_provides;
- app_class->get_id = gsm_autostart_app_get_id;
- app_class->get_autorestart = gsm_autostart_app_get_autorestart;
+ app_class->impl_is_disabled = is_disabled;
+ app_class->impl_is_running = is_running;
+ app_class->impl_start = gsm_autostart_app_start;
+ app_class->impl_restart = gsm_autostart_app_restart;
+ app_class->impl_stop = gsm_autostart_app_stop;
+ app_class->impl_provides = gsm_autostart_app_provides;
+ app_class->impl_get_id = gsm_autostart_app_get_id;
+ app_class->impl_get_autorestart = gsm_autostart_app_get_autorestart;
g_object_class_install_property (object_class,
PROP_DESKTOP_FILENAME,
Modified: branches/dbus_based/gnome-session/gsm-client.c
==============================================================================
--- branches/dbus_based/gnome-session/gsm-client.c (original)
+++ branches/dbus_based/gnome-session/gsm-client.c Tue Jul 15 18:21:29 2008
@@ -51,6 +51,7 @@
enum {
DISCONNECTED,
+ STOP,
LAST_SIGNAL
};
@@ -226,6 +227,17 @@
}
}
+static gboolean
+default_stop (GsmClient *client,
+ GError **error)
+{
+ g_return_val_if_fail (GSM_IS_CLIENT (client), FALSE);
+
+ g_signal_emit (client, signals[STOP], 0);
+
+ return TRUE;
+}
+
static void
gsm_client_class_init (GsmClientClass *klass)
{
@@ -236,6 +248,8 @@
object_class->constructor = gsm_client_constructor;
object_class->finalize = gsm_client_finalize;
+ klass->impl_stop = default_stop;
+
signals[DISCONNECTED] =
g_signal_new ("disconnected",
G_OBJECT_CLASS_TYPE (object_class),
@@ -245,6 +259,15 @@
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE,
0);
+ signals[STOP] =
+ g_signal_new ("stop",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (GsmClientClass, stop),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE,
+ 0);
g_object_class_install_property (object_class,
PROP_CLIENT_ID,
@@ -305,7 +328,7 @@
{
g_return_if_fail (GSM_IS_CLIENT (client));
- GSM_CLIENT_GET_CLASS (client)->notify_session_over (client);
+ GSM_CLIENT_GET_CLASS (client)->impl_notify_session_over (client);
}
gboolean
@@ -314,7 +337,9 @@
{
g_return_val_if_fail (GSM_IS_CLIENT (client), FALSE);
- return GSM_CLIENT_GET_CLASS (client)->stop (client, error);
+ g_signal_emit (client, signals[STOP], 0);
+
+ return GSM_CLIENT_GET_CLASS (client)->impl_stop (client, error);
}
void
Modified: branches/dbus_based/gnome-session/gsm-client.h
==============================================================================
--- branches/dbus_based/gnome-session/gsm-client.h (original)
+++ branches/dbus_based/gnome-session/gsm-client.h Tue Jul 15 18:21:29 2008
@@ -58,11 +58,12 @@
/* signals */
void (*disconnected) (GsmClient *client);
+ void (*stop) (GsmClient *client);
/* virtual methods */
- void (*notify_session_over) (GsmClient *client);
- gboolean (*stop) (GsmClient *client,
- GError **error);
+ void (*impl_notify_session_over) (GsmClient *client);
+ gboolean (*impl_stop) (GsmClient *client,
+ GError **error);
};
GType gsm_client_get_type (void) G_GNUC_CONST;
Modified: branches/dbus_based/gnome-session/gsm-resumed-app.c
==============================================================================
--- branches/dbus_based/gnome-session/gsm-resumed-app.c (original)
+++ branches/dbus_based/gnome-session/gsm-resumed-app.c Tue Jul 15 18:21:29 2008
@@ -186,9 +186,9 @@
object_class->dispose = gsm_resumed_app_dispose;
- app_class->get_id = gsm_resumed_app_get_id;
- app_class->start = gsm_resumed_app_start;
- app_class->restart = gsm_resumed_app_restart;
+ app_class->impl_get_id = gsm_resumed_app_get_id;
+ app_class->impl_start = gsm_resumed_app_start;
+ app_class->impl_restart = gsm_resumed_app_restart;
g_type_class_add_private (klass, sizeof (GsmResumedAppPrivate));
}
Modified: branches/dbus_based/gnome-session/gsm-resumed-app.h
==============================================================================
--- branches/dbus_based/gnome-session/gsm-resumed-app.h (original)
+++ branches/dbus_based/gnome-session/gsm-resumed-app.h Tue Jul 15 18:21:29 2008
@@ -46,11 +46,6 @@
struct _GsmResumedAppClass
{
GsmAppClass parent_class;
-
- /* signals */
-
- /* virtual methods */
-
};
GType gsm_resumed_app_get_type (void) G_GNUC_CONST;
Modified: branches/dbus_based/gnome-session/gsm-xsmp-client.c
==============================================================================
--- branches/dbus_based/gnome-session/gsm-xsmp-client.c (original)
+++ branches/dbus_based/gnome-session/gsm-xsmp-client.c Tue Jul 15 18:21:29 2008
@@ -632,7 +632,7 @@
object_class->get_property = gsm_xsmp_client_get_property;
object_class->set_property = gsm_xsmp_client_set_property;
- client_class->stop = xsmp_stop;
+ client_class->impl_stop = xsmp_stop;
signals[REGISTER_REQUEST] =
g_signal_new ("register-request",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]