xbm support:
/*----------------------------------------------------------------------*/
/* bitmaps */
/*----------------------------------------------------------------------*/
/* this table flips four bits around. */
static int flip_table[] =
{
0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15
};
/* the bitmap data comes in the following format:
Widths are padded to a multiple of 8. Scan lines are stored in increasing
byte order from left to right, little-endian within a byte. 0 = white,
1 = black.
It must be converted to the following format:
Widths are padded to a multiple of 16. Scan lines are stored in
increasing
byte order from left to right, big-endian within a byte. 0 = black,
1 = white.
*/
DllExport Pixmap
XCreateBitmapFromData (Display *display, Drawable d, char *data,
unsigned int width, unsigned int height)
{
int old_width = (width + 7)/8;
int new_width = 2*((width + 15)/16);
unsigned char far *offset;
unsigned char *new_data, *new_offset;
unsigned int i;
int j;
HBITMAP hb;
new_data = (unsigned char *) malloc (height*new_width);
for (i=0; i<height; i++)
{
offset = data + i*old_width;
new_offset = new_data + i*new_width;
new_offset[new_width - 1] = 0; /* there may be an extra byte that
needs to be padded */
for (j=0; j<old_width; j++)
{
int byte = offset[j];
new_offset[j] = ~ (unsigned char)
((flip_table[byte & 0xf] << 4) + flip_table[byte >> 4]);
}
}
hb = CreateBitmap (width, height, 1, 1, new_data);
dict_add (handle_dict, (int) hb, type_bitmap);
free (new_data);
return (Pixmap) hb;
}
Hrvoje Niksic wrote:
Andy Piper <andyp(a)parallax.co.uk> writes:
> >* The toolbars are ugly black-and-white, with the ugly-looking
> > captions. However, my XEmacs does appear to have XPM support (I was
> > able to see gnus.xpm properly). Does anyone have a clue why this is
> > so?
>
> Huh? I get greyscale toolbars which is what you get under
> unix. There is no xbm support so the standard B&W toolbars are
> impossible.
OK, maybe what I saw were downsized toolbars, which made them look
ugly? I'm not sure if they're b&w or greyscale, but they sure are
ugly as hell!
> >* Continuation glyphs are characters instead of glyphs. This
> > should be quite easy to fix -- those glyphs are b&w.
>
> I think these are xbm and hence not implemented. They need to be
> converted to xpm.
Hmph.
> >* Toolbars are displaying balloon-help (tooltips) by default. This is
> > nice, but:
> >
> > - Will it clash with the people currently using the `balloon-help'
> > Lisp package;
>
> Does it work under nt?
I forgot to try it.
> >* Whoever thought of that default size should be @#$@!#$#@$! :-)
> > (frame-width) says 78, and (frame-height) says 18. Horrible.
>
> Yes! I'm hoping this will get fixed one way or another.
And the above value is wrong. What I actually get is 71 x 19!
> >* Certain menubar items don't work, or don't do anything useful. This
> > should be polished before the release. Examples:
> > - Font menu
>
> This will not be fixed for 21.0.
Yeah, but it should be removed from the menu under Windows, if it does
not work. That's all I meant.
> >* The docstrings were missing. This is probably a deficiency of
> > Fabrice's distribution. Also, I wasn't able to send out a mail due
> > to lack of `fakemail'.
>
> You can use smtpmail.
Then it should be set up by default...
--
Hrvoje Niksic <hniksic(a)srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
"Psychos _do not_ explode when sunlight hits them."