[monkey-bubble: 10/753] More session code: - Enriched API a bit - "Log out" in panel sends request



commit 0e8d3f77f8be3791c0dfbf4e221b81745fd8d1fc
Author: Tom Tromey <tromey src gnome org>
Date:   Thu Dec 18 16:20:34 1997 +0000

    More session code: - Enriched API a bit - "Log out" in panel sends request
    
    More session code:
     - Enriched API a bit
     - "Log out" in panel sends request to session manager (if connected)
     - Added "Log out" panel applet (just a button to log out)
    tromey cygnus com

 libgnomeui/gnome-session.c |   27 +++++++++++++++++++++++++++
 libgnomeui/gnome-session.h |   13 +++++++++++++
 2 files changed, 40 insertions(+), 0 deletions(-)
---
diff --git a/libgnomeui/gnome-session.c b/libgnomeui/gnome-session.c
index 68b806e..03e8470 100644
--- a/libgnomeui/gnome-session.c
+++ b/libgnomeui/gnome-session.c
@@ -346,3 +346,30 @@ gnome_session_interaction_done (int shutdown)
   SmcInteractDone (info->connection, shutdown);
 #endif /* HAVE_LIBSM */
 }
+
+void
+gnome_session_request_save (GnomeSaveStyle save_style,
+			    int /* bool */ is_shutdown,
+			    GnomeInteractStyle interact_style,
+			    int /* bool */ is_fast,
+			    int /* bool */ is_global)
+{
+#ifdef HAVE_LIBSM
+  if (! info)
+    return;
+
+  SmcRequestSaveYourself (info->connection, save_style,
+			  is_shutdown, interact_style,
+			  is_fast, is_global);
+#endif /* HAVE_LIBSM */
+}
+
+int
+gnome_session_connected_p (void)
+{
+#ifdef HAVE_LIBSM
+  return (info && info->connection);
+#else
+  return 0;
+#endif /* HAVE_LIBSM */
+}
diff --git a/libgnomeui/gnome-session.h b/libgnomeui/gnome-session.h
index 2143dbd..ada4aa3 100644
--- a/libgnomeui/gnome-session.h
+++ b/libgnomeui/gnome-session.h
@@ -120,6 +120,19 @@ int gnome_session_request_interaction (GnomeDialogType dialog_type);
    shutdown will be cancelled.  */
 void gnome_session_interaction_done (int shutdown);
 
+/* Request the session manager to save the session in some way.  This
+   can also be used to request a logout.  If IS_GLOBAL is true, then
+   all clients are saved; otherwise only this client is saved.  */
+void gnome_session_request_save (GnomeSaveStyle save_style,
+				 int /* bool */ is_shutdown,
+				 GnomeInteractStyle interact_style,
+				 int /* bool */ is_fast,
+				 int /* bool */ is_global);
+
+
+/* Returns true if we're actually talking to the session manager,
+   false otherwise.  */
+int gnome_session_connected_p (void);
 
 END_GNOME_DECLS
 



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