New task / dock management library

Emdek emdeck at gmail.com
Sun Mar 7 19:43:46 CET 2010


Hello

As discussed on IRC before, I've prepared document which should make
clear how new task / dock management library would work etc.

First, current library won't go to trash, instead, most of it's
components would be reused in task management engine. So no worry that
it will be dumped and all work spend on it will be lost.
But this doesn't mean that it will be binary compatible with current
API or it will be possible to easy create kind of abstraction layer to
make porting easier.
Main aim is to make using it as easy as possible, developers will only
need to create visualization and connect signals to check for updates
and propagate some events (for example to show context menu, activate
item etc.).

Key concepts are:
- modularity, each engine could be replaced by other, or disabled, and
it should be easy to add new (it's only important that it will create
objects with specified type and send signals when these items are
changed / removed);
- reuse existing code, it should be easy to use already existing
solutions as data sources, something like data engines;
- flexibility, new approach for sorting and gouping will allow to
create very advanced strategies using QtScript;
- easy to use, main role of developer is to create visualization, all
items will be managed by manager using options specified by user.

How it will work?
Main manager object will notify user (for example task manager applet)
that there is new task / job / launcher / whatever (will send signal
with pointer to new item).
This item will have some properties, like title, description, icon,
type and some common methods, like contextMenu, activate etc.
Each item will implement interface but can add some specific methods
or properties (for example task will expose methods for minimizing or
moving windows).
Items could be grouped using another item (also implementing that
interface, thus providing title etc., generated using special
algorithm from data supplied from it's subitems).
Basic items will be:
- launcher (for creating tasks);
- task (representing window(s) or startup(s));
- job (for example file that is currently copied).

There could be also for example notifications etc.
User will decide using options (could be hardcoded in visualization)
which things should be displayed and how arranged, for example where
each launcher should be placed, where task should be shown etc.
Items could be grouped and sorted (respectively) using strategies
written in QtScript and basic ones (currently available) would be
shipped with library.
Script would use properties (title, window id, class etc.) to apply
strategy for items send to it in form of list / array and return list
of grouped items or sorted list / array or both.
This will allow for great flexibility for more advanced users and
allow everything what they want with managed items.
It could also decide which items should be shown (for example only
these from current screen or maximized etc.).

For example hierarchy of items could look like:

item
 launcher
item
 launcher
item (empty)
 separator
item (group with launcher and jobs)
 launcher
 task
 task
 task
 job
 job
item
 task
item
 task
 notification
item
 job
item
 item
  task
  launcher
 launcher


Additions to task management
Additionally it can use some magic provided by ksysguards libs to
determine task's command and use services to find which launcher was
used to run it or create new - read: option to pin running task as
launcher to dock.
Also we could, if user wants to, track most used applications and
suggest to add them to dock.
Also it could try to add feature requested by many users, merge status
icons from systray with task (new source for icon and new submenu for
options), of course these implementing new spec.


Why we need it?
Dock like applications are more common now, especially if we look at
other OSes, now even Windows has built in dock...
This of course doesn't mean that will need too, but why not provide
library that will allow to do it easily?
Default, classic, task manager will not benefit too much from these
new additions but other creations will (I've discussed this with other
dock developers).


This is a bit chaotic (I've written it in fifteen minutes, I'm busy
right now...) but should show more or less how it will work.
I can show current API draft or current implementation if needed.
I've already done some parts (task management part with command
identification nearly done) some months ago but I need some review /
suggestions / invectives to finish it. ;-)
And I would like to do it as GSoC project, it could include example
dock implementation (visualization), as I'm working for one year on
Fancy Tasks applet and it will be one of users of it (maybe also
STasks and Daisy).

I'll unavailable before Tuesday, so if someone reply then will need to
wait for my reaction...


Best regards,
Michal


More information about the Plasma-devel mailing list