From eed04dff5181b860c8c86281e94018f8228ddc72 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 12 Mar 2010 13:43:37 -0600 Subject: Simple starter object for making the dbus interface. --- src/Makefile.am | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/Makefile.am') diff --git a/src/Makefile.am b/src/Makefile.am index cd525bd..d8d8acd 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -50,6 +50,8 @@ indicator_session_service_SOURCES = \ lock-helper.c \ lock-helper.h \ session-service.c \ + session-dbus.c \ + session-dbus.h \ dbusmenu-shared.h \ gconf-helper.c \ users-service-dbus.h \ -- cgit v1.2.3 From 64c34204592848587c9b965c339d75305b35eebe Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 12 Mar 2010 14:00:20 -0600 Subject: Setting up session dbus interface client server stuff. --- .bzrignore | 2 ++ src/Makefile.am | 19 +++++++++++++++++++ src/session-dbus.xml | 15 +++++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 src/session-dbus.xml (limited to 'src/Makefile.am') diff --git a/.bzrignore b/.bzrignore index c993ea1..bf3135e 100644 --- a/.bzrignore +++ b/.bzrignore @@ -55,3 +55,5 @@ indicator-session-[0-9].[0-9].tar.gz indicator-session-[0-9].[0-9].[0-9].tar.gz.asc indicator-session-[0-9].[0-9].tar.gz.asc src/consolekit-manager-client.h +src/session-dbus-client.h +src/session-dbus-server.h diff --git a/src/Makefile.am b/src/Makefile.am index d8d8acd..3037a3b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -11,6 +11,7 @@ sessionlibdir = $(INDICATORDIR) sessionlib_LTLIBRARIES = libsession.la libsession_la_SOURCES = \ indicator-session.c \ + session-dbus-client.h \ dbus-shared-names.h \ dbusmenu-shared.h \ users-service-client.h @@ -32,6 +33,20 @@ users-service-client.h: $(srcdir)/users-service.xml --output=users-service-client.h \ $(srcdir)/users-service.xml +session-dbus-client.h: $(srcdir)/session-dbus.xml + dbus-binding-tool \ + --prefix=_session_dbus_client \ + --mode=glib-client \ + --output=session-dbus-client.h \ + $(srcdir)/session-dbus.xml + +session-dbus-server.h: $(srcdir)/session-dbus.xml + dbus-binding-tool \ + --prefix=_session_dbus_server \ + --mode=glib-server \ + --output=session-dbus-server.h \ + $(srcdir)/session-dbus.xml + users-service-marshal.h: $(srcdir)/users-service.list glib-genmarshal --header \ --prefix=_users_service_marshal $(srcdir)/users-service.list \ @@ -52,6 +67,7 @@ indicator_session_service_SOURCES = \ session-service.c \ session-dbus.c \ session-dbus.h \ + session-dbus-server.h \ dbusmenu-shared.h \ gconf-helper.c \ users-service-dbus.h \ @@ -90,12 +106,15 @@ gtk_logout_helper_LDADD = \ BUILT_SOURCES = \ consolekit-manager-client.h \ + session-dbus-client.h \ + session-dbus-server.h \ users-service-client.h \ users-service-marshal.h \ users-service-marshal.c EXTRA_DIST = \ consolekit-manager.xml \ + session-dbus.xml \ users-service.xml \ users-service.list diff --git a/src/session-dbus.xml b/src/session-dbus.xml new file mode 100644 index 0000000..3ce1693 --- /dev/null +++ b/src/session-dbus.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + -- cgit v1.2.3 From 05cd0a2405c81a1147ae519b9fa89e0579284abe Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 15 Mar 2010 17:02:31 -0500 Subject: Grabbing the upower definition file so that we can build a client for it. --- .bzrignore | 1 + src/Makefile.am | 9 ++ src/upower.xml | 309 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 319 insertions(+) create mode 100644 src/upower.xml (limited to 'src/Makefile.am') diff --git a/.bzrignore b/.bzrignore index bf3135e..f58310b 100644 --- a/.bzrignore +++ b/.bzrignore @@ -57,3 +57,4 @@ indicator-session-[0-9].[0-9].tar.gz.asc src/consolekit-manager-client.h src/session-dbus-client.h src/session-dbus-server.h +src/upower-client.h diff --git a/src/Makefile.am b/src/Makefile.am index 3037a3b..db41db6 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -33,6 +33,13 @@ users-service-client.h: $(srcdir)/users-service.xml --output=users-service-client.h \ $(srcdir)/users-service.xml +upower-client.h: $(srcdir)/upower.xml + dbus-binding-tool \ + --prefix=_upower_client \ + --mode=glib-client \ + --output=upower-client.h \ + $(srcdir)/upower.xml + session-dbus-client.h: $(srcdir)/session-dbus.xml dbus-binding-tool \ --prefix=_session_dbus_client \ @@ -108,6 +115,7 @@ BUILT_SOURCES = \ consolekit-manager-client.h \ session-dbus-client.h \ session-dbus-server.h \ + upower-client.h \ users-service-client.h \ users-service-marshal.h \ users-service-marshal.c @@ -115,6 +123,7 @@ BUILT_SOURCES = \ EXTRA_DIST = \ consolekit-manager.xml \ session-dbus.xml \ + upower.xml \ users-service.xml \ users-service.list diff --git a/src/upower.xml b/src/upower.xml new file mode 100644 index 0000000..a4066ff --- /dev/null +++ b/src/upower.xml @@ -0,0 +1,309 @@ + + + + + + + + The DeviceKit-power service is available via the system message + bus. To access the service, use + the org.freedesktop.UPower interface on + the /org/freedesktop/UPower object on + the D-Bus system bus service with the well-known + name org.freedesktop.UPower. + + + + +$ dbus-send --print-reply \ + --system \ + --dest=org.freedesktop.UPower \ + /org/freedesktop/UPower \ + org.freedesktop.UPower.EnumerateDevices + +method return sender=:1.386 -> dest=:1.451 reply_serial=2 + array [ + object path "/org/freedesktop/UPower/devices/line_power_AC" + object path "/org/freedesktop/UPower/devices/battery_BAT0" + ] + + + + + + + + + + + + An array of object paths for devices. + + + + + + Enumerate all power objects on the system. + + + + + + + + + + Object path of device that was added. + + + + + + Emitted when a device is added. + + + + + + + + + + Object path of device that was removed. + + + + + + Emitted when a device is removed. + + + + + + + + + + Object path of device that was changed. + + + + + + Emitted when a device changed. + + + + + + + + + + + + Emitted when one or more properties on the object changes. + + + + + + + + + + + + This signal is sent when the session is about to be suspended or + hibernated. + Session and system programs have one second to do anything required + before the sleep action is taken (such as sending out Avahi or + Jabber messages). + + + + + + + + + + + + This signal is sent when the session has just returned from + Suspend() or Hibernate(). + Session and system programs can then do anything required (such as + sending out Avahi or Jabber messages). + + + + + + + + + + + + + This method tells UPower that the Suspend() or Hibernate() method + is about to be called. + This allows UPower to emit the Suspending signal whilst + session activities are happening that have to be done before the + suspend process is started. + + + This method would typically be called by the session power + management daemon, before it locks the screen and waits for the + screen to fade to black. + The session power management component would then call Suspend() or + Hibernate() when these syncronous tasks have completed. + + + If this method is not called than nothing bad will happen and + Suspend() or Hibernate() will block for the required second. + + + + + + + + + + + + + Suspends the computer into a low power state. + System state is not preserved if the power is lost. + + + If AboutToRequestSleep() has not been called then UPower will send + the Sleeping() signal and block for one second. + + + If AboutToRequestSleep() has been called less than one second + before this method is called then UPower will block for the + remaining time to complete one second of delay. + + + + + + + + + + + TRUE if allowed, otherwise FALSE + + + + + Check if the caller has (or can get) the PolicyKit privilege to call + Suspend. + + + + + + + + + + + + + Hibernates the computer into a low power state. + System state is preserved if the power is lost. + + + If AboutToRequestSleep() has not been called then UPower will send + the Sleeping() signal and block for one second. + + + If AboutToRequestSleep() has been called less than one second + before this method is called then UPower will block for the + remaining time to complete one second of delay. + + + + + + + + + + + TRUE if allowed, otherwise FALSE + + + + + Check if the caller has (or can get) the PolicyKit privilege to call + Hibernate. + + + + + + + + + + Version of the running daemon, e.g. 002. + + + + + + Whether the system is able to suspend. + + + + + + Whether the system is able to hibernate. + + + + + + Indicates whether the system is running on battery power. + This property is provided for convenience. + + + + + + Indicates whether the system is running on battery power and if the battery is critically low. + This property is provided for convenience. + + + + + + + + Indicates if the laptop lid is closed where the display cannot be seen. + + + + + + + + + + If the system has a lid device. + + + + + + + + -- cgit v1.2.3 From 9d36c2090992551a961005bf359cdab739c8beed Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 16 Mar 2010 20:32:20 -0500 Subject: Adding in the GDM local display DBus interface spec. --- .bzrignore | 1 + src/Makefile.am | 9 +++++++++ src/gdm-local-display-factory.xml | 20 ++++++++++++++++++++ 3 files changed, 30 insertions(+) create mode 100644 src/gdm-local-display-factory.xml (limited to 'src/Makefile.am') diff --git a/.bzrignore b/.bzrignore index f58310b..aeebd57 100644 --- a/.bzrignore +++ b/.bzrignore @@ -58,3 +58,4 @@ src/consolekit-manager-client.h src/session-dbus-client.h src/session-dbus-server.h src/upower-client.h +src/gdm-local-display-factory-client.h diff --git a/src/Makefile.am b/src/Makefile.am index db41db6..01a88a3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -26,6 +26,13 @@ consolekit-manager-client.h: $(srcdir)/consolekit-manager.xml --output=consolekit-manager-client.h \ $(srcdir)/consolekit-manager.xml +gdm-local-display-factory-client.h: $(srcdir)/gdm-local-display-factory.xml + dbus-binding-tool \ + --prefix=_gdm_local_display_factory_client \ + --mode=glib-client \ + --output=gdm-local-display-factory-client.h \ + $(srcdir)/gdm-local-display-factory.xml + users-service-client.h: $(srcdir)/users-service.xml dbus-binding-tool \ --prefix=_users_service_client \ @@ -113,6 +120,7 @@ gtk_logout_helper_LDADD = \ BUILT_SOURCES = \ consolekit-manager-client.h \ + gdm-local-display-factory-client.h \ session-dbus-client.h \ session-dbus-server.h \ upower-client.h \ @@ -122,6 +130,7 @@ BUILT_SOURCES = \ EXTRA_DIST = \ consolekit-manager.xml \ + gdm-local-display-factory.xml \ session-dbus.xml \ upower.xml \ users-service.xml \ diff --git a/src/gdm-local-display-factory.xml b/src/gdm-local-display-factory.xml new file mode 100644 index 0000000..66fb77c --- /dev/null +++ b/src/gdm-local-display-factory.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3 From 8b77c4fe175b42d06e3e37be5645edafde53ae58 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 17 Mar 2010 08:09:07 -0500 Subject: Grabbing the session interface from consolekit --- .bzrignore | 1 + src/Makefile.am | 9 + src/consolekit-session.xml | 435 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 445 insertions(+) create mode 100644 src/consolekit-session.xml (limited to 'src/Makefile.am') diff --git a/.bzrignore b/.bzrignore index aeebd57..0ba1e24 100644 --- a/.bzrignore +++ b/.bzrignore @@ -59,3 +59,4 @@ src/session-dbus-client.h src/session-dbus-server.h src/upower-client.h src/gdm-local-display-factory-client.h +src/consolekit-session-client.h diff --git a/src/Makefile.am b/src/Makefile.am index 01a88a3..24e00e4 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -26,6 +26,13 @@ consolekit-manager-client.h: $(srcdir)/consolekit-manager.xml --output=consolekit-manager-client.h \ $(srcdir)/consolekit-manager.xml +consolekit-session-client.h: $(srcdir)/consolekit-session.xml + dbus-binding-tool \ + --prefix=_consolekit_session_client \ + --mode=glib-client \ + --output=consolekit-session-client.h \ + $(srcdir)/consolekit-session.xml + gdm-local-display-factory-client.h: $(srcdir)/gdm-local-display-factory.xml dbus-binding-tool \ --prefix=_gdm_local_display_factory_client \ @@ -120,6 +127,7 @@ gtk_logout_helper_LDADD = \ BUILT_SOURCES = \ consolekit-manager-client.h \ + consolekit-session-client.h \ gdm-local-display-factory-client.h \ session-dbus-client.h \ session-dbus-server.h \ @@ -130,6 +138,7 @@ BUILT_SOURCES = \ EXTRA_DIST = \ consolekit-manager.xml \ + consolekit-session.xml \ gdm-local-display-factory.xml \ session-dbus.xml \ upower.xml \ diff --git a/src/consolekit-session.xml b/src/consolekit-session.xml new file mode 100644 index 0000000..b6e1cdb --- /dev/null +++ b/src/consolekit-session.xml @@ -0,0 +1,435 @@ + + + + + + + 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". + + + + + + + Session ID + + + + Returns the ID for Session. + + + + + + + Seat ID + + + + Returns the ID for the Seat the Session is + attached to. + + org.freedesktop.ConsoleKit.Seat + + + + + + Session 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. + + + session-type + + + + + + User ID + + + + Returns the user that the session belongs to. + + + user + + + + + + POSIX User ID + + + + Returns the POSIX user ID that the session belongs to. + + unix-user + + + + + + The value of the X11 display + + + + Returns the value of the X11 DISPLAY for this session + if one is present. + + x11-display + + + + + + The value of the 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 display device + + + + Returns the value of the display device (aka TTY) that the + session is connected to. + + display-device + + + + + + The remote host name + + + + Returns the value of the remote host name for the session. + + + remote-host-name + + + + + + The value of the native system login session ID + + + + Returns the value of the login session ID that the + underlying system uses to enforce session boundaries. If there is no login session ID + set then this value is an empty string. + + + + + + + TRUE if the session is active, otherwise FALSE + + + + 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 local, otherwise FALSE + + + + 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. + + + is-local + + + + + + An ISO 8601 format date-type string + + + + + Returns an ISO 8601 date-time string that corresponds to + the time that the session was opened. + + + + + + + + + + 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. + + Seat.ActivateSession() + + + + + + + This will cause a Lock + signal to be emitted for this session. + + + This method is restricted to privileged users by D-Bus policy. + Lock signal + + + + + + + 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. + + + This method is restricted to privileged users by D-Bus policy. + Unlock signal + + + + + + + The value of the idle-hint + + + + + Gets the value of the idle-hint + property. + + + idle-hint + + + + + + An ISO 8601 format date-type string + + + + + Returns an ISO 8601 date-time string that corresponds to + the time of the last change of the idle-hint. + + + + + + + + + boolean value to set the idle-hint to + + + + + 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. + + + + + + + + TRUE if the session is active, otherwise FALSE + + + + + Emitted when the active property has changed. + + + + + + + the new value of idle-hint + + + + + Emitted when the idle-hint property has changed. + + + + + + + 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. + + + + + + + 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. + + + + + + + + The user assigned to the session. + + + + + + + The user assigned to the session. + + + + + + + + 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. + + + + + + + + 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. + + + + + + + + The display device (aka TTY) that the + session is connected to. + + + + + + + + Value of the X11 DISPLAY for this session + if one is present. + + + + + + + + + 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. + + + + + + + + + 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. + + + + + + + + + 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. + + + + + + + + + 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 v1.2.3