Re: [Further-devel] battery meter

From: Evan Martin (martine@cs.washington.edu)
Date: Mon Jan 21 2002 - 15:30:27 PST


On Sat, Jan 19, 2002 at 07:33:43PM +0000, Simon Batistoni wrote:
> You'll likely get a warning when you compile, concerning the
> add_image routine, which is part of my ongoing hacking (I want to
> replace the text ac on/offline with some natty little pngs).

static Evas_Object add_image(char *filename, int x, int y) {
    Evas_Object o;
    o = evas_add_image_from_file(evas, filename);
    evas_set_further_color(evas, o, plugin_read_color("basecolor"));
    evas_move(evas, o, x, y);
    evas_show(evas, o);
    return o;
}

A tip on Evas (which I didn't expect you to know, so I'll just say it
here):
if you set the "color" of an image object, what it actually does is
sorta filter the image. This is handy because you can tweak the alpha
and get transparent images...
But in most cases, you don't want to set the color to basecolor, because
the user might have picked a color like green and you don't want your
images to be filtered to green.

The exception is seen in buttons in the XMMS plugin: here, I have
completely white images so that they filter properly by any color you
choose...

> This is my first ever piece of production c code, so be kind but
> fair to it :)

It looks pretty good, though that weirdness with dup() and such is
pretty crazy.

I'm amazed that people have managed to decipher the further API... :)

I can't test this code, though. Has anyone else used it?
I'd think further would be too processor-intensive (battery-intensive) to
run on a laptop. :)

I'll add it to the CVS with a few cleanups (copyright should be either
you or me, Ed just wrote one of the plugins :P).

-- 
      Evan Martin
martine@cs.washington.edu
  http://neugierig.org

_______________________________________________ Further-devel mailing list Further-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/further-devel



This archive was generated by hypermail 2.1.4 : Tue May 28 2002 - 23:37:04 PDT