comparison src/glyphs-msw.c @ 404:2f8bb876ab1d r21-2-32

Import from CVS: tag r21-2-32
author cvs
date Mon, 13 Aug 2007 11:16:07 +0200
parents a86b2b5e0111
children b8cc9ab3f761
comparison
equal deleted inserted replaced
403:9f011ab08d48 404:2f8bb876ab1d
70 #ifdef HAVE_GIF 70 #ifdef HAVE_GIF
71 DECLARE_IMAGE_INSTANTIATOR_FORMAT (gif); 71 DECLARE_IMAGE_INSTANTIATOR_FORMAT (gif);
72 #endif 72 #endif
73 #ifdef HAVE_XPM 73 #ifdef HAVE_XPM
74 DEFINE_DEVICE_IIFORMAT (mswindows, xpm); 74 DEFINE_DEVICE_IIFORMAT (mswindows, xpm);
75 DEFINE_DEVICE_IIFORMAT (msprinter, xpm);
75 #endif 76 #endif
76 DEFINE_DEVICE_IIFORMAT (mswindows, xbm); 77 DEFINE_DEVICE_IIFORMAT (mswindows, xbm);
78 DEFINE_DEVICE_IIFORMAT (msprinter, xbm);
77 #ifdef HAVE_XFACE 79 #ifdef HAVE_XFACE
78 DEFINE_DEVICE_IIFORMAT (mswindows, xface); 80 DEFINE_DEVICE_IIFORMAT (mswindows, xface);
81 DEFINE_DEVICE_IIFORMAT (msprinter, xface);
79 #endif 82 #endif
80 DEFINE_DEVICE_IIFORMAT (mswindows, button); 83 DEFINE_DEVICE_IIFORMAT (mswindows, button);
81 DEFINE_DEVICE_IIFORMAT (mswindows, edit_field); 84 DEFINE_DEVICE_IIFORMAT (mswindows, edit_field);
82 DEFINE_DEVICE_IIFORMAT (mswindows, subwindow); 85 DEFINE_DEVICE_IIFORMAT (mswindows, subwindow);
83 DEFINE_DEVICE_IIFORMAT (mswindows, widget); 86 DEFINE_DEVICE_IIFORMAT (mswindows, widget);
101 mswindows_initialize_dibitmap_image_instance (Lisp_Image_Instance *ii, 104 mswindows_initialize_dibitmap_image_instance (Lisp_Image_Instance *ii,
102 int slices, 105 int slices,
103 enum image_instance_type type); 106 enum image_instance_type type);
104 static void 107 static void
105 mswindows_initialize_image_instance_mask (Lisp_Image_Instance* image, 108 mswindows_initialize_image_instance_mask (Lisp_Image_Instance* image,
106 struct frame* f); 109 HDC hcdc);
110
111 /*
112 * Given device D, retrieve compatible device context. D can be either
113 * mswindows or an msprinter device.
114 */
115 inline static HDC
116 get_device_compdc (struct device *d)
117 {
118 if (DEVICE_MSWINDOWS_P (d))
119 return DEVICE_MSWINDOWS_HCDC (d);
120 else
121 return DEVICE_MSPRINTER_HCDC (d);
122 }
107 123
108 #define BPLINE(width) ((int)(~3UL & (unsigned long)((width) +3))) 124 #define BPLINE(width) ((int)(~3UL & (unsigned long)((width) +3)))
109 125
110 /************************************************************************/ 126 /************************************************************************/
111 /* convert from a series of RGB triples to a BITMAPINFO formated for the*/ 127 /* convert from a series of RGB triples to a BITMAPINFO formated for the*/
122 RGBQUAD* colortbl; 138 RGBQUAD* colortbl;
123 int ncolors; 139 int ncolors;
124 BITMAPINFO* bmp_info; 140 BITMAPINFO* bmp_info;
125 unsigned char *ip, *dp; 141 unsigned char *ip, *dp;
126 142
127 if (DEVICE_MSWINDOWS_BITSPIXEL (d) > 0) 143 if (GetDeviceCaps (get_device_compdc (d), BITSPIXEL) > 0)
128 { 144 {
129 int bpline = BPLINE(width * 3); 145 int bpline = BPLINE(width * 3);
130 /* FIXME: we can do this because 24bpp implies no color table, once 146 /* FIXME: we can do this because 24bpp implies no color table, once
131 * we start palettizing this is no longer true. The X versions of 147 * we start palettizing this is no longer true. The X versions of
132 * this function quantises to 256 colors or bit masks down to a 148 * this function quantises to 256 colors or bit masks down to a
204 xfree (bmp_info); 220 xfree (bmp_info);
205 return NULL; 221 return NULL;
206 } 222 }
207 223
208 /* build up an RGBQUAD colortable */ 224 /* build up an RGBQUAD colortable */
209 for (i = 0; i < qtable->num_active_colors; i++) { 225 for (i = 0; i < qtable->num_active_colors; i++)
210 colortbl[i].rgbRed = (BYTE) qtable->rm[i]; 226 {
211 colortbl[i].rgbGreen = (BYTE) qtable->gm[i]; 227 colortbl[i].rgbRed = (BYTE) qtable->rm[i];
212 colortbl[i].rgbBlue = (BYTE) qtable->bm[i]; 228 colortbl[i].rgbGreen = (BYTE) qtable->gm[i];
213 colortbl[i].rgbReserved = 0; 229 colortbl[i].rgbBlue = (BYTE) qtable->bm[i];
214 } 230 colortbl[i].rgbReserved = 0;
231 }
215 232
216 /* now build up the data. picture has to be upside-down and 233 /* now build up the data. picture has to be upside-down and
217 back-to-front for msw bitmaps */ 234 back-to-front for msw bitmaps */
218 ip = pic; 235 ip = pic;
219 for (i = height-1; i >= 0; i--) { 236 for (i = height-1; i >= 0; i--)
220 dp = (*bmp_data) + (i * bpline); 237 {
221 for (j = 0; j < width; j++) { 238 dp = (*bmp_data) + (i * bpline);
222 rd = *ip++; 239 for (j = 0; j < width; j++)
223 gr = *ip++; 240 {
224 bl = *ip++; 241 rd = *ip++;
225 *dp++ = QUANT_GET_COLOR (qtable,rd,gr,bl); 242 gr = *ip++;
243 bl = *ip++;
244 *dp++ = QUANT_GET_COLOR (qtable,rd,gr,bl);
245 }
226 } 246 }
227 }
228 xfree (qtable); 247 xfree (qtable);
229 } 248 }
230 /* fix up the standard stuff */ 249 /* fix up the standard stuff */
231 bmp_info->bmiHeader.biWidth=width; 250 bmp_info->bmiHeader.biWidth=width;
232 bmp_info->bmiHeader.biHeight=height; 251 bmp_info->bmiHeader.biHeight=height;
294 int x_hot, int y_hot, 313 int x_hot, int y_hot,
295 int create_mask) 314 int create_mask)
296 { 315 {
297 Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii); 316 Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii);
298 struct device *d = XDEVICE (device); 317 struct device *d = XDEVICE (device);
299 struct frame *f;
300 void* bmp_buf=0; 318 void* bmp_buf=0;
301 enum image_instance_type type; 319 enum image_instance_type type;
302 HBITMAP bitmap; 320 HBITMAP bitmap;
303 HDC hdc; 321 HDC hdc;
304
305 if (!DEVICE_MSWINDOWS_P (d))
306 signal_simple_error ("Not an mswindows device", device);
307
308 if (NILP (DEVICE_SELECTED_FRAME (d)))
309 signal_simple_error ("No selected frame on mswindows device", device);
310
311 f = XFRAME (DEVICE_SELECTED_FRAME (d));
312 322
313 if (dest_mask & IMAGE_COLOR_PIXMAP_MASK) 323 if (dest_mask & IMAGE_COLOR_PIXMAP_MASK)
314 type = IMAGE_COLOR_PIXMAP; 324 type = IMAGE_COLOR_PIXMAP;
315 else if (dest_mask & IMAGE_POINTER_MASK) 325 else if (dest_mask & IMAGE_POINTER_MASK)
316 type = IMAGE_POINTER; 326 type = IMAGE_POINTER;
317 else 327 else
318 incompatible_image_types (instantiator, dest_mask, 328 incompatible_image_types (instantiator, dest_mask,
319 IMAGE_COLOR_PIXMAP_MASK | IMAGE_POINTER_MASK); 329 IMAGE_COLOR_PIXMAP_MASK | IMAGE_POINTER_MASK);
320 hdc = FRAME_MSWINDOWS_CDC (f); 330
321 331 hdc = get_device_compdc (d);
322 bitmap=CreateDIBSection (hdc, 332 bitmap = CreateDIBSection (hdc,
323 bmp_info, 333 bmp_info,
324 DIB_RGB_COLORS, 334 DIB_RGB_COLORS,
325 &bmp_buf, 335 &bmp_buf,
326 0,0); 336 0, 0);
327 337
328 if (!bitmap || !bmp_buf) 338 if (!bitmap || !bmp_buf)
329 signal_simple_error ("Unable to create bitmap", instantiator); 339 signal_simple_error ("Unable to create bitmap", instantiator);
330 340
331 /* copy in the actual bitmap */ 341 /* copy in the actual bitmap */
338 348
339 /* Fixup a set of bitmaps. */ 349 /* Fixup a set of bitmaps. */
340 IMAGE_INSTANCE_MSWINDOWS_BITMAP (ii) = bitmap; 350 IMAGE_INSTANCE_MSWINDOWS_BITMAP (ii) = bitmap;
341 351
342 IMAGE_INSTANCE_MSWINDOWS_MASK (ii) = NULL; 352 IMAGE_INSTANCE_MSWINDOWS_MASK (ii) = NULL;
343 IMAGE_INSTANCE_PIXMAP_WIDTH (ii) = bmp_info->bmiHeader.biWidth; 353 IMAGE_INSTANCE_PIXMAP_WIDTH (ii) = bmp_info->bmiHeader.biWidth;
344 IMAGE_INSTANCE_PIXMAP_HEIGHT (ii) = bmp_info->bmiHeader.biHeight; 354 IMAGE_INSTANCE_PIXMAP_HEIGHT (ii) = bmp_info->bmiHeader.biHeight;
345 IMAGE_INSTANCE_PIXMAP_DEPTH (ii) = bmp_info->bmiHeader.biBitCount; 355 IMAGE_INSTANCE_PIXMAP_DEPTH (ii) = bmp_info->bmiHeader.biBitCount;
346 XSETINT (IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (ii), x_hot); 356 XSETINT (IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (ii), x_hot);
347 XSETINT (IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (ii), y_hot); 357 XSETINT (IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (ii), y_hot);
348 358
349 if (create_mask) 359 if (create_mask)
350 { 360 {
351 mswindows_initialize_image_instance_mask (ii, f); 361 mswindows_initialize_image_instance_mask (ii, hdc);
352 } 362 }
353 363
354 if (type == IMAGE_POINTER) 364 if (type == IMAGE_POINTER)
355 { 365 {
356 mswindows_initialize_image_instance_icon(ii, TRUE); 366 mswindows_initialize_image_instance_icon(ii, TRUE);
363 void *bmp_data, 373 void *bmp_data,
364 int bmp_bits, 374 int bmp_bits,
365 int slice, 375 int slice,
366 Lisp_Object instantiator) 376 Lisp_Object instantiator)
367 { 377 {
368 Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii); 378 struct device *d = XDEVICE (IMAGE_INSTANCE_DEVICE (ii));
369 struct device *d = XDEVICE (device);
370 struct frame *f = XFRAME (DEVICE_SELECTED_FRAME (d));
371 void* bmp_buf=0; 379 void* bmp_buf=0;
372 HDC hdc = FRAME_MSWINDOWS_CDC (f); 380
373 HBITMAP bitmap = CreateDIBSection (hdc, 381 HBITMAP bitmap = CreateDIBSection (get_device_compdc (d),
374 bmp_info, 382 bmp_info,
375 DIB_RGB_COLORS, 383 DIB_RGB_COLORS,
376 &bmp_buf, 384 &bmp_buf,
377 0,0); 385 0,0);
378 386
398 unsigned char* bmp_data; 406 unsigned char* bmp_data;
399 int bmp_bits; 407 int bmp_bits;
400 COLORREF bkcolor; 408 COLORREF bkcolor;
401 int slice; 409 int slice;
402 410
403 if (!DEVICE_MSWINDOWS_P (XDEVICE (device))) 411 CHECK_MSGDI_DEVICE (device);
404 signal_simple_error ("Not an mswindows device", device);
405 412
406 /* this is a hack but MaskBlt and TransparentBlt are not supported 413 /* this is a hack but MaskBlt and TransparentBlt are not supported
407 on most windows variants */ 414 on most windows variants */
408 bkcolor = COLOR_INSTANCE_MSWINDOWS_COLOR 415 bkcolor = COLOR_INSTANCE_MSWINDOWS_COLOR
409 (XCOLOR_INSTANCE (FACE_BACKGROUND (Vdefault_face, domain))); 416 (XCOLOR_INSTANCE (FACE_BACKGROUND (Vdefault_face, domain)));
431 xfree (bmp_info); 438 xfree (bmp_info);
432 xfree (bmp_data); 439 xfree (bmp_data);
433 } 440 }
434 } 441 }
435 442
436 static void set_mono_pixel ( unsigned char* bits, 443 inline static void
437 int bpline, int height, 444 set_mono_pixel (unsigned char* bits,
438 int x, int y, int white ) 445 int bpline, int height,
446 int x, int y, int white)
439 { 447 {
440 int i; 448 int i;
441 unsigned char bitnum; 449 unsigned char bitnum;
442 /* Find the byte on which this scanline begins */ 450 /* Find the byte on which this scanline begins */
443 i = (height - y - 1) * bpline; 451 i = (height - y - 1) * bpline;
444 /* Find the byte containing this pixel */ 452 /* Find the byte containing this pixel */
445 i += (x >> 3); 453 i += (x >> 3);
446 /* Which bit is it? */ 454 /* Which bit is it? */
447 bitnum = (unsigned char)( 7 - (x % 8) ); 455 bitnum = (unsigned char) (7 - (x & 7));
448 if( white ) /* Turn it on */ 456 if (white) /* Turn it on */
449 bits[i] |= (1<<bitnum); 457 bits[i] |= (1 << bitnum);
450 else /* Turn it off */ 458 else /* Turn it off */
451 bits[i] &= ~(1<<bitnum); 459 bits[i] &= ~(1 << bitnum);
452 } 460 }
453 461
454 static void 462 static void
455 mswindows_initialize_image_instance_mask (Lisp_Image_Instance* image, 463 mswindows_initialize_image_instance_mask (Lisp_Image_Instance* image,
456 struct frame* f) 464 HDC hcdc)
457 { 465 {
458 HBITMAP mask; 466 HBITMAP mask;
459 HGDIOBJ old = NULL; 467 HGDIOBJ old = NULL;
460 HDC hcdc = FRAME_MSWINDOWS_CDC (f);
461 unsigned char *dibits, *and_bits; 468 unsigned char *dibits, *and_bits;
462 BITMAPINFO *bmp_info = 469 BITMAPINFO *bmp_info =
463 (BITMAPINFO*) xmalloc_and_zero (sizeof(BITMAPINFO) + sizeof(RGBQUAD)); 470 (BITMAPINFO*) xmalloc_and_zero (sizeof (BITMAPINFO) + sizeof (RGBQUAD));
464 int i, j; 471 int i, j;
465 int height = IMAGE_INSTANCE_PIXMAP_HEIGHT (image); 472 int height = IMAGE_INSTANCE_PIXMAP_HEIGHT (image);
466 473
467 int maskbpline = BPLINE ((IMAGE_INSTANCE_PIXMAP_WIDTH (image)+7)/8); 474 int maskbpline = BPLINE ((IMAGE_INSTANCE_PIXMAP_WIDTH (image) + 7) / 8);
468 int bpline = BPLINE (IMAGE_INSTANCE_PIXMAP_WIDTH (image) * 3); 475 int bpline = BPLINE (IMAGE_INSTANCE_PIXMAP_WIDTH (image) * 3);
469 476
470 if (!bmp_info) 477 if (!bmp_info)
471 return; 478 return;
472 479
473 bmp_info->bmiHeader.biWidth=IMAGE_INSTANCE_PIXMAP_WIDTH (image); 480 bmp_info->bmiHeader.biWidth=IMAGE_INSTANCE_PIXMAP_WIDTH (image);
474 bmp_info->bmiHeader.biHeight = height; 481 bmp_info->bmiHeader.biHeight = height;
475 bmp_info->bmiHeader.biPlanes=1; 482 bmp_info->bmiHeader.biPlanes = 1;
476 bmp_info->bmiHeader.biSize=sizeof(BITMAPINFOHEADER); 483 bmp_info->bmiHeader.biSize=sizeof(BITMAPINFOHEADER);
477 bmp_info->bmiHeader.biBitCount=1; 484 bmp_info->bmiHeader.biBitCount = 1;
478 bmp_info->bmiHeader.biCompression=BI_RGB; 485 bmp_info->bmiHeader.biCompression = BI_RGB;
479 bmp_info->bmiHeader.biClrUsed = 2; 486 bmp_info->bmiHeader.biClrUsed = 2;
480 bmp_info->bmiHeader.biClrImportant = 2; 487 bmp_info->bmiHeader.biClrImportant = 2;
481 bmp_info->bmiHeader.biSizeImage = height * maskbpline; 488 bmp_info->bmiHeader.biSizeImage = height * maskbpline;
482 bmp_info->bmiColors[0].rgbRed = 0; 489 bmp_info->bmiColors[0].rgbRed = 0;
483 bmp_info->bmiColors[0].rgbGreen = 0; 490 bmp_info->bmiColors[0].rgbGreen = 0;
502 /* build up an in-memory set of bits to mess with */ 509 /* build up an in-memory set of bits to mess with */
503 xzero (*bmp_info); 510 xzero (*bmp_info);
504 511
505 bmp_info->bmiHeader.biWidth=IMAGE_INSTANCE_PIXMAP_WIDTH (image); 512 bmp_info->bmiHeader.biWidth=IMAGE_INSTANCE_PIXMAP_WIDTH (image);
506 bmp_info->bmiHeader.biHeight = -height; 513 bmp_info->bmiHeader.biHeight = -height;
507 bmp_info->bmiHeader.biPlanes=1; 514 bmp_info->bmiHeader.biPlanes = 1;
508 bmp_info->bmiHeader.biSize=sizeof(BITMAPINFOHEADER); 515 bmp_info->bmiHeader.biSize=sizeof(BITMAPINFOHEADER);
509 bmp_info->bmiHeader.biBitCount=24; 516 bmp_info->bmiHeader.biBitCount = 24;
510 bmp_info->bmiHeader.biCompression=BI_RGB; 517 bmp_info->bmiHeader.biCompression = BI_RGB;
511 bmp_info->bmiHeader.biClrUsed = 0; 518 bmp_info->bmiHeader.biClrUsed = 0;
512 bmp_info->bmiHeader.biClrImportant = 0; 519 bmp_info->bmiHeader.biClrImportant = 0;
513 bmp_info->bmiHeader.biSizeImage = height * bpline; 520 bmp_info->bmiHeader.biSizeImage = height * bpline;
514 521
515 dibits = (unsigned char*) xmalloc_and_zero (bpline * height); 522 dibits = (unsigned char*) xmalloc_and_zero (bpline * height);
576 583
577 IMAGE_INSTANCE_MSWINDOWS_ICON (image)= 584 IMAGE_INSTANCE_MSWINDOWS_ICON (image)=
578 CreateIconIndirect (&x_icon); 585 CreateIconIndirect (&x_icon);
579 } 586 }
580 587
588 static HBITMAP
589 create_resized_bitmap (HBITMAP curbmp, struct frame *f,
590 int curx, int cury,
591 int newx, int newy)
592 {
593 HBITMAP newbmp;
594 HGDIOBJ old1, old2;
595
596 HDC hcdc = get_device_compdc (XDEVICE (FRAME_DEVICE (f)));
597 HDC hdcDst = CreateCompatibleDC (hcdc);
598
599 old1 = SelectObject (hcdc, curbmp);
600
601 newbmp = CreateCompatibleBitmap (hcdc, newx, newy);
602
603 old2 = SelectObject (hdcDst, newbmp);
604
605 if (!StretchBlt (hdcDst, 0, 0, newx, newy,
606 hcdc, 0, 0,
607 curx,
608 cury,
609 SRCCOPY))
610 {
611 DeleteObject (newbmp);
612 DeleteDC (hdcDst);
613 return 0;
614 }
615
616 SelectObject (hdcDst, old2);
617 SelectObject (hcdc, old1);
618 DeleteDC (hdcDst);
619
620 return newbmp;
621 }
622
581 HBITMAP 623 HBITMAP
582 mswindows_create_resized_bitmap (Lisp_Image_Instance* ii, 624 mswindows_create_resized_bitmap (Lisp_Image_Instance* ii,
583 struct frame* f, 625 struct frame* f,
584 int newx, int newy) 626 int newx, int newy)
585 { 627 {
586 HBITMAP newbmp; 628 return create_resized_bitmap (IMAGE_INSTANCE_MSWINDOWS_BITMAP (ii),
587 HGDIOBJ old1, old2; 629 f,
588 HDC hcdc = FRAME_MSWINDOWS_CDC (f); 630 IMAGE_INSTANCE_PIXMAP_WIDTH (ii),
589 HDC hdcDst = CreateCompatibleDC (hcdc); 631 IMAGE_INSTANCE_PIXMAP_HEIGHT (ii),
590 632 newx, newy);
591 old1 = SelectObject (hcdc, IMAGE_INSTANCE_MSWINDOWS_BITMAP (ii));
592
593 newbmp = CreateCompatibleBitmap (hcdc, newx, newy);
594
595 old2 = SelectObject (hdcDst, newbmp);
596
597 if (!StretchBlt (hdcDst, 0, 0, newx, newy,
598 hcdc, 0, 0,
599 IMAGE_INSTANCE_PIXMAP_WIDTH (ii),
600 IMAGE_INSTANCE_PIXMAP_HEIGHT (ii),
601 SRCCOPY))
602 {
603 DeleteObject (newbmp);
604 DeleteDC (hdcDst);
605 return 0;
606 }
607
608 SelectObject (hdcDst, old2);
609 SelectObject (hcdc, old1);
610 DeleteDC (hdcDst);
611
612 return newbmp;
613 } 633 }
614 634
615 HBITMAP 635 HBITMAP
616 mswindows_create_resized_mask (Lisp_Image_Instance* ii, 636 mswindows_create_resized_mask (Lisp_Image_Instance* ii,
617 struct frame* f, 637 struct frame* f,
618 int newx, int newy) 638 int newx, int newy)
619 { 639 {
620 if (IMAGE_INSTANCE_MSWINDOWS_MASK (ii)) 640 if (IMAGE_INSTANCE_MSWINDOWS_MASK (ii) == NULL)
621 { 641 return NULL;
622 HBITMAP newmask; 642
623 HGDIOBJ old1, old2; 643 return create_resized_bitmap (IMAGE_INSTANCE_MSWINDOWS_MASK (ii),
624 HDC hcdc = FRAME_MSWINDOWS_CDC (f); 644 f,
625 HDC hdcDst = CreateCompatibleDC (hcdc); 645 IMAGE_INSTANCE_PIXMAP_WIDTH (ii),
626 646 IMAGE_INSTANCE_PIXMAP_HEIGHT (ii),
627 old1 = SelectObject (hcdc, IMAGE_INSTANCE_MSWINDOWS_MASK (ii)); 647 newx, newy);
628 newmask = CreateCompatibleBitmap(hcdc, newx, newy); 648 }
629 old2 = SelectObject (hdcDst, newmask); 649
630 650 #if 0 /* Currently unused */
631 if (!StretchBlt(hdcDst, 0, 0, newx, newy,
632 hcdc, 0, 0,
633 IMAGE_INSTANCE_PIXMAP_WIDTH (ii),
634 IMAGE_INSTANCE_PIXMAP_HEIGHT (ii),
635 SRCCOPY))
636 {
637 DeleteObject (newmask);
638 DeleteDC (hdcDst);
639 return NULL;
640 }
641
642 SelectObject (hdcDst, old2);
643 SelectObject (hcdc, old1);
644
645 DeleteDC (hdcDst);
646
647 return newmask;
648 }
649
650 return NULL;
651 }
652
653 int 651 int
654 mswindows_resize_dibitmap_instance (Lisp_Image_Instance* ii, 652 mswindows_resize_dibitmap_instance (Lisp_Image_Instance* ii,
655 struct frame* f, 653 struct frame* f,
656 int newx, int newy) 654 int newx, int newy)
657 { 655 {
671 IMAGE_INSTANCE_PIXMAP_WIDTH (ii) = newx; 669 IMAGE_INSTANCE_PIXMAP_WIDTH (ii) = newx;
672 IMAGE_INSTANCE_PIXMAP_HEIGHT (ii) = newy; 670 IMAGE_INSTANCE_PIXMAP_HEIGHT (ii) = newy;
673 671
674 return TRUE; 672 return TRUE;
675 } 673 }
674 #endif
676 675
677 /********************************************************************** 676 /**********************************************************************
678 * XPM * 677 * XPM *
679 **********************************************************************/ 678 **********************************************************************/
680 679
789 "out of memory", image); 788 "out of memory", image);
790 } 789 }
791 default: 790 default:
792 { 791 {
793 signal_double_file_error_2 ("Parsing pixmap data", 792 signal_double_file_error_2 ("Parsing pixmap data",
794 "unknown error code", 793 "unknown error",
795 make_int (result), image); 794 make_int (result), image);
796 } 795 }
797 } 796 }
798 797
799 *width = xpmimage.width; 798 *width = xpmimage.width;
919 918
920 Lisp_Object data = find_keyword_in_vector (instantiator, Q_data); 919 Lisp_Object data = find_keyword_in_vector (instantiator, Q_data);
921 Lisp_Object color_symbol_alist = find_keyword_in_vector (instantiator, 920 Lisp_Object color_symbol_alist = find_keyword_in_vector (instantiator,
922 Q_color_symbols); 921 Q_color_symbols);
923 922
924 if (!DEVICE_MSWINDOWS_P (XDEVICE (device))) 923 CHECK_MSGDI_DEVICE (device);
925 signal_simple_error ("Not an mswindows device", device);
926 924
927 assert (!NILP (data)); 925 assert (!NILP (data));
928 926
929 TO_EXTERNAL_FORMAT (LISP_STRING, data, 927 TO_EXTERNAL_FORMAT (LISP_STRING, data,
930 ALLOCA, (bytes, len), 928 ALLOCA, (bytes, len),
1005 BITMAPINFO* bmp_info; 1003 BITMAPINFO* bmp_info;
1006 void* bmp_data; 1004 void* bmp_data;
1007 int bmp_bits; 1005 int bmp_bits;
1008 Lisp_Object data = find_keyword_in_vector (instantiator, Q_data); 1006 Lisp_Object data = find_keyword_in_vector (instantiator, Q_data);
1009 1007
1010 if (!DEVICE_MSWINDOWS_P (XDEVICE (device))) 1008 CHECK_MSGDI_DEVICE (device);
1011 signal_simple_error ("Not an mswindows device", device);
1012 1009
1013 assert (!NILP (data)); 1010 assert (!NILP (data));
1014 1011
1015 TO_EXTERNAL_FORMAT (LISP_STRING, data, 1012 TO_EXTERNAL_FORMAT (LISP_STRING, data,
1016 ALLOCA, (bytes, len), 1013 ALLOCA, (bytes, len),
1231 Lisp_Object resource_id = find_keyword_in_vector (instantiator, 1228 Lisp_Object resource_id = find_keyword_in_vector (instantiator,
1232 Q_resource_id); 1229 Q_resource_id);
1233 1230
1234 xzero (iconinfo); 1231 xzero (iconinfo);
1235 1232
1236 if (!DEVICE_MSWINDOWS_P (XDEVICE (device))) 1233 CHECK_MSGDI_DEVICE (device);
1237 signal_simple_error ("Not an mswindows device", device);
1238 1234
1239 type = resource_symbol_to_type (resource_type); 1235 type = resource_symbol_to_type (resource_type);
1240 1236
1241 if (dest_mask & IMAGE_POINTER_MASK && type == IMAGE_CURSOR) 1237 if (dest_mask & IMAGE_POINTER_MASK && type == IMAGE_CURSOR)
1242 iitype = IMAGE_POINTER; 1238 iitype = IMAGE_POINTER;
1405 1401
1406 /* 1402 /*
1407 * Table index for the hex values. Initialized once, first time. 1403 * Table index for the hex values. Initialized once, first time.
1408 * Used for translation value or delimiter significance lookup. 1404 * Used for translation value or delimiter significance lookup.
1409 */ 1405 */
1410 static void initHexTable() 1406 static void
1407 initHexTable (void)
1411 { 1408 {
1412 /* 1409 /*
1413 * We build the table at run time for several reasons: 1410 * We build the table at run time for several reasons:
1414 * 1411 *
1415 * 1. portable to non-ASCII machines. 1412 * 1. portable to non-ASCII machines.
1438 } 1435 }
1439 1436
1440 /* 1437 /*
1441 * read next hex value in the input stream, return -1 if EOF 1438 * read next hex value in the input stream, return -1 if EOF
1442 */ 1439 */
1443 static int NextInt ( FILE *fstream ) 1440 static int
1441 NextInt (FILE *fstream)
1444 { 1442 {
1445 int ch; 1443 int ch;
1446 int value = 0; 1444 int value = 0;
1447 int gotone = 0; 1445 int gotone = 0;
1448 int done = 0; 1446 int done = 0;
1728 int dest_mask, 1726 int dest_mask,
1729 HBITMAP mask, 1727 HBITMAP mask,
1730 Lisp_Object mask_filename) 1728 Lisp_Object mask_filename)
1731 { 1729 {
1732 Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii); 1730 Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii);
1733 struct frame* f = XFRAME (DEVICE_SELECTED_FRAME (XDEVICE (device)));
1734 Lisp_Object foreground = find_keyword_in_vector (instantiator, Q_foreground); 1731 Lisp_Object foreground = find_keyword_in_vector (instantiator, Q_foreground);
1735 Lisp_Object background = find_keyword_in_vector (instantiator, Q_background); 1732 Lisp_Object background = find_keyword_in_vector (instantiator, Q_background);
1736 enum image_instance_type type; 1733 enum image_instance_type type;
1737 COLORREF black = PALETTERGB (0,0,0); 1734 COLORREF black = PALETTERGB (0,0,0);
1738 COLORREF white = PALETTERGB (255,255,255); 1735 COLORREF white = PALETTERGB (255,255,255);
1739 1736 HDC hdc;
1740 HDC hdc = FRAME_MSWINDOWS_CDC (f); 1737
1741 1738 CHECK_MSGDI_DEVICE (device);
1742 if (!DEVICE_MSWINDOWS_P (XDEVICE (device))) 1739
1743 signal_simple_error ("Not an MS-Windows device", device); 1740 hdc = get_device_compdc (XDEVICE (device));
1744 1741
1745 if ((dest_mask & IMAGE_MONO_PIXMAP_MASK) && 1742 if ((dest_mask & IMAGE_MONO_PIXMAP_MASK) &&
1746 (dest_mask & IMAGE_COLOR_PIXMAP_MASK)) 1743 (dest_mask & IMAGE_COLOR_PIXMAP_MASK))
1747 { 1744 {
1748 if (!NILP (foreground) || !NILP (background)) 1745 if (!NILP (foreground) || !NILP (background))
1853 const char *bits) 1850 const char *bits)
1854 { 1851 {
1855 Lisp_Object mask_data = find_keyword_in_vector (instantiator, Q_mask_data); 1852 Lisp_Object mask_data = find_keyword_in_vector (instantiator, Q_mask_data);
1856 Lisp_Object mask_file = find_keyword_in_vector (instantiator, Q_mask_file); 1853 Lisp_Object mask_file = find_keyword_in_vector (instantiator, Q_mask_file);
1857 Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); 1854 Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
1858 struct frame* f = XFRAME (DEVICE_SELECTED_FRAME 1855 HDC hdc = get_device_compdc (XDEVICE (IMAGE_INSTANCE_DEVICE (ii)));
1859 (XDEVICE (IMAGE_INSTANCE_DEVICE (ii))));
1860 HDC hdc = FRAME_MSWINDOWS_CDC (f);
1861 HBITMAP mask = 0; 1856 HBITMAP mask = 0;
1862 1857
1863 if (!NILP (mask_data)) 1858 if (!NILP (mask_data))
1864 { 1859 {
1865 const char *ext_data; 1860 const char *ext_data;
2228 Lisp_Object pointer_fg, Lisp_Object pointer_bg, 2223 Lisp_Object pointer_fg, Lisp_Object pointer_bg,
2229 int dest_mask, Lisp_Object domain) 2224 int dest_mask, Lisp_Object domain)
2230 { 2225 {
2231 Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); 2226 Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
2232 Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii); 2227 Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii);
2233 struct device* d = XDEVICE (device);
2234 Lisp_Object frame = FW_FRAME (domain); 2228 Lisp_Object frame = FW_FRAME (domain);
2235 HWND wnd; 2229 HWND wnd;
2236 2230
2237 if (!DEVICE_MSWINDOWS_P (d)) 2231 CHECK_MSWINDOWS_DEVICE (device);
2238 signal_simple_error ("Not an mswindows device", device);
2239 2232
2240 /* have to set the type this late in case there is no device 2233 /* have to set the type this late in case there is no device
2241 instantiation for a widget */ 2234 instantiation for a widget */
2242 IMAGE_INSTANCE_TYPE (ii) = IMAGE_SUBWINDOW; 2235 IMAGE_INSTANCE_TYPE (ii) = IMAGE_SUBWINDOW;
2243 /* Allocate space for the clip window */ 2236 /* Allocate space for the clip window */
2352 const char* class, int flags, int exflags) 2345 const char* class, int flags, int exflags)
2353 { 2346 {
2354 /* this function can call lisp */ 2347 /* this function can call lisp */
2355 Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); 2348 Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
2356 Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii), style; 2349 Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii), style;
2357 struct device* d = XDEVICE (device);
2358 Lisp_Object frame = FW_FRAME (domain); 2350 Lisp_Object frame = FW_FRAME (domain);
2359 Extbyte* nm=0; 2351 Extbyte* nm=0;
2360 HWND wnd; 2352 HWND wnd;
2361 int id = 0xffff; 2353 int id = 0xffff;
2362 Lisp_Object gui = IMAGE_INSTANCE_WIDGET_ITEM (ii); 2354 Lisp_Object gui = IMAGE_INSTANCE_WIDGET_ITEM (ii);
2363 Lisp_Gui_Item* pgui = XGUI_ITEM (gui); 2355 Lisp_Gui_Item* pgui = XGUI_ITEM (gui);
2364 2356
2365 if (!DEVICE_MSWINDOWS_P (d)) 2357 CHECK_MSWINDOWS_DEVICE (device);
2366 signal_simple_error ("Not an mswindows device", device);
2367 2358
2368 if (!gui_item_active_p (gui)) 2359 if (!gui_item_active_p (gui))
2369 flags |= WS_DISABLED; 2360 flags |= WS_DISABLED;
2370 2361
2371 style = pgui->style; 2362 style = pgui->style;
2438 static void 2429 static void
2439 mswindows_button_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, 2430 mswindows_button_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
2440 Lisp_Object pointer_fg, Lisp_Object pointer_bg, 2431 Lisp_Object pointer_fg, Lisp_Object pointer_bg,
2441 int dest_mask, Lisp_Object domain) 2432 int dest_mask, Lisp_Object domain)
2442 { 2433 {
2443 /* this function can call lisp */ 2434 /* This function can call lisp */
2444 Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); 2435 Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
2445 HWND wnd; 2436 HWND wnd;
2446 int flags = WS_TABSTOP;/* BS_NOTIFY #### is needed to get exotic feedback 2437 int flags = WS_TABSTOP;/* BS_NOTIFY #### is needed to get exotic feedback
2447 only. Since we seem to want nothing beyond BN_CLICK, 2438 only. Since we seem to want nothing beyond BN_CLICK,
2448 the style is perhaps not necessary -- kkm */ 2439 the style is perhaps not necessary -- kkm */
2684 static void 2675 static void
2685 mswindows_tab_control_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, 2676 mswindows_tab_control_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
2686 Lisp_Object pointer_fg, Lisp_Object pointer_bg, 2677 Lisp_Object pointer_fg, Lisp_Object pointer_bg,
2687 int dest_mask, Lisp_Object domain) 2678 int dest_mask, Lisp_Object domain)
2688 { 2679 {
2680 /* This function can call lisp */
2689 Lisp_Object rest; 2681 Lisp_Object rest;
2690 HWND wnd; 2682 HWND wnd;
2691 int i = 0; 2683 int i = 0, selected = 0;
2692 Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); 2684 Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
2693 Lisp_Object orient = find_keyword_in_vector (instantiator, Q_orientation); 2685 Lisp_Object orient = find_keyword_in_vector (instantiator, Q_orientation);
2694 unsigned int flags = WS_TABSTOP; 2686 unsigned int flags = WS_TABSTOP;
2695 2687
2696 if (EQ (orient, Qleft) || EQ (orient, Qright)) 2688 if (EQ (orient, Qleft) || EQ (orient, Qright))
2704 2696
2705 mswindows_widget_instantiate (image_instance, instantiator, pointer_fg, 2697 mswindows_widget_instantiate (image_instance, instantiator, pointer_fg,
2706 pointer_bg, dest_mask, domain, WC_TABCONTROL, 2698 pointer_bg, dest_mask, domain, WC_TABCONTROL,
2707 /* borders don't suit tabs so well */ 2699 /* borders don't suit tabs so well */
2708 flags, 0); 2700 flags, 0);
2709
2710 wnd = WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii); 2701 wnd = WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii);
2711 /* add items to the tab */ 2702 /* add items to the tab */
2712 LIST_LOOP (rest, XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii))) 2703 LIST_LOOP (rest, XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii)))
2713 { 2704 {
2714 add_tab_item (image_instance, wnd, XCAR (rest), domain, i); 2705 add_tab_item (image_instance, wnd, XCAR (rest), domain, i);
2706 if (gui_item_selected_p (XCAR (rest)))
2707 selected = i;
2715 i++; 2708 i++;
2716 } 2709 }
2710 SendMessage (wnd, TCM_SETCURSEL, selected, 0);
2717 } 2711 }
2718 2712
2719 /* set the properties of a tab control */ 2713 /* set the properties of a tab control */
2720 static void 2714 static void
2721 mswindows_tab_control_update (Lisp_Object image_instance) 2715 mswindows_tab_control_update (Lisp_Object image_instance)
2722 { 2716 {
2717 /* This function can GC if IN_REDISPLAY is false. */
2723 Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); 2718 Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
2724 2719
2725 if (IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (ii)) 2720 if (IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (ii))
2726 { 2721 {
2727 HWND wnd = WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii); 2722 HWND wnd = WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii);
2728 int i = 0; 2723 int i = 0, selected = 0;
2729 Lisp_Object rest; 2724 Lisp_Object rest;
2730 2725
2731 /* delete the pre-existing items */ 2726 /* delete the pre-existing items */
2732 SendMessage (wnd, TCM_DELETEALLITEMS, 0, 0); 2727 SendMessage (wnd, TCM_DELETEALLITEMS, 0, 0);
2733 2728
2729 /* Pick up the items we recorded earlier. We do this here so
2730 that the callbacks get set up with the new items. */
2731 IMAGE_INSTANCE_WIDGET_ITEMS (ii) =
2732 IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii);
2733 IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii) = Qnil;
2734 /* add items to the tab */ 2734 /* add items to the tab */
2735 LIST_LOOP (rest, XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii))) 2735 LIST_LOOP (rest, XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii)))
2736 { 2736 {
2737 add_tab_item (image_instance, wnd, XCAR (rest), 2737 add_tab_item (image_instance, wnd, XCAR (rest),
2738 IMAGE_INSTANCE_SUBWINDOW_FRAME (ii), i); 2738 IMAGE_INSTANCE_SUBWINDOW_FRAME (ii), i);
2739 if (gui_item_selected_p (XCAR (rest)))
2740 selected = i;
2739 i++; 2741 i++;
2740 } 2742 }
2743 SendMessage (wnd, TCM_SETCURSEL, selected, 0);
2741 } 2744 }
2742 } 2745 }
2743 2746
2744 /* instantiate a static control possible for putting other things in */ 2747 /* instantiate a static control possible for putting other things in */
2745 static void 2748 static void
2924 } 2927 }
2925 2928
2926 void 2929 void
2927 console_type_create_glyphs_mswindows (void) 2930 console_type_create_glyphs_mswindows (void)
2928 { 2931 {
2929 /* image methods */ 2932 /* image methods - display */
2930
2931 CONSOLE_HAS_METHOD (mswindows, print_image_instance); 2933 CONSOLE_HAS_METHOD (mswindows, print_image_instance);
2932 CONSOLE_HAS_METHOD (mswindows, finalize_image_instance); 2934 CONSOLE_HAS_METHOD (mswindows, finalize_image_instance);
2933 CONSOLE_HAS_METHOD (mswindows, unmap_subwindow); 2935 CONSOLE_HAS_METHOD (mswindows, unmap_subwindow);
2934 CONSOLE_HAS_METHOD (mswindows, map_subwindow); 2936 CONSOLE_HAS_METHOD (mswindows, map_subwindow);
2935 CONSOLE_HAS_METHOD (mswindows, update_subwindow); 2937 CONSOLE_HAS_METHOD (mswindows, update_subwindow);
2938 CONSOLE_HAS_METHOD (mswindows, resize_subwindow);
2936 CONSOLE_HAS_METHOD (mswindows, update_widget); 2939 CONSOLE_HAS_METHOD (mswindows, update_widget);
2937 CONSOLE_HAS_METHOD (mswindows, image_instance_equal); 2940 CONSOLE_HAS_METHOD (mswindows, image_instance_equal);
2938 CONSOLE_HAS_METHOD (mswindows, image_instance_hash); 2941 CONSOLE_HAS_METHOD (mswindows, image_instance_hash);
2939 CONSOLE_HAS_METHOD (mswindows, init_image_instance_from_eimage); 2942 CONSOLE_HAS_METHOD (mswindows, init_image_instance_from_eimage);
2940 CONSOLE_HAS_METHOD (mswindows, locate_pixmap_file); 2943 CONSOLE_HAS_METHOD (mswindows, locate_pixmap_file);
2941 CONSOLE_HAS_METHOD (mswindows, resize_subwindow); 2944
2945 /* image methods - printer */
2946 CONSOLE_INHERITS_METHOD (msprinter, mswindows, print_image_instance);
2947 CONSOLE_INHERITS_METHOD (msprinter, mswindows, finalize_image_instance);
2948 CONSOLE_INHERITS_METHOD (msprinter, mswindows, image_instance_equal);
2949 CONSOLE_INHERITS_METHOD (msprinter, mswindows, image_instance_hash);
2950 CONSOLE_INHERITS_METHOD (msprinter, mswindows, init_image_instance_from_eimage);
2951 CONSOLE_INHERITS_METHOD (msprinter, mswindows, locate_pixmap_file);
2942 } 2952 }
2943 2953
2944 void 2954 void
2945 image_instantiator_format_create_glyphs_mswindows (void) 2955 image_instantiator_format_create_glyphs_mswindows (void)
2946 { 2956 {
2947 IIFORMAT_VALID_CONSOLE (mswindows, nothing); 2957 IIFORMAT_VALID_CONSOLE2 (mswindows, msprinter, nothing);
2948 IIFORMAT_VALID_CONSOLE (mswindows, string); 2958 IIFORMAT_VALID_CONSOLE2 (mswindows, msprinter, string);
2949 IIFORMAT_VALID_CONSOLE (mswindows, layout); 2959 IIFORMAT_VALID_CONSOLE2 (mswindows, msprinter, layout);
2950 IIFORMAT_VALID_CONSOLE (mswindows, formatted_string); 2960 IIFORMAT_VALID_CONSOLE2 (mswindows, msprinter, formatted_string);
2951 IIFORMAT_VALID_CONSOLE (mswindows, inherit); 2961 IIFORMAT_VALID_CONSOLE2 (mswindows, msprinter, inherit);
2952 /* image-instantiator types */ 2962 /* image-instantiator types */
2963 INITIALIZE_DEVICE_IIFORMAT (mswindows, xbm);
2964 INITIALIZE_DEVICE_IIFORMAT (msprinter, xbm);
2965 IIFORMAT_HAS_DEVMETHOD (mswindows, xbm, instantiate);
2966 IIFORMAT_INHERITS_DEVMETHOD (msprinter, mswindows, xbm, instantiate);
2953 #ifdef HAVE_XPM 2967 #ifdef HAVE_XPM
2954 INITIALIZE_DEVICE_IIFORMAT (mswindows, xpm); 2968 INITIALIZE_DEVICE_IIFORMAT (mswindows, xpm);
2969 INITIALIZE_DEVICE_IIFORMAT (msprinter, xpm);
2955 IIFORMAT_HAS_DEVMETHOD (mswindows, xpm, instantiate); 2970 IIFORMAT_HAS_DEVMETHOD (mswindows, xpm, instantiate);
2971 IIFORMAT_INHERITS_DEVMETHOD (msprinter, mswindows, xpm, instantiate);
2956 #endif 2972 #endif
2957 INITIALIZE_DEVICE_IIFORMAT (mswindows, xbm);
2958 IIFORMAT_HAS_DEVMETHOD (mswindows, xbm, instantiate);
2959 #ifdef HAVE_XFACE 2973 #ifdef HAVE_XFACE
2960 INITIALIZE_DEVICE_IIFORMAT (mswindows, xface); 2974 INITIALIZE_DEVICE_IIFORMAT (mswindows, xface);
2975 INITIALIZE_DEVICE_IIFORMAT (msprinter, xface);
2961 IIFORMAT_HAS_DEVMETHOD (mswindows, xface, instantiate); 2976 IIFORMAT_HAS_DEVMETHOD (mswindows, xface, instantiate);
2977 IIFORMAT_INHERITS_DEVMETHOD (msprinter, mswindows, xface, instantiate);
2962 #endif 2978 #endif
2963 #ifdef HAVE_JPEG 2979 #ifdef HAVE_JPEG
2964 IIFORMAT_VALID_CONSOLE (mswindows, jpeg); 2980 IIFORMAT_VALID_CONSOLE2 (mswindows, msprinter, jpeg);
2965 #endif 2981 #endif
2966 #ifdef HAVE_TIFF 2982 #ifdef HAVE_TIFF
2967 IIFORMAT_VALID_CONSOLE (mswindows, tiff); 2983 IIFORMAT_VALID_CONSOLE2 (mswindows, msprinter, tiff);
2968 #endif 2984 #endif
2969 #ifdef HAVE_PNG 2985 #ifdef HAVE_PNG
2970 IIFORMAT_VALID_CONSOLE (mswindows, png); 2986 IIFORMAT_VALID_CONSOLE2 (mswindows, msprinter, png);
2971 #endif 2987 #endif
2972 #ifdef HAVE_GIF 2988 #ifdef HAVE_GIF
2973 IIFORMAT_VALID_CONSOLE (mswindows, gif); 2989 IIFORMAT_VALID_CONSOLE2 (mswindows, msprinter, gif);
2974 #endif 2990 #endif
2975 #ifdef HAVE_WIDGETS 2991 #ifdef HAVE_WIDGETS
2976 /* button widget */ 2992 /* button widget */
2977 INITIALIZE_DEVICE_IIFORMAT (mswindows, button); 2993 INITIALIZE_DEVICE_IIFORMAT (mswindows, button);
2978 IIFORMAT_HAS_DEVMETHOD (mswindows, button, property); 2994 IIFORMAT_HAS_DEVMETHOD (mswindows, button, property);
3023 IIFORMAT_HAS_METHOD (bmp, possible_dest_types); 3039 IIFORMAT_HAS_METHOD (bmp, possible_dest_types);
3024 IIFORMAT_HAS_METHOD (bmp, instantiate); 3040 IIFORMAT_HAS_METHOD (bmp, instantiate);
3025 3041
3026 IIFORMAT_VALID_KEYWORD (bmp, Q_data, check_valid_string); 3042 IIFORMAT_VALID_KEYWORD (bmp, Q_data, check_valid_string);
3027 IIFORMAT_VALID_KEYWORD (bmp, Q_file, check_valid_string); 3043 IIFORMAT_VALID_KEYWORD (bmp, Q_file, check_valid_string);
3028 IIFORMAT_VALID_CONSOLE (mswindows, bmp); 3044 IIFORMAT_VALID_CONSOLE2 (mswindows, msprinter, bmp);
3029 3045
3030 /* mswindows resources */ 3046 /* mswindows resources */
3031 INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (mswindows_resource, 3047 INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (mswindows_resource,
3032 "mswindows-resource"); 3048 "mswindows-resource");
3033 3049
3038 3054
3039 IIFORMAT_VALID_KEYWORD (mswindows_resource, Q_resource_type, 3055 IIFORMAT_VALID_KEYWORD (mswindows_resource, Q_resource_type,
3040 check_valid_resource_symbol); 3056 check_valid_resource_symbol);
3041 IIFORMAT_VALID_KEYWORD (mswindows_resource, Q_resource_id, check_valid_resource_id); 3057 IIFORMAT_VALID_KEYWORD (mswindows_resource, Q_resource_id, check_valid_resource_id);
3042 IIFORMAT_VALID_KEYWORD (mswindows_resource, Q_file, check_valid_string); 3058 IIFORMAT_VALID_KEYWORD (mswindows_resource, Q_file, check_valid_string);
3043 IIFORMAT_VALID_CONSOLE (mswindows, mswindows_resource); 3059 IIFORMAT_VALID_CONSOLE2 (mswindows, msprinter, mswindows_resource);
3044 } 3060 }
3045 3061
3046 void 3062 void
3047 vars_of_glyphs_mswindows (void) 3063 vars_of_glyphs_mswindows (void)
3048 { 3064 {