gnome-session r4702 - trunk/gnome-session



Author: lucasr
Date: Sun May 25 18:44:36 2008
New Revision: 4702
URL: http://svn.gnome.org/viewvc/gnome-session?rev=4702&view=rev

Log:
Added SessionRunning signal.


Modified:
   trunk/gnome-session/dbus.c
   trunk/gnome-session/dbus.h
   trunk/gnome-session/org.gnome.SessionManagement.xml
   trunk/gnome-session/session.c

Modified: trunk/gnome-session/dbus.c
==============================================================================
--- trunk/gnome-session/dbus.c	(original)
+++ trunk/gnome-session/dbus.c	Sun May 25 18:44:36 2008
@@ -37,6 +37,7 @@
 #include "dbus.h"
 
 enum {
+  SESSION_RUNNING,
   SESSION_OVER,
   LAST_SIGNAL
 };
@@ -178,6 +179,16 @@
 {
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
+  signals[SESSION_RUNNING] =
+    g_signal_new ("session-running",
+                  G_OBJECT_CLASS_TYPE (object_class),
+                  G_SIGNAL_RUN_LAST,
+                  0,
+                  NULL, NULL,
+                  g_cclosure_marshal_VOID__VOID,
+                  G_TYPE_NONE,
+                  0);
+
   signals[SESSION_OVER] =
     g_signal_new ("session-over",
                   G_OBJECT_CLASS_TYPE (object_class),
@@ -346,7 +357,13 @@
 }
 
 void
-gsm_dbus_session_over ()
+gsm_dbus_emit_session_running ()
+{
+  g_signal_emit (global_dbus_server, signals[SESSION_RUNNING], 0);
+}
+
+void
+gsm_dbus_emit_session_over ()
 {
   g_signal_emit (global_dbus_server, signals[SESSION_OVER], 0);
 }

Modified: trunk/gnome-session/dbus.h
==============================================================================
--- trunk/gnome-session/dbus.h	(original)
+++ trunk/gnome-session/dbus.h	Sun May 25 18:44:36 2008
@@ -22,11 +22,12 @@
 #ifndef __GSM_DBUS_H__
 #define __GSM_DBUS_H__
 
-void gsm_dbus_init          (void);
-void gsm_dbus_check         (void);
-void gsm_dbus_session_over  (void);
-void gsm_dbus_run           (void);
-void gsm_dbus_shutdown      (void);
+void gsm_dbus_init                  (void);
+void gsm_dbus_check                 (void);
+void gsm_dbus_emit_session_running  (void);
+void gsm_dbus_emit_session_over     (void);
+void gsm_dbus_run                   (void);
+void gsm_dbus_shutdown              (void);
 
 DBusGConnection *gsm_dbus_get_connection (void);
 

Modified: trunk/gnome-session/org.gnome.SessionManagement.xml
==============================================================================
--- trunk/gnome-session/org.gnome.SessionManagement.xml	(original)
+++ trunk/gnome-session/org.gnome.SessionManagement.xml	Sun May 25 18:44:36 2008
@@ -27,6 +27,11 @@
       <arg name="name" type="s" direction="in"/>
     </method>
 
+    <!-- Signals -->
+
+    <signal name="SessionRunning">
+    </signal>
+
     <signal name="SessionOver">
     </signal>
 

Modified: trunk/gnome-session/session.c
==============================================================================
--- trunk/gnome-session/session.c	(original)
+++ trunk/gnome-session/session.c	Sun May 25 18:44:36 2008
@@ -465,6 +465,9 @@
 
   if (session->phase < GSM_SESSION_PHASE_RUNNING)
     start_phase (session);
+
+  if (session->phase == GSM_SESSION_PHASE_RUNNING)
+    gsm_dbus_emit_session_running ();
 }
 
 static void
@@ -873,7 +876,7 @@
   GSList *cl;
 
   /* Emit session over signal */
-  gsm_dbus_session_over ();
+  gsm_dbus_emit_session_over ();
 
   /* FIXME: do this in reverse phase order */
   for (cl = session->clients; cl; cl = cl->next)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]