[Goodies-commits] r7729 - in xfce4-power-manager/trunk: . doc/C src

Ali Abdallah aliov at xfce.org
Thu Jul 16 11:50:42 CEST 2009


Author: aliov
Date: 2009-07-16 09:50:42 +0000 (Thu, 16 Jul 2009)
New Revision: 7729

Modified:
   xfce4-power-manager/trunk/ChangeLog
   xfce4-power-manager/trunk/TODO
   xfce4-power-manager/trunk/configure.ac.in
   xfce4-power-manager/trunk/doc/C/xfce4-power-manager.html
   xfce4-power-manager/trunk/doc/C/xfce4-power-manager.xml.in
   xfce4-power-manager/trunk/src/org.freedesktop.PowerManagement.xml
   xfce4-power-manager/trunk/src/xfpm-engine.c
   xfce4-power-manager/trunk/src/xfpm-errors.c
   xfce4-power-manager/trunk/src/xfpm-errors.h
   xfce4-power-manager/trunk/src/xfpm-inhibit.c
   xfce4-power-manager/trunk/src/xfpm-session.c
   xfce4-power-manager/trunk/src/xfpm-session.h
   xfce4-power-manager/trunk/src/xfpm-shutdown.c
   xfce4-power-manager/trunk/src/xfpm-shutdown.h
Log:
	* Provides the following standard DBus methods:
	CanReboot(),CanShutdown(),Reboot(),GetPowerSaveStatus().
	* src/xfpm-error.{c,h} correct errors name for non 
	supported shutdown/hibernate... .
	to NoHardwareSupported+Invalid cookie to Cookie not found.
	* Update TODO.
	* Update the documentation.

Modified: xfce4-power-manager/trunk/ChangeLog
===================================================================
--- xfce4-power-manager/trunk/ChangeLog	2009-07-16 08:49:35 UTC (rev 7728)
+++ xfce4-power-manager/trunk/ChangeLog	2009-07-16 09:50:42 UTC (rev 7729)
@@ -1,3 +1,12 @@
+2009-07-15: Ali aliov at xfce.org
+	* Provides the following standard DBus methods:
+	CanReboot(),CanShutdown(),Reboot(),GetPowerSaveStatus().
+	* src/xfpm-error.{c,h} correct errors name for non 
+	supported shutdown/hibernate... .
+	to NoHardwareSupported+Invalid cookie to Cookie not found.
+	* Update TODO.
+	* Update the documentation.
+
 2009-07-09: Ali aliov at xfce.org
 	* src/xfpm-xfconf.c fix a bug affecting 0.8.1.* for the properties prefix.
 	* src/xfpm-engine.c Fix default idle timeout.

Modified: xfce4-power-manager/trunk/TODO
===================================================================
--- xfce4-power-manager/trunk/TODO	2009-07-16 08:49:35 UTC (rev 7728)
+++ xfce4-power-manager/trunk/TODO	2009-07-16 09:50:42 UTC (rev 7729)
@@ -1,7 +1,5 @@
 * : Solve the problem of possible multiple sleep requests between us and the session manager.
 
-* : Support Suspend Hybrid! ( DeviceKit power will not support this! ).
-    
-* : Translations need to be updated.
+* : Probably provide a PermissionDenied error on the inhibit interface?
 
 * : Updating the documentations.

Modified: xfce4-power-manager/trunk/configure.ac.in
===================================================================
--- xfce4-power-manager/trunk/configure.ac.in	2009-07-16 08:49:35 UTC (rev 7728)
+++ xfce4-power-manager/trunk/configure.ac.in	2009-07-16 09:50:42 UTC (rev 7729)
@@ -3,7 +3,7 @@
 m4_define([xfpm_version_minor],  [8])
 m4_define([xfpm_version_micro],  [2])
 m4_define([xfpm_version_build],  [])
