From 621a7ba6b53826e95011940b90d9bf8a684534b8 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 29 Oct 2009 13:13:07 -0500 Subject: Adding the shutdown signal --- libindicator/indicator-service.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/libindicator/indicator-service.c b/libindicator/indicator-service.c index 7a1fa8a..5a252f8 100644 --- a/libindicator/indicator-service.c +++ b/libindicator/indicator-service.c @@ -4,12 +4,21 @@ #include "indicator-service.h" +/* Private Stuff */ typedef struct _IndicatorServicePrivate IndicatorServicePrivate; struct _IndicatorServicePrivate { int dummy; }; +/* Signals Stuff */ +enum { + SHUTDOWN, + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + #define INDICATOR_SERVICE_GET_PRIVATE(o) \ (G_TYPE_INSTANCE_GET_PRIVATE ((o), INDICATOR_SERVICE_TYPE, IndicatorServicePrivate)) @@ -30,6 +39,22 @@ indicator_service_class_init (IndicatorServiceClass *klass) object_class->dispose = indicator_service_dispose; object_class->finalize = indicator_service_finalize; + /* Signals */ + + /** + IndicatorService::shutdown: + @arg0: The #IndicatorService object + + Signaled when the service should shutdown as no one + is listening anymore. + */ + signals[SHUTDOWN] = g_signal_new (INDICATOR_SERVICE_SIGNAL_SHUTDOWN, + G_TYPE_FROM_CLASS(klass), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (IndicatorServiceClass, shutdown), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0, G_TYPE_NONE); return; } -- cgit v1.2.3