This patch already implements complete auto-scaling for bars and gauges,
therefore introducing a flags field in order to signal whether
auto-scaling is enabled (and the scale field contains just the max value
seen so far).
The decision about whether to print ASCII or X11 bar is done from within
specials.c, so all those #ifdef + if () blocks can be dropped. This also
implicitly enables the ASCII bar for some bar printing objects which where
forgotten before.
Besides improving performance when updating stuff, we ideally have no
text object specific code in update_stuff() anymore (aside some
leftovers).
The macros in construct_text_object() have gotten a bit crazier than
they were before:
* using CALLBACK(&func) instead of an INFO_* parameter to OBJ() will
make it add the given callback to the list of callbacks to be iterated
over at each update interval.
* BEWARE: the above assumes function pointer values to be > 0!
* This implicitly fixes a bug in the code: passing 0 as INFO_* value
led to selecting INFO_MAIL (1 << 0 == 1).
* Now it would select INFO_CPU (== 0), which got unused and therefore is
not a problem at all (the 0 value should be unused in enums anyway).
This needs some more work, then we should be able to drop the whole
INFO_* enum. Then CALLBACK() can die again and with it goes the ugly
casting stuff done to distinguish callbacks from INFO_* values.
All ERR()'s are renamed to NORM_ERR() and box to mbox so that they don't
clash with things in ncurses.h .
Ncurses is enabled by default when building conky but can be disabled with
--disable-ncurses .
At the moment configure doesn't check if ncurses is actually available.
I'm adding support for ncurses so that we can make as much things as possible
that are only available in X11 also available in console in the future.
Some statics are now defined by configure.ac.in, conky.h got a lot
smaller, which I see as a positive sign.
This patch should not change any functionality, just change what's
defined where. Some features I did/could not test are probably broken,
also compiling for any other OS surely won't complete now. Though I
think fixing these problems is as easy as including some missing
headers.
I've done compile checks with the following configure options:
./configure --enable-eve --enable-rss --enable-smapi
--enable-wlan --enable-debug --enable-testing
So what needs to be tested is:
- audacious
- BMPx
- xmms2
- nvidia
In order to do this correctly:
Removed duplicate includes
Fixed mpd functions to accept mpd_s instead of information
Freed mpd.h of any need to include conky.h (mpd.c still includes it for the constants)
git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@1154 7f574dfc-610e-0410-a909-a81674777703
* yes, this is a feature and right now there is something
like a feature freeze.
* BUT I tested this with: /, /tmp, /dev/mapper, /dev, //,
/mnt/, /tmp/bla (the last one was non-existent, creating
it during runtime and even mounting tmpfs on it led to
expected results.
git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@1074 7f574dfc-610e-0410-a909-a81674777703
* instead of empty args "void" should always be specified.
Using this, the compiler can detect incorrect function calls,
like with update_stuff().
* No args seems to be interpreted as "unspecified args" by the
compiler, as with update_mail_count(). So no checking for
correctness of arguments when calling was done at all.
* This is not complete yet, as I still don't have any BSD for
testing.
git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@1055 7f574dfc-610e-0410-a909-a81674777703
* Fixed a number of small memory leaks.
* Performed some minor profiling on Conky; introduced
small_text_buffer_size and large_text_buffer_size config options instead
of just text_buffer_size.
* Fixed some minor bugs introduced by new patches.
git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@1014 7f574dfc-610e-0410-a909-a81674777703