-m4_define([xfpm_version_tag],[])
+m4_define([xfpm_version_tag],[r at REVISION@])
 m4_define([xfpm_version], [xfpm_version_major().xfpm_version_minor().xfpm_version_micro()ifelse(xfpm_version_tag(), [svn], [xfpm_version_tag().xfpm_version_build()], [xfpm_version_tag()])])
 
 AC_INIT([xfce4-power-manager], [xfpm_version], [http://bugzilla.xfce.org/])

Modified: xfce4-power-manager/trunk/doc/C/xfce4-power-manager.html
===================================================================
--- xfce4-power-manager/trunk/doc/C/xfce4-power-manager.html	2009-07-16 08:49:35 UTC (rev 7728)
+++ xfce4-power-manager/trunk/doc/C/xfce4-power-manager.html	2009-07-16 09:50:42 UTC (rev 7729)
@@ -1,4 +1,4 @@
-<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Xfce 4 Power Manager</title><link rel="stylesheet" href="../xfce.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.73.2"><link rel="start" href="#xfce4-power-manager" title="Xfce 4 Power Manager"><link rel="next" href="#xfpm-intro" title="Introduction"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="article" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="xfce4-power-manager"></a>Xfce 4 Power Manager</h2></div><div><div class="authorgroup"><div class="author"><h3 class="author"><span class="firstname">Ali</span> <span class="surname">Abdallah</span></h3><div class="affiliation"><div class="address"><p><code class="email"><<a class="email" href="mailto:aliov at xfce.org">aliov at xfce.org</a>></code></p></div></div></div></div></div><div><span xmlns="http://www.w3.org/TR/xhtml1/trans
 itional" class="releaseinfo">This manual describes <strong xmlns="" class="application"><code>xfce4-power-manager</code></strong> version 0.8.0
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Xfce 4 Power Manager</title><link rel="stylesheet" href="../xfce.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.73.2"><link rel="start" href="#xfce4-power-manager" title="Xfce 4 Power Manager"><link rel="next" href="#xfpm-intro" title="Introduction"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="article" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="xfce4-power-manager"></a>Xfce 4 Power Manager</h2></div><div><div class="authorgroup"><div class="author"><h3 class="author"><span class="firstname">Ali</span> <span class="surname">Abdallah</span></h3><div class="affiliation"><div class="address"><p><code class="email"><<a class="email" href="mailto:aliov at xfce.org">aliov at xfce.org</a>></code></p></div></div></div></div></div><div><span xmlns="http://www.w3.org/TR/xhtml1/trans
 itional" class="releaseinfo">This manual describes <strong xmlns="" class="application"><code>xfce4-power-manager</code></strong> version 0.8.2r07720
 <br></br></span></div><div><p class="copyright">Copyright © 2008 Ali Abdallah</p></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="#xfpm-intro">Introduction</a></span></dt><dd><dl><dt><span class="sect2"><a href="#xfpm-started">Getting Started</a></span></dt></dl></dd><dt><span class="sect1"><a href="#xfpm">Power Manager</a></span></dt><dd><dl><dt><span class="sect2"><a href="#xfpm-command-line">Command line options</a></span></dt><dt><span class="sect2"><a href="#xfpm-menu">Context menu</a></span></dt></dl></dd><dt><span class="sect1"><a href="#xfpm-configuration">Power Manager Configuration</a></span></dt><dd><dl><dt><span class="sect2"><a href="#xfpm-general">General options</a></span></dt><dt><span class="sect2"><a href="#xfpm-on-ac">Running on  AC power</a></span></dt><dt><span class="sect2"><a href="#xfpm-on-battery">Running on battery power</a></span></dt><dt><span class="sect2"><a href="#xfpm-extended">Extended
  options</a></span></dt><dt><span class="sect2"><a href="#xfpm-hidden-options">Hidden options</a></span></dt></dl></dd><dt><span class="sect1"><a href="#xfpm-plugins"> Panel plugins </a></span></dt><dt><span class="sect1"><a href="#xfpm-faq">FAQ</a></span></dt><dt><span class="sect1"><a href="#xfpm-technical">
  Technical information
  </a></span></dt><dd><dl><dt><span class="sect2"><a href="#xfpm-dbus">DBus interfaces</a></span></dt></dl></dd><dt><span class="sect1"><a href="#xfpm-about">About <strong class="application"><code>xfce4-power-manager</code></strong></a></span></dt></dl></div><p> </p><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="xfpm-intro"></a>Introduction</h2></div></div></div>
@@ -18,7 +18,7 @@
 	Restarts the power manager.
 	</p></dd><dt><span class="term"><span class="keycap"><strong>--quit</strong></span></span></dt><dd><p>
 	Causes any running instance of the power manager to exit.
-	</p></dd></dl></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="xfpm-menu"></a>Context menu</h3></div></div></div><div class="figure"><a name="id2924856"></a><p class="title"><b>Figure 1. Context menu</b></p><div class="figure-contents"><div class="screenshot"><div class="mediaobject"><img src="images/xfpm-context-menu.png" alt="Context menu"></div></div></div></div><p><br class="figure-break"></p><p>
+	</p></dd></dl></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="xfpm-menu"></a>Context menu</h3></div></div></div><div class="figure"><a name="id2907312"></a><p class="title"><b>Figure 1. Context menu</b></p><div class="figure-contents"><div class="screenshot"><div class="mediaobject"><img src="images/xfpm-context-menu.png" alt="Context menu"></div></div></div></div><p><br class="figure-break"></p><p>
 The context menu pops up when you click on the icon placed in your notification area for example a battery or an adapter icon. It contains some useful options like suspend/hibernate,
 display information of the battery device and open the settings dialog. It contains as well option to inhibit the power manager. If enabled, the power manager will not attempt
 to dim the screen or switch off the monitor.
@@ -29,7 +29,7 @@
 </p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="xfpm-configuration"></a>Power Manager Configuration</h2></div></div></div><p>
   In this section we will explain in details the possible configuration of the power manager running on laptop computer. Please note that the configurations are different when 
   the power manager is running on a desktop computer, for example you will not have LCD brightness etc.
-  </p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="xfpm-general"></a>General options</h3></div></div></div><div class="figure"><a name="id2929788"></a><p class="title"><b>Figure 2. General settings</b></p><div class="figure-contents"><div class="screenshot"><div class="mediaobject"><img src="images/xfpm-general-settings.png" alt="General settings"></div></div></div></div><p><br class="figure-break"></p><p>
+  </p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="xfpm-general"></a>General options</h3></div></div></div><div class="figure"><a name="id2912243"></a><p class="title"><b>Figure 2. General settings</b></p><div class="figure-contents"><div class="screenshot"><div class="mediaobject"><img src="images/xfpm-general-settings.png" alt="General settings"></div></div></div></div><p><br class="figure-break"></p><p>
 
 </p><div class="variablelist"><p class="title"><b></b></p><dl><dt><span class="term"><span class="keycap"><strong>Notification area:</strong></span></span></dt><dd><p>The notification area settings allow you to control the behaviour of the icon placed in your notification area. You can set it to be always visible. For battery devices,
 	you can select the icon to be visible only when your are running on battery for example.</p></dd><dt><span class="term"><span class="keycap"><strong>Keyboard special keys:</strong></span></span></dt><dd><p>
@@ -51,7 +51,7 @@
 	This is the power profile when running on battery. With this option your battery will last more when running on battery power.
 	Enabling this option is always a good idea.
 	</p></dd></dl></div><p>
-</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="xfpm-extended"></a>Extended options</h3></div></div></div><div class="figure"><a name="id2925152"></a><p class="title"><b>Figure 3. Extended settings</b></p><div class="figure-contents"><div class="screenshot"><div class="mediaobject"><img src="images/xfpm-extended-settings.png" alt="Extended settings"></div></div></div></div><p><br class="figure-break"></p><p>
+</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="xfpm-extended"></a>Extended options</h3></div></div></div><div class="figure"><a name="id2907607"></a><p class="title"><b>Figure 3. Extended settings</b></p><div class="figure-contents"><div class="screenshot"><div class="mediaobject"><img src="images/xfpm-extended-settings.png" alt="Extended settings"></div></div></div></div><p><br class="figure-break"></p><p>
 </p><div class="variablelist"><p class="title"><b></b></p><dl><dt><span class="term"><span class="keycap"><strong>Inactivity sleep mode:</strong></span></span></dt><dd><p>You can select the inactivity sleep action to be taken by the power manger when the system is idle for a interval of  time set by you
 	either on ac power or on battery power. Of course if you disable idle timeout those settings will have no effects.</p></dd><dt><span class="term"><span class="keycap"><strong>Monitor sleep mode:</strong></span></span></dt><dd><p>
 	DPMS sleep modes before switching off the monitor are either standby or suspend. They are technically different and provided for convenience.
@@ -84,13 +84,13 @@
 	 
 	</p><pre class="programlisting">xfconf-query -c <strong class="application"><code>xfce4-power-manager</code></strong> -n -p "/<strong class="application"><code>xfce4-power-manager</code></strong>/show-brightness-popup" -t bool -s false</pre><p>
 	 
-	</p></dd></dl></div></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="xfpm-plugins"></a> Panel plugins </h2></div></div></div><div class="figure"><a name="id2929360"></a><p class="title"><b>Figure 4. Brightness plugin</b></p><div class="figure-contents"><div class="screenshot"><div class="mediaobject"><img src="images/xfpm-brightness-plugin.png" alt="Brightness plugin"></div></div></div></div><p><br class="figure-break"></p><p>
-<strong class="application"><code>xfce4-power-manager</code></strong> version 0.8.0 includes one panel plugin for LCD brightness control (possible other plugins might be added for future releases). The usage of the brightness plugin
+	</p></dd></dl></div></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="xfpm-plugins"></a> Panel plugins </h2></div></div></div><div class="figure"><a name="id2911816"></a><p class="title"><b>Figure 4. Brightness plugin</b></p><div class="figure-contents"><div class="screenshot"><div class="mediaobject"><img src="images/xfpm-brightness-plugin.png" alt="Brightness plugin"></div></div></div></div><p><br class="figure-break"></p><p>
+<strong class="application"><code>xfce4-power-manager</code></strong> version 0.8.2r07720 includes one panel plugin for LCD brightness control (possible other plugins might be added for future releases). The usage of the brightness plugin
 is simple; just add the plugin to the panel same way  as the one used to add any other plugin; then click on the plugin; a slider will pop up that you move/scroll on it to change
 the brightness level of your screen. Of course the plugin will not work on a system with no back light panel. 
 </p></div><p> </p><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="xfpm-faq"></a>FAQ</h2></div></div></div><div class="variablelist"><dl><dt><span class="term">Q: Why the icons look very similar to the icon of gnome power manager?</span></dt><dd><p>A: No, they are not similar; they are the same. Just there is no point of re-drawing icons.
 	gnome power manager icons are good enough. Not all the gnome power manager icons are used. Please note that 
-	for version 0.8.0 the icons are renamed to avoid possible conflicts with a gnome power manager installation.   
+	for version 0.8.2r07720 the icons are renamed to avoid possible conflicts with a gnome power manager installation.   
 	</p></dd><dt><span class="term">Q: What is the difference between suspend and hibernate?</span></dt><dd><p>A: Suspend is a power save feature. When suspending, the computer is still using power,
 	since the running applications are kept in the memory, but it is the lowest power level that the computer
 	can use. While Hibernate saves the system state on the hard drive and turns off the power, when you start up your 
@@ -116,17 +116,17 @@
  
  </p><span class="keycap"><strong>Power management DBus interface.</strong></span><p>
 
-</p><div class="table"><a name="id2929581"></a><p class="title"><b>Table 1. Standard methods (org.freedesktop.PowerManagement):</b></p><div class="table-contents"><table xmlns="http://www.w3.org/TR/xhtml1/transitional" bgcolor="#F8F9FD" cellspacing="0" cellpadding="4" summary="Standard methods (org.freedesktop.PowerManagement):" border="1"><colgroup><col xmlns="" align="left"><col xmlns="" align="left"><col xmlns="" align="left"><col xmlns=""><col xmlns="" align="left"></colgroup><thead xmlns=""><tr><th colspan="2" align="center">Name</th><th align="left">Input parameter</th><th align="left">Return Values</th><th align="left">Errors</th><th align="left">Description</th></tr></thead><thead xmlns=""><tr><th colspan="2" align="center">CanHibernate</th><th align="left"> </th><th align="left">bool</th><th align="left"> </th><th align="left">whether the system is able to hibernate</th></tr></thead><thead xmlns=""><tr><th colspan="2" align="center">CanSuspend</th><th align="left"> 
 </th><th align="left">bool</th><th align="left"> </th><th align="left">whether the system is able to suspend</th></tr></thead><thead xmlns=""><tr><th colspan="2" align="center">GetOnBattery</th><th align="left"> </th><th align="left">bool</th><th align="left"> </th><th align="left">whether the system is running on battery</th></tr></thead><thead xmlns=""><tr><th colspan="2" align="center">GetLowBattery</th><th align="left"> </th><th align="left">bool</th><th align="left"> </th><th align="left">whether the system is running on low battery</th></tr></thead><thead xmlns=""><tr><th colspan="2" align="center">Hibernate</th><th align="left"> </th><th align="left"> </th><th align="left">PermissionDenied, NotSupported</th><th align="left"> </th></tr></thead><thead xmlns=""><tr><th colspan="2" align="center">Suspend</th><th align="left"> </th><th align="left"> </th><th align="left">PermissionDenied, NotSupported</th><th align="left"> </th></tr></thead><thead xmlns=""><tr><th colspan=
 "2" align="center">Shutdown</th><th align="left"> </th><th align="left"> </th><th align="left">PermissionDenied, NotSupported</th><th align="left"> </th></tr></thead></table></div></div><p><br class="table-break">
+</p><div class="table"><a name="id2912037"></a><p class="title"><b>Table 1. Standard methods (org.freedesktop.PowerManagement):</b></p><div class="table-contents"><table xmlns="http://www.w3.org/TR/xhtml1/transitional" bgcolor="#F8F9FD" cellspacing="0" cellpadding="4" summary="Standard methods (org.freedesktop.PowerManagement):" border="1"><colgroup><col xmlns="" align="left"><col xmlns="" align="left"><col xmlns="" align="left"><col xmlns=""><col xmlns="" align="left"></colgroup><thead xmlns=""><tr><th colspan="2" align="center">Name</th><th align="left">Input parameter</th><th align="left">Return Values</th><th align="left">Errors</th><th align="left">Description</th></tr></thead><thead xmlns=""><tr><th colspan="2" align="center">CanHibernate</th><th align="left"> </th><th align="left">bool</th><th align="left"> </th><th align="left">whether the system is able to hibernate</th></tr></thead><thead xmlns=""><tr><th colspan="2" align="center">CanSuspend</th><th align="left"> 
 </th><th align="left">bool</th><th align="left"> </th><th align="left">whether the system is able to suspend</th></tr></thead><thead xmlns=""><tr><th colspan="2" align="center">CanReboot</th><th align="left"> </th><th align="left">bool</th><th align="left"> </th><th align="left">whether the system is able to reboot</th></tr></thead><thead xmlns=""><tr><th colspan="2" align="center">CanShutdown</th><th align="left"> </th><th align="left">bool</th><th align="left"> </th><th align="left">whether the system is able to shutdown</th></tr></thead><thead xmlns=""><tr><th colspan="2" align="center">GetOnBattery</th><th align="left"> </th><th align="left">bool</th><th align="left"> </th><th align="left">whether the system is running on battery</th></tr></thead><thead xmlns=""><tr><th colspan="2" align="center">GetLowBattery</th><th align="left"> </th><th align="left">bool</th><th align="left"> </th><th align="left">whether the system is running on low battery</th></tr></thead><thead x
 mlns=""><tr><th colspan="2" align="center">GetPowerSaveStatus</th><th align="left"> </th><th align="left">bool</th><th align="left"> </th><th align="left">whether the system is running in power save mode.</th></tr></thead><thead xmlns=""><tr><th colspan="2" align="center">Hibernate</th><th align="left"> </th><th align="left"> </th><th align="left">PermissionDenied, NoHardwareSupport</th><th align="left"> </th></tr></thead><thead xmlns=""><tr><th colspan="2" align="center">Suspend</th><th align="left"> </th><th align="left"> </th><th align="left">PermissionDenied, NoHardwareSupport</th><th align="left"> </th></tr></thead><thead xmlns=""><tr><th colspan="2" align="center">Reboot</th><th align="left"> </th><th align="left"> </th><th align="left">PermissionDenied, NoHardwareSupport</th><th align="left"> </th></tr></thead><thead xmlns=""><tr><th colspan="2" align="center">Shutdown</th><th align="left"> </th><th align="left"> </th><th align="left">PermissionDenied, NoHardwareSuppo
 rt</th><th align="left"> </th></tr></thead></table></div></div><p><br class="table-break">
 
 
-    </p><div class="table"><a name="id2972958"></a><p class="title"><b>Table 2. Standard signals (org.freedesktop.PowerManagement):</b></p><div class="table-contents"><table xmlns="http://www.w3.org/TR/xhtml1/transitional" bgcolor="#F8F9FD" cellspacing="0" cellpadding="4" summary="Standard signals (org.freedesktop.PowerManagement):" border="1"><colgroup><col xmlns="" align="left"><col xmlns="" align="left"><col xmlns="" align="left"></colgroup><thead xmlns=""><tr><th colspan="2" align="center">Name</th><th align="left">Values</th><th align="left">Description</th></tr></thead><thead xmlns=""><tr><th colspan="2" align="center">OnBatteryChanged</th><th align="left">bool</th><th align="left">whether on battery status changed</th></tr></thead><thead xmlns=""><tr><th colspan="2" align="center">LowBatteryChanged</th><th align="left">bool</th><th align="left">whether on low battery status changed</th></tr></thead></table></div></div><p><br class="table-break">
+    </p><div class="table"><a name="id2955521"></a><p class="title"><b>Table 2. Standard signals (org.freedesktop.PowerManagement):</b></p><div class="table-contents"><table xmlns="http://www.w3.org/TR/xhtml1/transitional" bgcolor="#F8F9FD" cellspacing="0" cellpadding="4" summary="Standard signals (org.freedesktop.PowerManagement):" border="1"><colgroup><col xmlns="" align="left"><col xmlns="" align="left"><col xmlns="" align="left"></colgroup><thead xmlns=""><tr><th colspan="2" align="center">Name</th><th align="left">Values</th><th align="left">Description</th></tr></thead><thead xmlns=""><tr><th colspan="2" align="center">OnBatteryChanged</th><th align="left">bool</th><th align="left">whether on battery status changed</th></tr></thead><thead xmlns=""><tr><th colspan="2" align="center">LowBatteryChanged</th><th align="left">bool</th><th align="left">whether on low battery status changed</th></tr></thead></table></div></div><p><br class="table-break">
 
 </p><span class="keycap"><strong>Power management DBus inhibit interface.</strong></span><p>
 
-</p><div class="table"><a name="id2973067"></a><p class="title"><b>Table 3. Standard methods (org.freedesktop.PowerManagement.Inhibit):</b></p><div class="table-contents"><table xmlns="http://www.w3.org/TR/xhtml1/transitional" bgcolor="#F8F9FD" cellspacing="0" cellpadding="4" summary="Standard methods (org.freedesktop.PowerManagement.Inhibit):" border="1"><colgroup><col xmlns="" align="left"><col xmlns="" align="left"><col xmlns="" align="left"><col xmlns=""><col xmlns="" align="left"></colgroup><thead xmlns=""><tr><th colspan="2" align="center">Name</th><th align="left">Input parameter</th><th align="left">Return Values</th><th align="left">Errors</th><th align="left">Description</th></tr></thead><thead xmlns=""><tr><th colspan="2" align="center">Inhibit</th><th align="left">string application name, string reason</th><th align="left">uint32 (random cookie)</th><th align="left"> </th><th align="left">Inhibit the power manager.</th></tr></thead><thead xmlns=""><tr><th colspan
 ="2" align="center">UnInhibit</th><th align="left">uint32 cookie</th><th align="left"> </th><th align="left">InvalidCookie</th><th align="left">Unihibit the power manager.</th></tr></thead><thead xmlns=""><tr><th colspan="2" align="center">HasInhibit</th><th align="left"> </th><th align="left">bool</th><th align="left"> </th><th align="left">Whether the power manager is currently inhibited or not.</th></tr></thead><thead xmlns=""><tr><th colspan="2" align="center">GetInhibitors</th><th align="left"> </th><th align="left">Array of strings</th><th align="left"> </th><th align="left">List all the applications currently inhibiting the power manager (Not standard, use just for debugging)</th></tr></thead></table></div></div><p><br class="table-break">
+</p><div class="table"><a name="id2955630"></a><p class="title"><b>Table 3. Standard methods (org.freedesktop.PowerManagement.Inhibit):</b></p><div class="table-contents"><table xmlns="http://www.w3.org/TR/xhtml1/transitional" bgcolor="#F8F9FD" cellspacing="0" cellpadding="4" summary="Standard methods (org.freedesktop.PowerManagement.Inhibit):" border="1"><colgroup><col xmlns="" align="left"><col xmlns="" align="left"><col xmlns="" align="left"><col xmlns=""><col xmlns="" align="left"></colgroup><thead xmlns=""><tr><th colspan="2" align="center">Name</th><th align="left">Input parameter</th><th align="left">Return Values</th><th align="left">Errors</th><th align="left">Description</th></tr></thead><thead xmlns=""><tr><th colspan="2" align="center">Inhibit</th><th align="left">string application name, string reason</th><th align="left">uint32 (random cookie)</th><th align="left"> </th><th align="left">Inhibit the power manager.</th></tr></thead><thead xmlns=""><tr><th colspan
 ="2" align="center">UnInhibit</th><th align="left">uint32 cookie</th><th align="left"> </th><th align="left">InvalidCookie</th><th align="left">Unihibit the power manager.</th></tr></thead><thead xmlns=""><tr><th colspan="2" align="center">HasInhibit</th><th align="left"> </th><th align="left">bool</th><th align="left"> </th><th align="left">Whether the power manager is currently inhibited or not.</th></tr></thead><thead xmlns=""><tr><th colspan="2" align="center">GetInhibitors</th><th align="left"> </th><th align="left">Array of strings</th><th align="left"> </th><th align="left">List all the applications currently inhibiting the power manager (Not standard, use just for debugging)</th></tr></thead></table></div></div><p><br class="table-break">
 
 
-    </p><div class="table"><a name="id2973246"></a><p class="title"><b>Table 4. Standard signals (org.freedesktop.PowerManagement.Inhibit):</b></p><div class="table-contents"><table xmlns="http://www.w3.org/TR/xhtml1/transitional" bgcolor="#F8F9FD" cellspacing="0" cellpadding="4" summary="Standard signals (org.freedesktop.PowerManagement.Inhibit):" border="1"><colgroup><col xmlns="" align="left"><col xmlns="" align="left"><col xmlns="" align="left"></colgroup><thead xmlns=""><tr><th colspan="2" align="center">Name</th><th align="left">Values</th><th align="left">Description</th></tr></thead><thead xmlns=""><tr><th colspan="2" align="center">HasInhibitChanged</th><th align="left">bool</th><th align="left">whether the inhibit status changed.</th></tr></thead></table></div></div><p><br class="table-break">
+    </p><div class="table"><a name="id2955809"></a><p class="title"><b>Table 4. Standard signals (org.freedesktop.PowerManagement.Inhibit):</b></p><div class="table-contents"><table xmlns="http://www.w3.org/TR/xhtml1/transitional" bgcolor="#F8F9FD" cellspacing="0" cellpadding="4" summary="Standard signals (org.freedesktop.PowerManagement.Inhibit):" border="1"><colgroup><col xmlns="" align="left"><col xmlns="" align="left"><col xmlns="" align="left"></colgroup><thead xmlns=""><tr><th colspan="2" align="center">Name</th><th align="left">Values</th><th align="left">Description</th></tr></thead><thead xmlns=""><tr><th colspan="2" align="center">HasInhibitChanged</th><th align="left">bool</th><th align="left">whether the inhibit status changed.</th></tr></thead></table></div></div><p><br class="table-break">
 
 </p><p>
 In addition, <strong class="application"><code>xfce4-power-manager</code></strong> has other interfaces, but those interfaces are mainly used internally, for example the settings application uses such interface to

Modified: xfce4-power-manager/trunk/doc/C/xfce4-power-manager.xml.in
===================================================================
--- xfce4-power-manager/trunk/doc/C/xfce4-power-manager.xml.in	2009-07-16 08:49:35 UTC (rev 7728)
+++ xfce4-power-manager/trunk/doc/C/xfce4-power-manager.xml.in	2009-07-16 09:50:42 UTC (rev 7729)
@@ -520,6 +520,26 @@
 
 <thead>
 <row>
+  <entry namest="c1" nameend="c2" align="center">CanReboot</entry>
+  <entry></entry>
+  <entry>bool</entry>
+  <entry></entry>
+  <entry>whether the system is able to reboot</entry>
+</row>
+</thead>
+
+<thead>
+<row>
+  <entry namest="c1" nameend="c2" align="center">CanShutdown</entry>
+  <entry></entry>
+  <entry>bool</entry>
+  <entry></entry>
+  <entry>whether the system is able to shutdown</entry>
+</row>
+</thead>
+
+<thead>
+<row>
   <entry namest="c1" nameend="c2" align="center">GetOnBattery</entry>
   <entry></entry>
   <entry>bool</entry>
@@ -540,10 +560,21 @@
 
 <thead>
 <row>
+  <entry namest="c1" nameend="c2" align="center">GetPowerSaveStatus</entry>
+  <entry></entry>
+  <entry>bool</entry>
+  <entry></entry>
+  <entry>whether the system is running in power save mode.</entry>
+</row>
+</thead>
+
+
+<thead>
+<row>
   <entry namest="c1" nameend="c2" align="center">Hibernate</entry>
   <entry></entry>
   <entry></entry>
-  <entry>PermissionDenied, NotSupported</entry>
+  <entry>PermissionDenied, NoHardwareSupport</entry>
   <entry></entry>
 </row>
 </thead>
@@ -553,17 +584,27 @@
   <entry namest="c1" nameend="c2" align="center">Suspend</entry>
   <entry></entry>
   <entry></entry>
-  <entry>PermissionDenied, NotSupported</entry>
+  <entry>PermissionDenied, NoHardwareSupport</entry>
   <entry></entry>
 </row>
 </thead>
 
 <thead>
 <row>
+  <entry namest="c1" nameend="c2" align="center">Reboot</entry>
+  <entry></entry>
+  <entry></entry>
+  <entry>PermissionDenied, NoHardwareSupport</entry>
+  <entry></entry>
+</row>
+</thead>
+
+<thead>
+<row>
   <entry namest="c1" nameend="c2" align="center">Shutdown</entry>
   <entry></entry>
   <entry></entry>
-  <entry>PermissionDenied, NotSupported</entry>
+  <entry>PermissionDenied, NoHardwareSupport</entry>
   <entry></entry>
 </row>
 </thead>

Modified: xfce4-power-manager/trunk/src/org.freedesktop.PowerManagement.xml
===================================================================
--- xfce4-power-manager/trunk/src/org.freedesktop.PowerManagement.xml	2009-07-16 08:49:35 UTC (rev 7728)
+++ xfce4-power-manager/trunk/src/org.freedesktop.PowerManagement.xml	2009-07-16 09:50:42 UTC (rev 7729)
@@ -10,12 +10,23 @@
     <method name="Shutdown">
     </method>
     
+    <method name="Reboot">
+    </method>
+    
     <method name="Hibernate">
     </method>
     
     <method name="Suspend">
     </method>
+
+    <method name="CanShutdown">
+      <arg type="b" name="can_shutdown" direction="out"/>
+    </method>
     
+    <method name="CanReboot">
+      <arg type="b" name="can_reboot" direction="out"/>
+    </method>
+    
     <method name="CanSuspend">
       <arg type="b" name="can_suspend" direction="out"/>
     </method>
@@ -24,6 +35,10 @@
       <arg type="b" name="can_hibernate" direction="out"/>
     </method>
     
+    <method name="GetPowerSaveStatus">
+      <arg type="b" name="save_power" direction="out"/>
+    </method>
+    
     <method name="GetOnBattery">
       <arg type="b" name="on_battery" direction="out"/>
     </method>

Modified: xfce4-power-manager/trunk/src/xfpm-engine.c
===================================================================
--- xfce4-power-manager/trunk/src/xfpm-engine.c	2009-07-16 08:49:35 UTC (rev 7728)
+++ xfce4-power-manager/trunk/src/xfpm-engine.c	2009-07-16 09:50:42 UTC (rev 7729)
@@ -689,6 +689,9 @@
  */
 static gboolean xfpm_engine_dbus_shutdown (XfpmEngine *engine,
 					   GError **error);
+
+static gboolean xfpm_engine_dbus_reboot   (XfpmEngine *engine,
+					   GError **error);
 					   
 static gboolean xfpm_engine_dbus_hibernate (XfpmEngine * engine,
 					    GError **error);
@@ -696,6 +699,14 @@
 static gboolean xfpm_engine_dbus_suspend (XfpmEngine * engine,
 					  GError ** error);
 
+static gboolean xfpm_engine_dbus_can_reboot (XfpmEngine * engine,
+					     gboolean * OUT_can_reboot, 
+					     GError ** error);
+
+static gboolean xfpm_engine_dbus_can_shutdown (XfpmEngine * engine,
+					       gboolean * OUT_can_reboot, 
+					       GError ** error);
+
 static gboolean xfpm_engine_dbus_can_hibernate (XfpmEngine * engine,
 						gboolean * OUT_can_hibernate,
 						GError ** error);
@@ -704,6 +715,10 @@
 					      gboolean * OUT_can_suspend,
 					      GError ** error);
 
+static gboolean xfpm_engine_dbus_get_power_save_status (XfpmEngine * engine,
+						        gboolean * OUT_save_power,
+						        GError ** error);
+
 static gboolean xfpm_engine_dbus_get_on_battery (XfpmEngine * engine,
 						 gboolean * OUT_on_battery,
 						 GError ** error);
@@ -761,6 +776,32 @@
     return TRUE;
 }
 
