On Fri, 2008-11-14 at 15:45 +0100, Kevin Ottens wrote:
> > I'm happy to roll a 0.3 version without those methods if that's what
> you
> > want. Thanks for looking at this.
> 
> Yup, that'd be perfect for me. I'll consider that a done deal then and
> switch 
> our stuff to refer to the org.freedesktop.PowerManagement* interfaces
> now.

Something like the attached patch?

Richard.

--- power-management-spec-0.2.xml	2007-04-02 22:50:29.000000000 +0100
+++ power-management-spec-0.3.xml	2008-11-14 16:08:07.000000000 +0000
@@ -5,8 +5,8 @@
 <article id="index">
   <articleinfo>
     <title>Power Management Specification</title>
-    <releaseinfo>Version 0.2</releaseinfo>
-    <date>March 30 2007</date>
+    <releaseinfo>Version 0.3</releaseinfo>
+    <date>November 14 2008</date>
     <authorgroup>
       <author>
         <firstname>Richard</firstname>
@@ -36,10 +36,10 @@
       This can be used by desktop applications to become more power aware.
     </para>
     <para>
-        <literal>org.freedesktop.PowerManagement</literal> is the only
-        compulsory interface to implement, although other optional interfaces
-        exist and others may be proposed in the future for other aspects of
-        session power management.
+      <literal>org.freedesktop.PowerManagement</literal> is the only
+      compulsory interface to implement, although other optional interfaces
+      exist and others may be proposed in the future for other aspects of
+      session power management.
     </para>
   </sect1>
 
@@ -65,12 +65,6 @@
         </listitem>
         <listitem>
           <para>
-            A partition editor should not attempt to apply changes when the
-            battery is discharging and low.
-          </para>
-        </listitem>
-        <listitem>
-          <para>
             A video player should use a less precise codec to save power when
             the system is in a low power state.
           </para>
@@ -149,20 +143,6 @@
               <entry>Attempt to hibernate the system.</entry>
             </row>
             <row>
-              <entry><literal>Shutdown</literal></entry>
-              <entry></entry>
-              <entry></entry>
-              <entry><literal>PermissionDenied</literal>, <literal>NoHardwareSupport</literal></entry>
-              <entry>Attempt to shutdown the system.</entry>
-            </row>
-            <row>
-              <entry><literal>Reboot</literal></entry>
-              <entry></entry>
-              <entry></entry>
-              <entry><literal>PermissionDenied</literal>, <literal>NoHardwareSupport</literal></entry>
-              <entry>Attempt to reboot the system.</entry>
-            </row>
-            <row>
               <entry><literal>CanSuspend</literal></entry>
               <entry></entry>
               <entry><literal>bool</literal> can_suspend</entry>
@@ -177,20 +157,6 @@
               <entry>If the current session user is able to hibernate the system.</entry>
             </row>
             <row>
-              <entry><literal>CanShutdown</literal></entry>
-              <entry></entry>
-              <entry><literal>bool</literal> can_shutdown</entry>
-              <entry></entry>
-              <entry>If the current session user is able to shutdown the system.</entry>
-            </row>
-            <row>
-              <entry><literal>CanReboot</literal></entry>
-              <entry></entry>
-              <entry><literal>bool</literal> can_reboot</entry>
-              <entry></entry>
-              <entry>If the current session user is able to reboot the system.</entry>
-            </row>
-            <row>
               <entry><literal>GetPowerSaveStatus</literal></entry>
               <entry></entry>
               <entry><literal>bool</literal> save_power</entry>
@@ -203,31 +169,6 @@
                 tasks when we are trying to save power.
               </entry>
             </row>
