diff options
author | William Jon McCann <mccann@jhu.edu> | 2007-03-19 16:35:55 -0400 |
---|---|---|
committer | William Jon McCann <mccann@jhu.edu> | 2007-03-19 16:35:55 -0400 |
commit | 4c365a8e28adafd6619ada97d4239e9e6df429ab (patch) | |
tree | 07747bdf4b591fffdf753ab7242d8cfbd13f5b02 | |
parent | c40a87c622ac1543dc2d9cdccc651e33affadcfa (diff) |
add CanActivateSessions to Seat interface
And associated documentation and added to test-fus.
-rw-r--r-- | doc/spec/ck-seat.xml | 12 | ||||
-rw-r--r-- | doc/xml/ck-design.xml | 9 | ||||
-rw-r--r-- | doc/xml/ref-ck-seat.xml | 12 | ||||
-rw-r--r-- | src/ck-seat.c | 14 | ||||
-rw-r--r-- | src/ck-seat.h | 32 | ||||
-rw-r--r-- | src/ck-seat.xml | 3 | ||||
-rwxr-xr-x | src/test-fus | 6 |
7 files changed, 67 insertions, 21 deletions
diff --git a/doc/spec/ck-seat.xml b/doc/spec/ck-seat.xml index 81fb1cc..1d154e7 100644 --- a/doc/spec/ck-seat.xml +++ b/doc/spec/ck-seat.xml @@ -52,6 +52,18 @@ seat at a time.</doc:para> </doc:doc> </method> + <method name="CanActivateSessions"> + <arg name="can_activate" direction="out" type="b"> + <doc:doc> + <doc:summary>TRUE if seat supports session activation</doc:summary> + </doc:doc> + </arg> + <doc:doc> + <doc:description>Used to determine whether the seat supports session activation. + </doc:description> + </doc:doc> + </method> + <method name="ActivateSession"> <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> <arg name="ssid" direction="in" type="o"> diff --git a/doc/xml/ck-design.xml b/doc/xml/ck-design.xml index 086795c..1148773 100644 --- a/doc/xml/ck-design.xml +++ b/doc/xml/ck-design.xml @@ -61,6 +61,9 @@ The Session will remain open until the Session Leader disconnects from the D-Bus To determine which Seat it is running on. </listitem> <listitem> + To know if the current seat supports session switching. + </listitem> + <listitem> A list of all sessions on the current Seat. </listitem> <listitem> @@ -121,6 +124,12 @@ The Session will remain open until the Session Leader disconnects from the D-Bus To determine which session it is running in. </listitem> <listitem> + To determine which Seat it is running on. + </listitem> + <listitem> + To know if the current seat supports session switching. + </listitem> + <listitem> A list of all sessions on the current Seat. </listitem> <listitem> diff --git a/doc/xml/ref-ck-seat.xml b/doc/xml/ref-ck-seat.xml index 6161207..03f4176 100644 --- a/doc/xml/ref-ck-seat.xml +++ b/doc/xml/ref-ck-seat.xml @@ -8,10 +8,11 @@ </refnamediv> <refsynopsisdiv role="synopsis"> <title role="synopsis.title">Methods</title> - <synopsis><link linkend="Seat.GetId">GetId</link> (out 'o' sid) -<link linkend="Seat.GetSessions">GetSessions</link> (out 'ao' sessions) -<link linkend="Seat.GetActiveSession">GetActiveSession</link> (out 'o' ssid) -<link linkend="Seat.ActivateSession">ActivateSession</link> (in 'o' ssid) + <synopsis><link linkend="Seat.GetId">GetId</link> (out 'o' sid) +<link linkend="Seat.GetSessions">GetSessions</link> (out 'ao' sessions) +<link linkend="Seat.GetActiveSession">GetActiveSession</link> (out 'o' ssid) +<link linkend="Seat.CanActivateSessions">CanActivateSessions</link> (out 'b' can_activate) +<link linkend="Seat.ActivateSession">ActivateSession</link> (in 'o' ssid) </synopsis> </refsynopsisdiv> <refsect1 role="signal_proto"> @@ -51,7 +52,8 @@ seat at a time.</para> <variablelist role="params"><varlistentry><term><parameter>sessions</parameter>:</term><listitem><simpara>an array of Session IDs</simpara></listitem></varlistentry></variablelist><refsect2><title><anchor role="function" id="Seat.GetActiveSession"/>GetActiveSession ()</title><indexterm><primary>GetActiveSession</primary><secondary>Seat</secondary></indexterm><programlisting>GetActiveSession (out 'o' ssid)</programlisting></refsect2> <para>Gets the Session ID that is currently active on this Seat.</para> <para>Returns NULL if there is no active session.</para> - <variablelist role="params"><varlistentry><term><parameter>ssid</parameter>:</term><listitem><simpara>Session ID</simpara></listitem></varlistentry></variablelist><refsect2><title><anchor role="function" id="Seat.ActivateSession"/>ActivateSession ()</title><indexterm><primary>ActivateSession</primary><secondary>Seat</secondary></indexterm><programlisting>ActivateSession (in 'o' ssid)</programlisting></refsect2> + <variablelist role="params"><varlistentry><term><parameter>ssid</parameter>:</term><listitem><simpara>Session ID</simpara></listitem></varlistentry></variablelist><refsect2><title><anchor role="function" id="Seat.CanActivateSessions"/>CanActivateSessions ()</title><indexterm><primary>CanActivateSessions</primary><secondary>Seat</secondary></indexterm><programlisting>CanActivateSessions (out 'b' can_activate)</programlisting></refsect2>Used to determine whether the seat supports session activation. + <variablelist role="params"><varlistentry><term><parameter>can_activate</parameter>:</term><listitem><simpara>TRUE if seat supports session activation</simpara></listitem></varlistentry></variablelist><refsect2><title><anchor role="function" id="Seat.ActivateSession"/>ActivateSession ()</title><indexterm><primary>ActivateSession</primary><secondary>Seat</secondary></indexterm><programlisting>ActivateSession (in 'o' ssid)</programlisting></refsect2> <para>Attempt to activate the specified session. In most cases, if successful, this will cause the session to become visible and take control of the hardware that is diff --git a/src/ck-seat.c b/src/ck-seat.c index 0b8ef80..06f0240 100644 --- a/src/ck-seat.c +++ b/src/ck-seat.c @@ -593,6 +593,20 @@ ck_seat_add_session (CkSeat *seat, } gboolean +ck_seat_can_activate_sessions (CkSeat *seat, + gboolean *can_activate, + GError **error) +{ + g_return_val_if_fail (CK_IS_SEAT (seat), FALSE); + + if (can_activate != NULL) { + *can_activate = (seat->priv->kind == CK_SEAT_KIND_STATIC); + } + + return TRUE; +} + +gboolean ck_seat_get_kind (CkSeat *seat, CkSeatKind *kind, GError **error) diff --git a/src/ck-seat.h b/src/ck-seat.h index 0b13eb4..4707bf9 100644 --- a/src/ck-seat.h +++ b/src/ck-seat.h @@ -89,22 +89,22 @@ gboolean ck_seat_set_active_session (CkSeat *seat, GError **error); /* exported methods */ -gboolean ck_seat_get_id (CkSeat *seat, - char **sid, - GError **error); -gboolean ck_seat_get_seat_type (CkSeat *seat, - char **type, - GError **error); -gboolean ck_seat_get_sessions (CkSeat *seat, - GPtrArray **sessions, - GError **error); -gboolean ck_seat_get_active_session (CkSeat *seat, - char **ssid, - GError **error); - -gboolean ck_seat_activate_session (CkSeat *seat, - const char *ssid, - DBusGMethodInvocation *context); +gboolean ck_seat_get_id (CkSeat *seat, + char **sid, + GError **error); +gboolean ck_seat_get_sessions (CkSeat *seat, + GPtrArray **sessions, + GError **error); +gboolean ck_seat_get_active_session (CkSeat *seat, + char **ssid, + GError **error); + +gboolean ck_seat_can_activate_sessions (CkSeat *seat, + gboolean *can_activate, + GError **error); +gboolean ck_seat_activate_session (CkSeat *seat, + const char *ssid, + DBusGMethodInvocation *context); G_END_DECLS diff --git a/src/ck-seat.xml b/src/ck-seat.xml index c6d3ed6..5fda057 100644 --- a/src/ck-seat.xml +++ b/src/ck-seat.xml @@ -10,6 +10,9 @@ <method name="GetActiveSession"> <arg name="ssid" direction="out" type="o"/> </method> + <method name="CanActivateSessions"> + <arg name="can_activate" direction="out" type="b"/> + </method> <method name="ActivateSession"> <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> <arg name="ssid" direction="in" type="o"/> diff --git a/src/test-fus b/src/test-fus index 3ac7921..f904ea9 100755 --- a/src/test-fus +++ b/src/test-fus @@ -45,6 +45,12 @@ seat.connect_to_signal ('SessionAdded', session_added_cb) seat.connect_to_signal ('SessionRemoved', session_removed_cb) seat.connect_to_signal ('ActiveSessionChanged', active_session_changed_cb) +can_fus = seat.CanActivateSessions() +if can_fus: + print "The current seat supports session switching" +else: + print "The current seat does not support session switching" + # Show a list of sessions on the current seat sessions = seat.GetSessions () for ssid in sessions: |