+static gboolean xfpm_engine_dbus_reboot   (XfpmEngine *engine,
+					   GError **error)
+{
+    gboolean caller_privilege;
+    
+    TRACE ("Hibernate message received");
+
+    g_object_get (G_OBJECT (engine->priv->shutdown),
+		  "caller-privilege", &caller_privilege,
+		  NULL);
+
+    if (!caller_privilege)
+    {
+	g_set_error (error, XFPM_ERROR, XFPM_ERROR_PERMISSION_DENIED,
+		    _("Permission denied"));
+	return FALSE;
+    }
+
+    if ( engine->priv->inhibited )
+	return TRUE;
+
+    xfpm_reboot (engine->priv->shutdown, NULL);
+    
+    return TRUE;
+}
+
 static gboolean
 xfpm_engine_dbus_hibernate (XfpmEngine * engine, GError ** error)
 {
@@ -781,7 +822,7 @@
 
     if (!can_hibernate)
     {
-	g_set_error (error, XFPM_ERROR, XFPM_ERROR_HIBERNATE_NOT_SUPPORTED,
+	g_set_error (error, XFPM_ERROR, XFPM_ERROR_NO_HARDWARE_SUPPORT,
 		    _("Hibernate not supported"));
 	return FALSE;
     }
@@ -810,7 +851,7 @@
 
     if (!can_suspend)
     {
-	g_set_error (error, XFPM_ERROR, XFPM_ERROR_SUSPEND_NOT_SUPPORTED,
+	g_set_error (error, XFPM_ERROR, XFPM_ERROR_NO_HARDWARE_SUPPORT,
 		    _("Suspend not supported"));
 	return FALSE;
     }
@@ -821,6 +862,30 @@
 }
 
 static gboolean
+xfpm_engine_dbus_can_shutdown (XfpmEngine * engine,
+			       gboolean * OUT_can_shutdown, GError ** error)
+{
+    TRACE ("Can shutdown message received");
+    
+    g_object_get (G_OBJECT (engine->priv->shutdown),
+		  "caller-privilege", OUT_can_shutdown, NULL);
+
+    return TRUE;
+}
+
+static gboolean
+xfpm_engine_dbus_can_reboot (XfpmEngine * engine,
+			     gboolean * OUT_can_reboot, GError ** error)
+{
+    TRACE ("Can reboot message received");
+    
+    g_object_get (G_OBJECT (engine->priv->shutdown),
+		  "caller-privilege", OUT_can_reboot, NULL);
+
+    return TRUE;
+}
+
+static gboolean
 xfpm_engine_dbus_can_hibernate (XfpmEngine * engine,
 				gboolean * OUT_can_hibernate, GError ** error)
 {
@@ -842,6 +907,23 @@
     return TRUE;
 }
 
+static gboolean xfpm_engine_dbus_get_power_save_status (XfpmEngine * engine,
+						        gboolean * OUT_save_power,
+						        GError ** error)
+{
+    gboolean save_power;
+    
+    TRACE ("Can power save message received");
+    
+    g_object_get (G_OBJECT (engine->priv->conf),
+		  POWER_SAVE_ON_BATTERY, &save_power,
+		  NULL);
+		  
+    *OUT_save_power = save_power && engine->priv->on_battery;
+    
+    return TRUE;
+}
+
 static gboolean
 xfpm_engine_dbus_get_on_battery (XfpmEngine * engine,
 				 gboolean * OUT_on_battery, GError ** error)

Modified: xfce4-power-manager/trunk/src/xfpm-errors.c
===================================================================
--- xfce4-power-manager/trunk/src/xfpm-errors.c	2009-07-16 08:49:35 UTC (rev 7728)
+++ xfce4-power-manager/trunk/src/xfpm-errors.c	2009-07-16 09:50:42 UTC (rev 7729)
@@ -46,10 +46,8 @@
 	{
 	    { XFPM_ERROR_UNKNOWN, "XFPM_ERROR_UNKNOWN", "Unknown" },
 	    { XFPM_ERROR_PERMISSION_DENIED, "XFPM_ERROR_PERMISSION_DENIED", "PermissionDenied" },
-	    { XFPM_ERROR_SUSPEND_NOT_SUPPORTED, "XFPM_ERROR_SUSPEND_NOT_SUPPORTED", "SuspendNotSupported" },
-	    { XFPM_ERROR_HIBERNATE_NOT_SUPPORTED, "XFPM_ERROR_HIBERNATE_NOT_SUPPORTED", "HibernateNotSupported" },
-	    { XFPM_ERROR_SUSPEND_HYBRID_NOT_SUPPORTED, "XFPM_ERROR_SUSPEND_HYBRID_NOT_SUPPORTED", "SuspendHybridNotSupported" },
-	    { XFPM_ERROR_INVALID_COOKIE, "XFPM_ERROR_INVALID_COOKIE", "InvalidCookie" },
+	    { XFPM_ERROR_NO_HARDWARE_SUPPORT, "XFPM_ERROR_HARDWARE_NOT_SUPPORT", "NoHardwareSupport" },
+	    { XFPM_ERROR_COOKIE_NOT_FOUND, "XFPM_ERROR_COOKIE_NOT_FOUND", "CookieNotFound" },
 	    { XFPM_ERROR_INVALID_ARGUMENTS, "XFPM_ERROR_INVALID_ARGUMENTS", "InvalidArguments" },
 	    { XFPM_ERROR_HAL_DISCONNECTED, "XFPM_ERROR_HAL_DISCONNECTED", "HalDisconnected" },
 	    { XFPM_ERROR_SLEEP_FAILED, "XFPM_ERROR_SLEEP_FAILED", "SleepFailed" },

Modified: xfce4-power-manager/trunk/src/xfpm-errors.h
===================================================================
--- xfce4-power-manager/trunk/src/xfpm-errors.h	2009-07-16 08:49:35 UTC (rev 7728)
+++ xfce4-power-manager/trunk/src/xfpm-errors.h	2009-07-16 09:50:42 UTC (rev 7729)
@@ -33,10 +33,8 @@
 {
     XFPM_ERROR_UNKNOWN = 0,
     XFPM_ERROR_PERMISSION_DENIED,
-    XFPM_ERROR_SUSPEND_NOT_SUPPORTED,
-    XFPM_ERROR_HIBERNATE_NOT_SUPPORTED,
-    XFPM_ERROR_SUSPEND_HYBRID_NOT_SUPPORTED,
-    XFPM_ERROR_INVALID_COOKIE,
+    XFPM_ERROR_NO_HARDWARE_SUPPORT,
+    XFPM_ERROR_COOKIE_NOT_FOUND,
     XFPM_ERROR_INVALID_ARGUMENTS,
     XFPM_ERROR_HAL_DISCONNECTED,
     XFPM_ERROR_SLEEP_FAILED

Modified: xfce4-power-manager/trunk/src/xfpm-inhibit.c
===================================================================
--- xfce4-power-manager/trunk/src/xfpm-inhibit.c	2009-07-16 08:49:35 UTC (rev 7728)
+++ xfce4-power-manager/trunk/src/xfpm-inhibit.c	2009-07-16 09:50:42 UTC (rev 7729)
@@ -356,7 +356,7 @@
     
     if (!xfpm_inhibit_remove_application_by_cookie (inhibit, IN_cookie))
     {
-	g_set_error (error, XFPM_ERROR, XFPM_ERROR_INVALID_COOKIE, _("Invalid cookie"));
+	g_set_error (error, XFPM_ERROR, XFPM_ERROR_COOKIE_NOT_FOUND, _("Invalid cookie"));
 	return FALSE;
     }
     

Modified: xfce4-power-manager/trunk/src/xfpm-session.c
===================================================================
--- xfce4-power-manager/trunk/src/xfpm-session.c	2009-07-16 08:49:35 UTC (rev 7728)
+++ xfce4-power-manager/trunk/src/xfpm-session.c	2009-07-16 09:50:42 UTC (rev 7729)
@@ -238,6 +238,16 @@
     return xfpm_session_shutdown_internal (session, type, allow_save);
 }
 
+gboolean xfpm_session_reboot (XfpmSession *session)
+{
+    gboolean allow_save   = TRUE;
+    XfsmShutdownType type = XFSM_SHUTDOWN_REBOOT;
+    
+    g_return_val_if_fail (XFPM_IS_SESSION (session), FALSE);
+    
+    return xfpm_session_shutdown_internal (session, type, allow_save);
+}
+
 gboolean xfpm_session_ask_shutdown (XfpmSession *session)
 {
     gboolean allow_save   = TRUE;

Modified: xfce4-power-manager/trunk/src/xfpm-session.h
===================================================================
--- xfce4-power-manager/trunk/src/xfpm-session.h	2009-07-16 08:49:35 UTC (rev 7728)
+++ xfce4-power-manager/trunk/src/xfpm-session.h	2009-07-16 09:50:42 UTC (rev 7729)
@@ -57,6 +57,8 @@
 
 gboolean                         xfpm_session_shutdown        (XfpmSession *session);
 
+gboolean 			 xfpm_session_reboot 	      (XfpmSession *session);
+
 gboolean			 xfpm_session_ask_shutdown    (XfpmSession *session);
 
 G_END_DECLS

Modified: xfce4-power-manager/trunk/src/xfpm-shutdown.c
===================================================================
--- xfce4-power-manager/trunk/src/xfpm-shutdown.c	2009-07-16 08:49:35 UTC (rev 7728)
+++ xfce4-power-manager/trunk/src/xfpm-shutdown.c	2009-07-16 09:50:42 UTC (rev 7729)
@@ -413,13 +413,37 @@
     
     xfpm_send_message_to_network_manager ("sleep");
     
+    //FIXME: Shutdown the system without asking the session to do.
     if ( !xfpm_session_shutdown (shutdown->priv->session) )
-	xfpm_shutdown_internal (dbus_g_connection_get_connection(shutdown->priv->bus), "Shutdown", NULL);
-
+    {
+	if ( !xfpm_shutdown_internal (dbus_g_connection_get_connection(shutdown->priv->bus), "Shutdown", NULL))
+	    xfpm_send_message_to_network_manager ("wake");
+    }
+    
     shutdown->priv->block_shutdown = FALSE;
-    xfpm_send_message_to_network_manager ("wake");
 }
 
+void xfpm_reboot (XfpmShutdown *shutdown, GError **error)
+{
+    g_return_if_fail (XFPM_IS_SHUTDOWN(shutdown));
+    
+    if ( G_UNLIKELY (shutdown->priv->connected == FALSE) )
+    {
+	g_set_error (error, XFPM_ERROR, XFPM_ERROR_HAL_DISCONNECTED, _("HAL daemon is currently not connected"));
+	shutdown->priv->block_shutdown = FALSE;
+	return;
+    }
+    
+    xfpm_send_message_to_network_manager ("sleep");
+    if ( !xfpm_session_reboot (shutdown->priv->session) )
+    {
+	if ( !xfpm_shutdown_internal (dbus_g_connection_get_connection(shutdown->priv->bus), "Reboot", NULL))
+	    xfpm_send_message_to_network_manager ("wake");
+    }
+
+    shutdown->priv->block_shutdown = FALSE;
+}    
+
 void xfpm_hibernate (XfpmShutdown *shutdown, GError **error)
 {
     GError *error_internal = NULL;
@@ -483,7 +507,6 @@
 	g_error_free (error_internal);
     }
     g_signal_emit (G_OBJECT (shutdown), signals [WAKING_UP], 0);
-    
     xfpm_send_message_to_network_manager ("wake");
 }
 

Modified: xfce4-power-manager/trunk/src/xfpm-shutdown.h
===================================================================
--- xfce4-power-manager/trunk/src/xfpm-shutdown.h	2009-07-16 08:49:35 UTC (rev 7728)
+++ xfce4-power-manager/trunk/src/xfpm-shutdown.h	2009-07-16 09:50:42 UTC (rev 7729)
@@ -65,6 +65,9 @@
 void                      xfpm_shutdown			(XfpmShutdown *shutdown,
 							 GError **error);
 
+void                      xfpm_reboot			(XfpmShutdown *shutdown,
+							 GError **error);
+
 void                      xfpm_hibernate                (XfpmShutdown *shutdown,
 							 GError **error);
 




More information about the Goodies-commits mailing list