-            <row>
-              <entry><literal>GetOnBattery</literal></entry>
-              <entry></entry>
-              <entry><literal>bool</literal> on_battery</entry>
-              <entry></entry>
-              <entry>
-                Returns the system power state, i.e. if we are running on
-                battery power.
-                This method may still return true on AC using a desktop system
-                if the computer is using backup power from a monitored UPS.
-              </entry>
-            </row>
-            <row>
-              <entry><literal>GetLowBattery</literal></entry>
-              <entry></entry>
-              <entry><literal>bool</literal> low_battery</entry>
-              <entry></entry>
-              <entry>
-                Returns true if the battery is low and discharging.
-                This may be measured with time remaining or percentage change,
-                and the exact threshold level is an implementation detail.
-                Programs that cannot deal with a low power action such as
-                suspend or hibernate should not run if this method returns true.
-              </entry>
-            </row>
           </tbody>
         </tgroup>
       </table>
@@ -253,30 +194,10 @@
               <entry>Signals the hibernate status has changed.</entry>
             </row>
             <row>
-              <entry><literal>CanShutdownChanged</literal></entry>
-              <entry><literal>bool</literal> can_shutdown</entry>
-              <entry>Signals the shutdown status has changed.</entry>
-            </row>
-            <row>
-              <entry><literal>CanRebootChanged</literal></entry>
-              <entry><literal>bool</literal> can_reboot</entry>
-              <entry>Signals the reboot status has changed.</entry>
-            </row>
-            <row>
               <entry><literal>PowerSaveStatusChanged</literal></entry>
               <entry><literal>bool</literal> save_power</entry>
               <entry>Signals the low power mode has changed..</entry>
             </row>
-            <row>
-              <entry><literal>OnBatteryChanged</literal></entry>
-              <entry><literal>bool</literal> on_battery</entry>
-              <entry>Signals the battery discharge state has changed.</entry>
-            </row>
-            <row>
-              <entry><literal>LowBatteryChanged</literal></entry>
-              <entry><literal>bool</literal> on_battery</entry>
-              <entry>Signals the battery low power state has changed.</entry>
-            </row>
           </tbody>
         </tgroup>
       </table>
@@ -323,7 +244,7 @@
 import dbus
 import time
 bus = dbus.Bus(dbus.Bus.TYPE_SESSION)
-devobj = bus.get_object('org.freedesktop.PowerManagement', '/org/freedesktop/PowerManagement')
+devobj = bus.get_object('org.freedesktop.PowerManagement', '/org/freedesktop/PowerManagement/Inhibit')
 dev = dbus.Interface (devobj, "org.freedesktop.PowerManagement.Inhibit")
 cookie = dev.Inhibit('Nautilus', 'Copying files from /media/SANVOL')
 time.sleep(10)
@@ -464,7 +385,7 @@ dev.UnInhibit(cookie)
         </tgroup>
       </informaltable>
       <para>
-        Other valid names for standby are <literal>ACPI S3</literal> and
+        Other valid names for suspend are <literal>ACPI S3</literal> and
         <literal>suspend-to-ram</literal>.
       </para>
     </sect2>
@@ -491,7 +412,7 @@ dev.UnInhibit(cookie)
         </tgroup>
       </informaltable>
       <para>
-        Other valid names for standby are <literal>ACPI S4</literal> and
+        Other valid names for hibernate are <literal>ACPI S4</literal> and
         <literal>suspend-to-disk</literal>.
       </para>
     </sect2>
@@ -527,6 +448,24 @@ dev.UnInhibit(cookie)
         </itemizedlist>
       </para>
     </formalpara>
+    <formalpara>
+      <title>Version 0.3, 14 November 2008, Richard Hughes</title>    
+      <para>
+        <itemizedlist>
+          <listitem>
+            <para>
+              Removed Shutdown(), Reboot(), CanShutdown(), CanReboot(),
+              ::CanShutdownChanged(), ::CanRebootChanged(), GetOnBattery(),
+              GetLowBattery(), ::OnBatteryChanged() and ::LowBatteryChanged()
+              as this provided low level information and policy rather than a
+              high level API.
+              The low level data is now provided by DeviceKit-power and the
+              policy is provided by ConsoleKit.
+            </para>
+          </listitem>
+        </itemizedlist>
+      </para>
+    </formalpara>
   </appendix>
 </article>
 
_______________________________________________
xdg mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/xdg

Reply via email to