alp at atoker.com
Wed Mar 21 05:31:00 PDT 2007
Richard Hughes wrote:
> I've attached a draft interface and attached it to this mail. I've also
> cc'd in more people in a hope to get more responses.
You should probably inline the XML in your mail to get people commenting
on the specifics.
(I'm reviewing this from an API consumer point of view rather than as a
Returns the system AC state, i.e. if we are not running on battery
Note: This method may still return false on AC using a desktop
if the computer is using backup power from a monitored UPS.
<arg type="b" name="ac_state" direction="out"/>
AC (alternating current?) is kind of an implementation detail. I will
probably just want to know if the device IsOnExternalPower or something.
"AC" means nothing to me as an application developer.
Returns the icon name used as the applet or status tray icon.
<arg type="s" name="icon" direction="out"/>
This method call looks out of place. Everything else in the API is
non-presentational. Dealing with icons and layout at a higher level will
increase the shelf life and portability of the API.
Signals the value of the current brightness has changed.
<!-- Signals the AC state has changed. -->
<!-- Signals the low power mode has changed. -->
Signals the system state description has changed.
<!-- Signals the system icon has changed. -->
Each of these signals should include the new value following the change
to reduce round-trips. Sending out a signal just to trigger another
bunch of method calls which query the new value is kind of pointless.
Anyway, it's great that you're calling for public review of this API --
other developers need to learn from this process.
More information about the xdg