The problem is as follows. In the end, different types of widget are going to
have distinct configurable options. This means that we need to have a
different section type for every widget type, if we are ever to make the
configuration nice. In fact, a configuration syntax like this would suit us
very well:
textbox name {
foo = bar
}
focuslist name2 {
bar = voing
}
This is all very well, but libconfuse has a limitation - there is no "nice"
way to retrieve the order of disparate sections (i.e. sections of different
types), and order is important to us. This patch goes to some effort to
retrieve the section order by extracting an array of widgets, and sorting them
based on line number.
The big change here is that we now keep our configuration structure in a global
variable called globalconf. This radically simplifies many interfaces, since
passing awesomeconf everywhere is no longer necessary. There are also more
subtle interface effects - now we can reliably identify a screen from just a
screen ID, rather than an awesomeconf, screenid tuple.
Overall, this patch makes most of the interfaces in awesome much nicer to use -
enjoy!
Yes, this is a huge patch, but since a lot of the refactoring was done
systematically using vim macros, splitting this up would have been very hard.
We now have the beginnings of a flexible widget structure for the statusbar.
For now, there is no behavioural change, and the interface is a bit crude, but
watch this space!
This a preparatory patch. Refactor statusbar.c to compartmentalise the drawing
of the statusbar "widgets". We can now begin to see what a generalised widget
drawing interface would look like.
Note that at the moment we don't gracefully handle situations where "widgets"
run out of space. That will come as we generalise from here.
- reloadconfig never worked properly. There were a number of circumstances
under which it would crash awesome.
- reloadconfig always leaked memory, because our cleanup process was never
perfect. Making it perfect would be Hard.
- Just exec-ing awesome over the top of itself is an OK solution. Maybe we
should add a uicb_restart to do this so users don't have to think about
uicb_exec.
This is a big patch that does not change any behaviour. We abstract the data
needed by the draw.c functions into a context object, and pass that around
instead of passing each argument every time. This results in a much cleaner API
- most functions lose 3-4 arguments.
This is a preparatory patch for further work on statusbar.