Re: [AD] Allegro window icon under X

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


On Fri, 2004-07-02 at 22:25 +0200, Evert Glebbeek wrote:
> Attached is a preliminary patch that adds support for setting a window icon 
> for X. Note that it would have to be cleaned up somewhat before it can be 
> applied. For now, however, it works!

Ah, very nice, I love this :) Alex even appears on the taskbar and
window selector :):)

And yeah, I agree, a configure check wouldn't be bad, unless we can be
sure the xpm lib is avilable with every X11 (probably it is).

Oh, and your patch is bogus:
--- allegro/src/linux/CVS/Entries       2004-07-02 21:44:35.000000000 +0200
+++ alleg_icon/src/linux/CVS/Entries    2004-07-02 21:42:39.000000000 +0200

You could just have used "cvs diff -Rup ." (or the changed files instead
of . given the slow SF connection speed) to create a diff.

> It adds the symbol 
> char *allegro_icon[] to xwin.c and xwin.h, which contains a standard .xpm 
> pixmap. I have taken the alex.xpm logo for this, actually.
> The allegro_icon is used by _xwin_private_set_window_defaults in xwin.c to 
> set the window icon.
> The allegro_icon is declared as a weak symbol, meaning it can be overridden  
> by the user by simply defining his own allegro_icon. This is convenient, 
> because it is rather close to the way icons are added in the Windows port 
> of Allegro (by defining an allegro_icon resource).
> 
> Two drawbacks: it relies on the compiler providing weak symbols, which 
> works for gcc but may not be supported by other compilers or other 
> platforms. One work around for this one is to provide a platfom-specific 
> xwin_set_window_icon function that the user has to call explicitly. I 
> would prefer the usage of weak symbols if at all possible.
> Secondly, it adds a dependency on libXpm.a. I don't think this is not much 
> of an issue, but it should probably be placed under a configure check, 
> which I haven't done yet.
> 
> Comments please.
> 

I'd much prefer something like set_window_title, e.g. set_window_icon.
Those weak symbols stuff sounds scary to me, and will do so even more to
the typical Allegro user.

The set_window_icon function would do nothing on platforms not
supporting it (just like set_window_title), and on all other platforms
set the icon. We can use your version for X11, and ask anyone knowing
about windows icons on allegro.cc to give us the windows version, and
maybe Angelo can provide the Mac OSX version. And the non-X11 ports
wouldn't have to be done at once anyway, it's nothing really
important :)

-- 
Elias Pschernig





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