From 8b42a4928a0a266c3b3ae6bb13997764bc7f6405 Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Tue, 13 Mar 2007 03:42:04 -0400 Subject: add the last bits of spec framework The spec is the introspection format extended with docs. There are tools to build docbook and strip the docs to make dbus introspect xml. --- doc/xml/ck-introduction.xml | 20 ++++ doc/xml/ref-ck-manager.xml | 174 ++++++++++++++++++++++++++++++++ doc/xml/ref-ck-seat.xml | 72 +++++++++++++ doc/xml/ref-ck-session.xml | 240 ++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 506 insertions(+) create mode 100644 doc/xml/ck-introduction.xml create mode 100644 doc/xml/ref-ck-manager.xml create mode 100644 doc/xml/ref-ck-seat.xml create mode 100644 doc/xml/ref-ck-session.xml (limited to 'doc/xml') diff --git a/doc/xml/ck-introduction.xml b/doc/xml/ck-introduction.xml new file mode 100644 index 0000000..4f6acbd --- /dev/null +++ b/doc/xml/ck-introduction.xml @@ -0,0 +1,20 @@ + + Introduction + + + About + + ConsoleKit is a framework for keeping track of the various + users, sessions, and seats present on a system. It + provides a mechanism for software to react to changes of any of + these items or of any of the metadata associated with them. + + + + + Defining the Problem + + + + + diff --git a/doc/xml/ref-ck-manager.xml b/doc/xml/ref-ck-manager.xml new file mode 100644 index 0000000..dc01375 --- /dev/null +++ b/doc/xml/ref-ck-manager.xml @@ -0,0 +1,174 @@ + + + org.freedesktop.ConsoleKit.Manager + + + org.freedesktop.ConsoleKit.Manager + Manager interface + + + Methods + OpenSession (out 's' cookie) +OpenSessionWithParameters (in 'a(sv)' parameters, + out 's' cookie) +CloseSession (in 's' cookie, + out 'b' result) +GetSeats (out 'ao' seats) +GetSessionForCookie (in 's' cookie, + out 'o' ssid) +GetSessionForUnixProcess (in 'u' pid, + out 'o' ssid) +GetCurrentSession (out 'o' ssid) +GetSessionsForUser (in 'u' uid, + out 'ao' sessions) +GetSystemIdleHint (out 'b' idle_hint) +GetSystemIdleSinceHint (out 's' iso8601_datetime) + + + + Signals + SeatAdded ('o' sid) +SeatRemoved ('o' sid) +SystemIdleHintChanged ('b' hint) + + + + Implemented Interfaces + org.freedesktop.ConsoleKit.Manager implements + org.freedesktop.DBus.Introspectable, + org.freedesktop.DBus.Properties + + + + Properties + + + + Description + + + Details<anchor role="function" id="Manager.OpenSession"/>OpenSession ()OpenSessionManagerOpenSession (out 's' cookie) + This method requests that a new Session + be created for the calling process. The properties of this new Session are set automatically + from information collected about the calling process. + + This new session exists until the calling process disconnects from the system bus or + calls CloseSession(). + + It is the responsibility of the calling process to set the environment variable + XDG_SESSION_COOKIE to the value of the returned cookie. This cookie should only + be made available to child processes of the caller so that they may be identified + as members of this session. + + See this simple example: + + DBusError error; + DBusMessage *message; + DBusMessage *reply; + + message = dbus_message_new_method_call ("org.freedesktop.ConsoleKit", + "/org/freedesktop/ConsoleKit/Manager", + "org.freedesktop.ConsoleKit.Manager", + "OpenSession"); + if (message == NULL) { + goto out; + } + + dbus_error_init (&error); + reply = dbus_connection_send_with_reply_and_block (connector->connection, + message, + -1, + &error); + if (reply == NULL) { + goto out; + } + + dbus_error_init (&error); + if (! dbus_message_get_args (reply, + &error, + DBUS_TYPE_STRING, &cookie, + DBUS_TYPE_INVALID)) { + goto out; + } + + + cookie:The secret cookie that is used to identify the new session +See also: +OpenSessionWithParameters()<anchor role="function" id="Manager.OpenSessionWithParameters"/>OpenSessionWithParameters ()OpenSessionWithParametersManagerOpenSessionWithParameters (in 'a(sv)' parameters, + out 's' cookie) + This method requests that a new Session + be created for the calling process. The properties of this new Session are from the + parameters provided. + + This new session exists until the calling process disconnects from the system bus or + calls CloseSession(). + + It is the responsibility of the calling process to set the environment variable + XDG_SESSION_COOKIE to the value of the returned cookie. This cookie should only + be made available to child processes of the caller so that they may be identified + as members of this session. + + See the Session properties for a list of valid parameters. + parameters:An array of sets of property names and valuescookie:The secret cookie that is used to identify the new sessionThis method is restricted to privileged users by D-Bus policy. +See also: +org.freedesktop.ConsoleKit.Session<anchor role="function" id="Manager.CloseSession"/>CloseSession ()CloseSessionManagerCloseSession (in 's' cookie, + out 'b' result) + This method is used to close the session identified by the supplied cookie. + + The session can only be closed by the same process that opened the session. + + cookie:The secret cookie that is used to identify the sessionresult:Whether the session was successfully closed<anchor role="function" id="Manager.GetSeats"/>GetSeats ()GetSeatsManagerGetSeats (out 'ao' seats) + This gets a list of all the Seats + that are currently present on the system. + Each Seat ID is an D-Bus object path for the object that implements the + Seat interface. + seats:an array of Seat IDs +See also: +org.freedesktop.ConsoleKit.Seat<anchor role="function" id="Manager.GetSessionForCookie"/>GetSessionForCookie ()GetSessionForCookieManagerGetSessionForCookie (in 's' cookie, + out 'o' ssid) + Returns the session ID that is associated with the specified cookie. + + cookie:The secret cookie that is used to identify the sessionssid:The object identifier for the current session<anchor role="function" id="Manager.GetSessionForUnixProcess"/>GetSessionForUnixProcess ()GetSessionForUnixProcessManagerGetSessionForUnixProcess (in 'u' pid, + out 'o' ssid) + Attempts to determine the session ID for the specified + POSIX process ID (pid). + + pid:The POSIX process IDssid:The object identifier for the current session<anchor role="function" id="Manager.GetCurrentSession"/>GetCurrentSession ()GetCurrentSessionManagerGetCurrentSession (out 'o' ssid) + Attempts to determine the session ID that the caller belongs to. + + See this example of using dbus-send: + + dbus-send --system --dest=org.freedesktop.ConsoleKit \ + --type=method_call --print-reply --reply-timeout=2000 \ + /org/freedesktop/ConsoleKit/Manager \ + org.freedesktop.ConsoleKit.Manager.GetCurrentSession + + ssid:The object identifier for the current session<anchor role="function" id="Manager.GetSessionsForUser"/>GetSessionsForUser ()GetSessionsForUserManagerGetSessionsForUser (in 'u' uid, + out 'ao' sessions) + This gets a list of all the Sessions + that are currently open for the specified user. + Each Session ID is an D-Bus object path for the object that implements the + Session interface. + uid:User identificationsessions:an array of Session IDs<anchor role="function" id="Manager.GetSystemIdleHint"/>GetSystemIdleHint ()GetSystemIdleHintManagerGetSystemIdleHint (out 'b' idle_hint) + Returns TRUE if the idle-hint + property of every open session is TRUE or if there are no open sessions. + + idle_hint:The value of the system-idle-hint<anchor role="function" id="Manager.GetSystemIdleSinceHint"/>GetSystemIdleSinceHint ()GetSystemIdleSinceHintManagerGetSystemIdleSinceHint (out 's' iso8601_datetime) + Returns an ISO 8601 date-time string that corresponds to + the time of the last change of the system-idle-hint. + + iso8601_datetime:An ISO 8601 format date-type string + Signal Details<anchor role="function" id="Manager::SeatAdded"/>The SeatAdded signalSeatAddedManagerSeatAdded ('o' sid) + Emitted when a Seat has been added to the system. + + sid:The Seat ID for the added seat<anchor role="function" id="Manager::SeatRemoved"/>The SeatRemoved signalSeatRemovedManagerSeatRemoved ('o' sid) + Emitted when a Seat has been removed from the system. + + sid:The Seat ID for the removed seat<anchor role="function" id="Manager::SystemIdleHintChanged"/>The SystemIdleHintChanged signalSystemIdleHintChangedManagerSystemIdleHintChanged ('b' hint) + Emitted when the value of the system-idle-hint has changed. + + hint:The value of the system-idle-hint + + Property Details + + diff --git a/doc/xml/ref-ck-seat.xml b/doc/xml/ref-ck-seat.xml new file mode 100644 index 0000000..6161207 --- /dev/null +++ b/doc/xml/ref-ck-seat.xml @@ -0,0 +1,72 @@ + + + org.freedesktop.ConsoleKit.Seat + + + org.freedesktop.ConsoleKit.Seat + Seat interface + + + Methods + GetId (out 'o' sid) +GetSessions (out 'ao' sessions) +GetActiveSession (out 'o' ssid) +ActivateSession (in 'o' ssid) + + + + Signals + ActiveSessionChanged ('o' ssid) +SessionAdded ('o' ssid) +SessionRemoved ('o' ssid) + + + + Implemented Interfaces + org.freedesktop.ConsoleKit.Seat implements + org.freedesktop.DBus.Introspectable, + org.freedesktop.DBus.Properties + + + + Properties + + + + Description + + + A seat is a collection of sessions and a set of hardware (usually at +least a keyboard and mouse). Only one session may be active on a +seat at a time. + + + + Details<anchor role="function" id="Seat.GetId"/>GetId ()GetIdSeatGetId (out 'o' sid)Returns the ID for Seat. + sid:Seat ID<anchor role="function" id="Seat.GetSessions"/>GetSessions ()GetSessionsSeatGetSessions (out 'ao' sessions) + This gets a list of all the Sessions + that are currently attached to this seat. + Each Session ID is an D-Bus object path for the object that implements the + Session interface. + sessions:an array of Session IDs<anchor role="function" id="Seat.GetActiveSession"/>GetActiveSession ()GetActiveSessionSeatGetActiveSession (out 'o' ssid) + Gets the Session ID that is currently active on this Seat. + Returns NULL if there is no active session. + ssid:Session ID<anchor role="function" id="Seat.ActivateSession"/>ActivateSession ()ActivateSessionSeatActivateSession (in 'o' ssid) + 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 + associated with this seat. + ssid:Session ID +See also: +Activate() + Signal Details<anchor role="function" id="Seat::ActiveSessionChanged"/>The ActiveSessionChanged signalActiveSessionChangedSeatActiveSessionChanged ('o' ssid) + Emitted when the active session has changed. + ssid:Session ID<anchor role="function" id="Seat::SessionAdded"/>The SessionAdded signalSessionAddedSeatSessionAdded ('o' ssid) + Emitted when a session has been added to the seat. + ssid:Session ID<anchor role="function" id="Seat::SessionRemoved"/>The SessionRemoved signalSessionRemovedSeatSessionRemoved ('o' ssid) + Emitted when a session has been removed from the seat. + ssid:Session ID + + Property Details + + diff --git a/doc/xml/ref-ck-session.xml b/doc/xml/ref-ck-session.xml new file mode 100644 index 0000000..2c5d369 --- /dev/null +++ b/doc/xml/ref-ck-session.xml @@ -0,0 +1,240 @@ + + + org.freedesktop.ConsoleKit.Session + + + org.freedesktop.ConsoleKit.Session + Session interface + + + Methods + GetId (out 'o' ssid) +GetSeatId (out 'o' sid) +GetSessionType (out 's' type) +GetUser (out 'i' uid) +GetX11Display (out 's' display) +GetX11DisplayDevice (out 's' x11_display_device) +GetDisplayDevice (out 's' display_device) +GetRemoteHostName (out 's' remote_host_name) +IsActive (out 'b' active) +IsLocal (out 'b' local) +GetCreationTime (out 's' iso8601_datetime) +Activate () +Lock () +Unlock () +GetIdleHint (out 'b' idle_hint) +GetIdleSinceHint (out 's' iso8601_datetime) +SetIdleHint (in 'b' idle_hint) + + + + Signals + ActiveChanged ('b' is_active) +IdleHintChanged ('b' hint) +Lock () +Unlock () + + + + Implemented Interfaces + org.freedesktop.ConsoleKit.Session implements + org.freedesktop.DBus.Introspectable, + org.freedesktop.DBus.Properties + + + + Properties + 'user' readwrite 'u' +'session-type' readwrite 's' +'remote-host-name' readwrite 's' +'display-device' readwrite 's' +'x11-display' readwrite 's' +'x11-display-device' readwrite 's' +'active' readwrite 'b' +'is-local' readwrite 'b' +'idle-hint' readwrite 'b' + + + + Description + + + Session objects represent and store information + related to a user session. + + The properties associated with the Session + specifically refer to the properties of the "session leader". + + + + + Details<anchor role="function" id="Session.GetId"/>GetId ()GetIdSessionGetId (out 'o' ssid)Returns the ID for Session. + ssid:Session ID<anchor role="function" id="Session.GetSeatId"/>GetSeatId ()GetSeatIdSessionGetSeatId (out 'o' sid)Returns the ID for the Seat the Session is + attached to. + sid:Seat ID +See also: +org.freedesktop.ConsoleKit.Seat<anchor role="function" id="Session.GetSessionType"/>GetSessionType ()GetSessionTypeSessionGetSessionType (out 's' type) + Returns the type of the session. + Warning: we haven't yet defined the allowed values for this property. + It is probably best to avoid this until we do. + + type:Session type +See also: +session-type<anchor role="function" id="Session.GetUser"/>GetUser ()GetUserSessionGetUser (out 'i' uid)Returns the user that the session belongs to. + uid:User ID +See also: +user<anchor role="function" id="Session.GetX11Display"/>GetX11Display ()GetX11DisplaySessionGetX11Display (out 's' display)Returns the value of the X11 DISPLAY for this session + if one is present. + display:The value of the X11 display +See also: +x11-display<anchor role="function" id="Session.GetX11DisplayDevice"/>GetX11DisplayDevice ()GetX11DisplayDeviceSessionGetX11DisplayDevice (out 's' x11_display_device)Returns the value of the display device (aka TTY) that the + X11 display for the session is connected to. If there is no x11-display set then this value + is undefined. + x11_display_device:The value of the X11 display device +See also: +x11-display-device<anchor role="function" id="Session.GetDisplayDevice"/>GetDisplayDevice ()GetDisplayDeviceSessionGetDisplayDevice (out 's' display_device)Returns the value of the display device (aka TTY) that the + session is connected to. + display_device:The value of the display device +See also: +display-device<anchor role="function" id="Session.GetRemoteHostName"/>GetRemoteHostName ()GetRemoteHostNameSessionGetRemoteHostName (out 's' remote_host_name)Returns the value of the remote host name for the session. + + remote_host_name:The remote host name +See also: +remote-host-name<anchor role="function" id="Session.IsActive"/>IsActive ()IsActiveSessionIsActive (out 'b' active)Returns whether the session is active on the Seat that + it is attached to. + If the session is not attached to a seat this value is undefined. + + active:TRUE if the session is active, otherwise FALSE +See also: +active<anchor role="function" id="Session.IsLocal"/>IsLocal ()IsLocalSessionIsLocal (out 'b' local)Returns whether the session is local + FIXME: we need to come up with a concrete definition for this value. + It was originally used as a way to identify XDMCP sessions that originate + from a remote system. + + local:TRUE if the session is local, otherwise FALSE +See also: +is-local<anchor role="function" id="Session.GetCreationTime"/>GetCreationTime ()GetCreationTimeSessionGetCreationTime (out 's' iso8601_datetime) + Returns an ISO 8601 date-time string that corresponds to + the time that the session was opened. + + iso8601_datetime:An ISO 8601 format date-type string<anchor role="function" id="Session.Activate"/>Activate ()ActivateSessionActivate () + Attempt to activate the this session. In most + cases, if successful, this will cause the session to + become visible and become active on the seat that it + is attached to. + +See also: +Seat.ActivateSession()<anchor role="function" id="Session.Lock"/>Lock ()LockSessionLock () + This will cause a Lock + signal to be emitted for this session. + + +See also: +Lock signal<anchor role="function" id="Session.Unlock"/>Unlock ()UnlockSessionUnlock () + This will cause an Unlock + signal to be emitted for this session. + + This can be used by login managers to unlock a session before it is + re-activated during fast-user-switching. + + +See also: +Unlock signal<anchor role="function" id="Session.GetIdleHint"/>GetIdleHint ()GetIdleHintSessionGetIdleHint (out 'b' idle_hint) + Gets the value of the idle-hint + property. + + idle_hint:The value of the idle-hint +See also: +idle-hint<anchor role="function" id="Session.GetIdleSinceHint"/>GetIdleSinceHint ()GetIdleSinceHintSessionGetIdleSinceHint (out 's' iso8601_datetime) + Returns an ISO 8601 date-time string that corresponds to + the time of the last change of the idle-hint. + + iso8601_datetime:An ISO 8601 format date-type string<anchor role="function" id="Session.SetIdleHint"/>SetIdleHint ()SetIdleHintSessionSetIdleHint (in 'b' idle_hint) + This may be used by the session to indicate that + it is idle. + + Use of this method is restricted to the user + that owns the session. + idle_hint:boolean value to set the idle-hint to + Signal Details<anchor role="function" id="Session::ActiveChanged"/>The ActiveChanged signalActiveChangedSessionActiveChanged ('b' is_active) + Emitted when the active property has changed. + is_active:TRUE if the session is active, otherwise FALSE<anchor role="function" id="Session::IdleHintChanged"/>The IdleHintChanged signalIdleHintChangedSessionIdleHintChanged ('b' hint) + Emitted when the idle-hint property has changed. + hint:the new value of idle-hint<anchor role="function" id="Session::Lock"/>The Lock signalLockSessionLock () + Emitted in response to a call to the Lock() method. + It is intended that the screensaver for the session should lock the screen in response to this signal. + <anchor role="function" id="Session::Unlock"/>The Unlock signalUnlockSessionUnlock () + Emitted in response to a call to the Unlock() method. + It is intended that the screensaver for the session should unlock the screen in response to this signal. + + Property Details<anchor role="function" id="Session:user"/>The "user" propertyuserSession'user' readwrite 'u' + + The user assigned to the session. + <anchor role="function" id="Session:session-type"/>The "session-type" propertysession-typeSession'session-type' readwrite 's' + + The type of the session. + Warning: we haven't yet defined the allowed values for this property. + It is probably best to avoid this until we do. + + <anchor role="function" id="Session:remote-host-name"/>The "remote-host-name" propertyremote-host-nameSession'remote-host-name' readwrite 's' + + The remote host name for the session. + + This will be set in situations where the session is + opened and controlled from a remote system. + + For example, this value will be set when the + session is created from an SSH or XDMCP connection. + + <anchor role="function" id="Session:display-device"/>The "display-device" propertydisplay-deviceSession'display-device' readwrite 's' + + The display device (aka TTY) that the + session is connected to. + + <anchor role="function" id="Session:x11-display"/>The "x11-display" propertyx11-displaySession'x11-display' readwrite 's' + + Value of the X11 DISPLAY for this session + if one is present. + + <anchor role="function" id="Session:x11-display-device"/>The "x11-display-device" propertyx11-display-deviceSession'x11-display-device' readwrite 's' + + + The display device (aka TTY) that the X11 display for the + session is connected to. If there is no x11-display set then + this value is undefined. + + <anchor role="function" id="Session:active"/>The "active" propertyactiveSession'active' readwrite 'b' + + + Whether the session is active on the Seat that + it is attached to. + If the session is not attached to a seat this value is undefined. + + <anchor role="function" id="Session:is-local"/>The "is-local" propertyis-localSession'is-local' readwrite 'b' + + + Whether the session is local + FIXME: we need to come up with a concrete definition for this value. + It was originally used as a way to identify XDMCP sessions that originate + from a remote system. + + <anchor role="function" id="Session:idle-hint"/>The "idle-hint" propertyidle-hintSession'idle-hint' readwrite 'b' + + + This is a hint used to indicate that the session may be idle. + + + For sessions with a x11-display set (ie. graphical + sessions), it is up to each session to delegate the + responsibility for updating this value. Typically, the + screensaver will set this. + + However, for non-graphical sessions with a display-device set + the Session object itself will periodically update this value based + on the activity detected on the display-device itself. + + + This should not be considered authoritative. + + + -- cgit