Hi developers,

1. Changing MODE_* to CAPABILITY_*
----------------------------------

at the moment, we have five socalled "MODES" which clients use to connect
to the daemon:

   /** Forward acpi event from /proc/acpi/events */
   #define MODE_ACPI_EVENTS 1
   /** Forward powersave events created by the daemon */
   #define MODE_POWERSAVE_EVENTS 2
   /** Forward notifications the daemon throuws */
   #define MODE_NOTIFICATIONS 4
   /** Forward screensaver requests */
   #define MODE_SCREENSAVER 8
   /** Forward progress bar requests */
   #define MODE_PROGRESS 16

MODE_ACPI_EVENTS and MODE_POWERSAVE_EVENTS really does not have anything
to do with a capability from clients. The daemon needs not to know whether
some client uses acpi or powersave events. So at first I like to remove
these two "MODES".

Furthermore, I like to rename the remaining three, because MODE_* is not a
descriptive define. Better is CAPABILITY_*, I think. I like to do it _now_
because until now noone else (I hope) uses these defines.

Also I like to rename MODE_SCREENSAVER to CAPABILITY_SCREENLOCK, because
we do not need a nice screensaver. The only thing that matters is the
locking of the screen.

So these defines would look as follows:

   /** Forward notifications the daemon throuws */
   #define MODE_NOTIFICATIONS 1
   /** Forward screenlock requests */
   #define MODE_SCREENLOCK 2
   /** Forward progress bar requests */
   #define MODE_PROGRESS 4


Additionally, I like to also adjust the client struct:

        typedef struct cNode {
              ...
        -     /** The mode to which the message belongs */
        -      int mode;
        +     /** The capabilities to which the message belongs */
        +      int capabilities;
              ...
        } cNode;

The problem is that we have to adjust all clients to use the new
defines(kpowersave, wmpowersave, testclient, dbus_testclient). But I also
think that this is the last chance to do it.


2. Broadcast everything and always over the bus
-----------------------------------------------

Due to the fact we are using DBus now, we do not need a connected client
to send out events, progress, whatever. So we can broadcast everything
(all five MODES) over the bus. Clients still have to connect to take work
off from powersaved. For instance taking care about screenlocking. But
also without a connected client, all messages go over the bus.


Please comment and say if I can do that. I've got the code already, so I
can commit immediately.


Bye,
        Holger

_______________________________________________
powersave-devel mailing list
[email protected]
http://forge.novell.com/mailman/listinfo/powersave-devel

Reply via email to