Re: [AD] Allegro window icon under X

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Sunday 04 July 2004 15:18, Elias Pschernig wrote:
> Heh, constructor function defines. Sometimes I wish there was some
> documentation for Allegro's internal API :)

Yes, especially with a lot of the regular maintainers being busy with other 
stuff, this is becoming more important.
I noticed them in the output from dat2c a while back, which is how I knew 
they existed. I'll browse through Allegro's internal headers sometime and 
document what I can find. It needn't be in the public documentation, but 
it would be good to have it documented somewhere.

> If we have a test for -lXpm, maybe also have a test for Xpm.h?

Sounds reasonable.

> Personally, I'd prefer if the name would be <icon>.c, where <icon> is
> the bitmap name, or if there would be a -o switch for the output file
> name. Maybe I'll try to do something like wfixicon.c some time, so you
> can also use datafile bitmaps, and don't need the imagemagick tools
> installed.

I initiall wanted to start from wfixicon, but I felt lazy and didn't want 
to write my own .xpm exporter. The format is simple enough, but checking 
and buffering what colours are used and deciding how many characters to 
use fo reach pixel is something I didn't feel like doing at the moment. So 
I took the easy way out for now.

> And the xpm files also are very evil:
> 
> static char *allegico_xpm[] = {
> "48 48 6 1",
> 
> Apparently a "const" is missing.. so I get lots of warnings - maybe a
> sed could be used on the generated file to add the const. I'd also add
> the const to alex.xpm - even though Allegro doesn't use -Wwrite-strings
> when compiling.

The .xpm specs seem to say that the second line of the file should be 
something like static char *<name>[]  = {. Doesn't mean we can't change it 
when inlining the file though.

> I think it can be added, ideally with my above changes - I tested it
> with my own icon, and works great :) Just make sure the +x flag is set
> for the .sh file when committing, I remember CVS doesn't like changing
> flags afterwards.

Ok, I'll make the modifications you suggested and wait a few days for 
further comments before applying it.

Evert





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/