[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: XPM via Lisp in the toolbar

From: Oliver Scholz
Subject: Re: XPM via Lisp in the toolbar
Date: Wed, 13 Nov 2002 18:15:36 +0100
User-agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 (i386-msvc-nt5.1.2600)

Oliver Scholz <address@hidden> writes:

> Some time ago I posted a library to deal with XPM images (internally:
> convert them to PPM) to this group. I am currently working on this
> again [...]

Maybe I should post my code, too (attached). I am finished with xpm.el
so far, except that I yet have to check whether transparency does work
on the X Windowing system -- it sure does not work on MS Windows XP.

So far my code provides a function `xpm-create-image' that returns an
image descriptor. This image descriptor contains a string containing
PPM image data as the value of the :data attribute and a value for the
:mask attribute that matches pixels for which the XPM image specified
transparency. Thus Emacs should be able to display the image correctly
if it has proper image support at all.

The question remains how to hook this into the rest of Emacs. The
simple way would be to do nothing but add this package (provided that
you like it, of course). Then packages like gamegrid could use
`xpm-create-image' directly. But this would lead to Emacs supporting
XPM in some cases and in other cases not.

Or I could hook `xpm-create-image' into the appropriate functions in
image.el. I have already done the work needed, save some more
extensive testing. Emacs would then always support XPM, albeit a
little bit slower if it was not compiled with support for XPM on the C
level. I think this is nicer and more consistent. But what to do with
the tool bar? On MS Windows this breaks the tool bar totally. And
whether the additional delay at startup is endurable or not is another
question. It is not notable on my new computer, but it might be on
older machines (I don't know). The delay at startup would not be an
issue anymore, of course, if we convert the XPM icons in lisp/toolbar/
to PPM as Dave Love suggested.

Or I could add a caching mechanism to toolbar.el so that the
conversion happens only once. This would allow to keep the XPM icons
and get rid of the PBM icons instead, because the XPM format allows to
tweak the image for different display types.

Attachment: xpm.el
Description: application/emacs-lisp

xpm.el needs another package named state-m.el that provides an easy
way to write a state machine for reader functions:

Attachment: state-m.el
Description: application/emacs-lisp

Patch for lispref/text.texi regarding state-m.el:

Attachment: text.diff
Description: Text Data

Oliver Scholz               23 Brumaire an 211 de la Révolution
Taunusstr. 25               Liberté, Egalité, Fraternité!
60329 Frankfurt a. M.       http://www.jungdemokratenhessen.de
Tel. (069) 97 40 99 42      http://www.jdjl.org

reply via email to

[Prev in Thread] Current Thread [Next in Thread]