[Xfce4-commits] <libxfce4ui:new-sm-client> add xfce_sm_client_is_connected()
Brian J. Tarricone
noreply at xfce.org
Mon Oct 5 02:26:01 CEST 2009
Updating branch refs/heads/kelnos/new-sm-client
to 5699458f827e758aa087e4796db5764778bac5aa (commit)
from bd5d5b663013df440a6bd0645d12f330b307d267 (commit)
commit 5699458f827e758aa087e4796db5764778bac5aa
Author: Brian J. Tarricone <brian at tarricone.org>
Date: Sun Oct 4 17:24:47 2009 -0700
add xfce_sm_client_is_connected()
docs/libxfce4ui-sections.txt | 1 +
docs/tmpl/xfce-sm-client.sgml | 9 +++++++++
libxfce4ui/libxfce4ui.symbols | 1 +
libxfce4ui/xfce-sm-client.c | 20 ++++++++++++++++++++
libxfce4ui/xfce-sm-client.h | 1 +
5 files changed, 32 insertions(+), 0 deletions(-)
diff --git a/docs/libxfce4ui-sections.txt b/docs/libxfce4ui-sections.txt
index 439563a..699a10a 100644
--- a/docs/libxfce4ui-sections.txt
+++ b/docs/libxfce4ui-sections.txt
@@ -83,6 +83,7 @@ xfce_sm_client_get_with_argv
xfce_sm_client_get_full
xfce_sm_client_connect
xfce_sm_client_disconnect
+xfce_sm_client_is_connected
xfce_sm_client_is_resumed
xfce_sm_client_set_desktop_file
xfce_sm_client_request_shutdown
diff --git a/docs/tmpl/xfce-sm-client.sgml b/docs/tmpl/xfce-sm-client.sgml
index 58f4427..f08643a 100644
--- a/docs/tmpl/xfce-sm-client.sgml
+++ b/docs/tmpl/xfce-sm-client.sgml
@@ -197,6 +197,15 @@
@sm_client:
+<!-- ##### FUNCTION xfce_sm_client_is_connected ##### -->
+<para>
+
+</para>
+
+ at sm_client:
+ at Returns:
+
+
<!-- ##### FUNCTION xfce_sm_client_is_resumed ##### -->
<para>
diff --git a/libxfce4ui/libxfce4ui.symbols b/libxfce4ui/libxfce4ui.symbols
index e072770..0d5cbe9 100644
--- a/libxfce4ui/libxfce4ui.symbols
+++ b/libxfce4ui/libxfce4ui.symbols
@@ -102,6 +102,7 @@ xfce_sm_client_get_with_argv
xfce_sm_client_get_full
xfce_sm_client_connect
xfce_sm_client_disconnect
+xfce_sm_client_is_connected
xfce_sm_client_is_resumed
xfce_sm_client_set_desktop_file
xfce_sm_client_request_shutdown
diff --git a/libxfce4ui/xfce-sm-client.c b/libxfce4ui/xfce-sm-client.c
index d124ada..888a711 100644
--- a/libxfce4ui/xfce-sm-client.c
+++ b/libxfce4ui/xfce-sm-client.c
@@ -1717,6 +1717,26 @@ xfce_sm_client_disconnect(XfceSMClient *sm_client)
}
/**
+ * xfce_sm_client_is_connected:
+ * @sm_client: An #XfceSMClient
+ *
+ * Determines whether or not the application has connected to the
+ * session manager.
+ *
+ * Returns: %TRUE if connected to the session manager, %FALSE otherwise
+ **/
+gboolean
+xfce_sm_client_is_connected(XfceSMClient *sm_client)
+{
+ g_return_val_if_fail(XFCE_IS_SM_CLIENT(sm_client), FALSE);
+#ifdef HAVE_LIBSM
+ return !!sm_client->session_connection;
+#else
+ return FALSE;
+#endif
+}
+
+/**
* xfce_sm_client_is_resumed:
* @sm_client: An #XfceSMClient
*
diff --git a/libxfce4ui/xfce-sm-client.h b/libxfce4ui/xfce-sm-client.h
index eafa5ce..6b84858 100644
--- a/libxfce4ui/xfce-sm-client.h
+++ b/libxfce4ui/xfce-sm-client.h
@@ -87,6 +87,7 @@ void xfce_sm_client_disconnect(XfceSMClient *sm_client);
void xfce_sm_client_request_shutdown(XfceSMClient *sm_client,
XfceSMClientShutdownHint shutdown_hint);
+gboolean xfce_sm_client_is_connected(XfceSMClient *sm_client);
gboolean xfce_sm_client_is_resumed(XfceSMClient *sm_client);
void xfce_sm_client_set_desktop_file(XfceSMClient *sm_client,
More information about the Xfce4-commits
mailing list