comparison src/glyphs-msw.c @ 406:b8cc9ab3f761 r21-2-33

Import from CVS: tag r21-2-33
author cvs
date Mon, 13 Aug 2007 11:17:09 +0200
parents 2f8bb876ab1d
children 501cfd01ee6d
comparison
equal deleted inserted replaced
405:0e08f63c74d2 406:b8cc9ab3f761
119 return DEVICE_MSWINDOWS_HCDC (d); 119 return DEVICE_MSWINDOWS_HCDC (d);
120 else 120 else
121 return DEVICE_MSPRINTER_HCDC (d); 121 return DEVICE_MSPRINTER_HCDC (d);
122 } 122 }
123 123
124 /*
125 * Initialize image instance pixel sizes in II. For a display bitmap,
126 * these will be same as real bitmap sizes. For a printer bitmap,
127 * these will be scaled up so that the bitmap is proportionally enlarged
128 * when output to printer. Redisplay code takes care of scaling, to
129 * conserve memory we do not really scale bitmaps. Set the watermark
130 * only here.
131 * #### Add support for unscalable bitmaps.
132 */
133 static void init_image_instance_geometry (Lisp_Image_Instance *ii)
134 {
135 Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii);
136 struct device *d = XDEVICE (device);
137
138 if (/* #### Scaleable && */ DEVICE_MSPRINTER_P (d))
139 {
140 HDC printer_dc = DEVICE_MSPRINTER_HCDC (d);
141 HDC display_dc = CreateCompatibleDC (NULL);
142 IMAGE_INSTANCE_PIXMAP_WIDTH (ii) =
143 MulDiv (IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_WIDTH (ii),
144 GetDeviceCaps (printer_dc, LOGPIXELSX),
145 GetDeviceCaps (display_dc, LOGPIXELSX));
146 IMAGE_INSTANCE_PIXMAP_HEIGHT (ii) =
147 MulDiv (IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_HEIGHT (ii),
148 GetDeviceCaps (printer_dc, LOGPIXELSY),
149 GetDeviceCaps (display_dc, LOGPIXELSY));
150 }
151 else
152 {
153 IMAGE_INSTANCE_PIXMAP_WIDTH (ii) =
154 IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_WIDTH (ii);
155 IMAGE_INSTANCE_PIXMAP_HEIGHT (ii) =
156 IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_HEIGHT (ii);
157 }
158 }
159
124 #define BPLINE(width) ((int)(~3UL & (unsigned long)((width) +3))) 160 #define BPLINE(width) ((int)(~3UL & (unsigned long)((width) +3)))
125 161
126 /************************************************************************/ 162 /************************************************************************/
127 /* convert from a series of RGB triples to a BITMAPINFO formated for the*/ 163 /* convert from a series of RGB triples to a BITMAPINFO formated for the*/
128 /* proper display */ 164 /* proper display */
348 384
349 /* Fixup a set of bitmaps. */ 385 /* Fixup a set of bitmaps. */
350 IMAGE_INSTANCE_MSWINDOWS_BITMAP (ii) = bitmap; 386 IMAGE_INSTANCE_MSWINDOWS_BITMAP (ii) = bitmap;
351 387
352 IMAGE_INSTANCE_MSWINDOWS_MASK (ii) = NULL; 388 IMAGE_INSTANCE_MSWINDOWS_MASK (ii) = NULL;
353 IMAGE_INSTANCE_PIXMAP_WIDTH (ii) = bmp_info->bmiHeader.biWidth; 389 IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_WIDTH (ii) =
354 IMAGE_INSTANCE_PIXMAP_HEIGHT (ii) = bmp_info->bmiHeader.biHeight; 390 bmp_info->bmiHeader.biWidth;
391 IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_HEIGHT (ii) =
392 bmp_info->bmiHeader.biHeight;
355 IMAGE_INSTANCE_PIXMAP_DEPTH (ii) = bmp_info->bmiHeader.biBitCount; 393 IMAGE_INSTANCE_PIXMAP_DEPTH (ii) = bmp_info->bmiHeader.biBitCount;
356 XSETINT (IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (ii), x_hot); 394 XSETINT (IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (ii), x_hot);
357 XSETINT (IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (ii), y_hot); 395 XSETINT (IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (ii), y_hot);
396 init_image_instance_geometry (ii);
358 397
359 if (create_mask) 398 if (create_mask)
360 { 399 {
361 mswindows_initialize_image_instance_mask (ii, hdc); 400 mswindows_initialize_image_instance_mask (ii, hdc);
362 } 401 }
467 HGDIOBJ old = NULL; 506 HGDIOBJ old = NULL;
468 unsigned char *dibits, *and_bits; 507 unsigned char *dibits, *and_bits;
469 BITMAPINFO *bmp_info = 508 BITMAPINFO *bmp_info =
470 (BITMAPINFO*) xmalloc_and_zero (sizeof (BITMAPINFO) + sizeof (RGBQUAD)); 509 (BITMAPINFO*) xmalloc_and_zero (sizeof (BITMAPINFO) + sizeof (RGBQUAD));
471 int i, j; 510 int i, j;
472 int height = IMAGE_INSTANCE_PIXMAP_HEIGHT (image); 511 int height = IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_HEIGHT (image);
473 512
474 int maskbpline = BPLINE ((IMAGE_INSTANCE_PIXMAP_WIDTH (image) + 7) / 8); 513 int maskbpline = BPLINE ((IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_WIDTH (image) + 7) / 8);
475 int bpline = BPLINE (IMAGE_INSTANCE_PIXMAP_WIDTH (image) * 3); 514 int bpline = BPLINE (IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_WIDTH (image) * 3);
476 515
477 if (!bmp_info) 516 if (!bmp_info)
478 return; 517 return;
479 518
480 bmp_info->bmiHeader.biWidth=IMAGE_INSTANCE_PIXMAP_WIDTH (image); 519 bmp_info->bmiHeader.biWidth=IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_WIDTH (image);
481 bmp_info->bmiHeader.biHeight = height; 520 bmp_info->bmiHeader.biHeight = height;
482 bmp_info->bmiHeader.biPlanes = 1; 521 bmp_info->bmiHeader.biPlanes = 1;
483 bmp_info->bmiHeader.biSize=sizeof(BITMAPINFOHEADER); 522 bmp_info->bmiHeader.biSize=sizeof(BITMAPINFOHEADER);
484 bmp_info->bmiHeader.biBitCount = 1; 523 bmp_info->bmiHeader.biBitCount = 1;
485 bmp_info->bmiHeader.biCompression = BI_RGB; 524 bmp_info->bmiHeader.biCompression = BI_RGB;
507 546
508 old = SelectObject (hcdc, IMAGE_INSTANCE_MSWINDOWS_BITMAP (image)); 547 old = SelectObject (hcdc, IMAGE_INSTANCE_MSWINDOWS_BITMAP (image));
509 /* build up an in-memory set of bits to mess with */ 548 /* build up an in-memory set of bits to mess with */
510 xzero (*bmp_info); 549 xzero (*bmp_info);
511 550
512 bmp_info->bmiHeader.biWidth=IMAGE_INSTANCE_PIXMAP_WIDTH (image); 551 bmp_info->bmiHeader.biWidth = IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_WIDTH (image);
513 bmp_info->bmiHeader.biHeight = -height; 552 bmp_info->bmiHeader.biHeight = -height;
514 bmp_info->bmiHeader.biPlanes = 1; 553 bmp_info->bmiHeader.biPlanes = 1;
515 bmp_info->bmiHeader.biSize=sizeof(BITMAPINFOHEADER); 554 bmp_info->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
516 bmp_info->bmiHeader.biBitCount = 24; 555 bmp_info->bmiHeader.biBitCount = 24;
517 bmp_info->bmiHeader.biCompression = BI_RGB; 556 bmp_info->bmiHeader.biCompression = BI_RGB;
518 bmp_info->bmiHeader.biClrUsed = 0; 557 bmp_info->bmiHeader.biClrUsed = 0;
519 bmp_info->bmiHeader.biClrImportant = 0; 558 bmp_info->bmiHeader.biClrImportant = 0;
520 bmp_info->bmiHeader.biSizeImage = height * bpline; 559 bmp_info->bmiHeader.biSizeImage = height * bpline;
532 return; 571 return;
533 } 572 }
534 573
535 /* now set the colored bits in the mask and transparent ones to 574 /* now set the colored bits in the mask and transparent ones to
536 black in the original */ 575 black in the original */
537 for (i=0; i<IMAGE_INSTANCE_PIXMAP_WIDTH (image); i++) 576 for (i = 0; i < IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_WIDTH (image); i++)
538 { 577 {
539 for (j=0; j<height; j++) 578 for (j=0; j<height; j++)
540 { 579 {
541 unsigned char* idx = &dibits[j * bpline + i * 3]; 580 unsigned char* idx = &dibits[j * bpline + i * 3];
542 581
625 struct frame* f, 664 struct frame* f,
626 int newx, int newy) 665 int newx, int newy)
627 { 666 {
628 return create_resized_bitmap (IMAGE_INSTANCE_MSWINDOWS_BITMAP (ii), 667 return create_resized_bitmap (IMAGE_INSTANCE_MSWINDOWS_BITMAP (ii),
629 f, 668 f,
630 IMAGE_INSTANCE_PIXMAP_WIDTH (ii), 669 IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_WIDTH (ii),
631 IMAGE_INSTANCE_PIXMAP_HEIGHT (ii), 670 IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_HEIGHT (ii),
632 newx, newy); 671 newx, newy);
633 } 672 }
634 673
635 HBITMAP 674 HBITMAP
636 mswindows_create_resized_mask (Lisp_Image_Instance* ii, 675 mswindows_create_resized_mask (Lisp_Image_Instance* ii,
640 if (IMAGE_INSTANCE_MSWINDOWS_MASK (ii) == NULL) 679 if (IMAGE_INSTANCE_MSWINDOWS_MASK (ii) == NULL)
641 return NULL; 680 return NULL;
642 681
643 return create_resized_bitmap (IMAGE_INSTANCE_MSWINDOWS_MASK (ii), 682 return create_resized_bitmap (IMAGE_INSTANCE_MSWINDOWS_MASK (ii),
644 f, 683 f,
645 IMAGE_INSTANCE_PIXMAP_WIDTH (ii), 684 IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_WIDTH (ii),
646 IMAGE_INSTANCE_PIXMAP_HEIGHT (ii), 685 IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_HEIGHT (ii),
647 newx, newy); 686 newx, newy);
648 } 687 }
649 688
650 #if 0 /* Currently unused */ 689 #if 0 /* Currently unused */
690 /* #### Warining: This function is not correct anymore with
691 resizable printer bitmaps. If you uncomment it, clean it. --kkm */
651 int 692 int
652 mswindows_resize_dibitmap_instance (Lisp_Image_Instance* ii, 693 mswindows_resize_dibitmap_instance (Lisp_Image_Instance* ii,
653 struct frame* f, 694 struct frame* f,
654 int newx, int newy) 695 int newx, int newy)
655 { 696 {
1287 FreeLibrary (hinst); 1328 FreeLibrary (hinst);
1288 1329
1289 mswindows_initialize_dibitmap_image_instance (ii, 1, iitype); 1330 mswindows_initialize_dibitmap_image_instance (ii, 1, iitype);
1290 1331
1291 IMAGE_INSTANCE_PIXMAP_FILENAME (ii) = file; 1332 IMAGE_INSTANCE_PIXMAP_FILENAME (ii) = file;
1292 IMAGE_INSTANCE_PIXMAP_WIDTH (ii) = 1333 IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_WIDTH (ii) =
1293 GetSystemMetrics (type == IMAGE_CURSOR ? SM_CXCURSOR : SM_CXICON); 1334 GetSystemMetrics (type == IMAGE_CURSOR ? SM_CXCURSOR : SM_CXICON);
1294 IMAGE_INSTANCE_PIXMAP_HEIGHT (ii) = 1335 IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_HEIGHT (ii) =
1295 GetSystemMetrics (type == IMAGE_CURSOR ? SM_CYCURSOR : SM_CYICON); 1336 GetSystemMetrics (type == IMAGE_CURSOR ? SM_CYCURSOR : SM_CYICON);
1296 IMAGE_INSTANCE_PIXMAP_DEPTH (ii) = 1; 1337 IMAGE_INSTANCE_PIXMAP_DEPTH (ii) = 1;
1338 init_image_instance_geometry (ii);
1297 1339
1298 /* hey, we've got an icon type thing so we can reverse engineer the 1340 /* hey, we've got an icon type thing so we can reverse engineer the
1299 bitmap and mask */ 1341 bitmap and mask */
1300 if (type != IMAGE_BITMAP) 1342 if (type != IMAGE_BITMAP)
1301 { 1343 {
1760 1802
1761 mswindows_initialize_dibitmap_image_instance (ii, 1, type); 1803 mswindows_initialize_dibitmap_image_instance (ii, 1, type);
1762 1804
1763 IMAGE_INSTANCE_PIXMAP_FILENAME (ii) = 1805 IMAGE_INSTANCE_PIXMAP_FILENAME (ii) =
1764 find_keyword_in_vector (instantiator, Q_file); 1806 find_keyword_in_vector (instantiator, Q_file);
1765 IMAGE_INSTANCE_PIXMAP_WIDTH (ii) = width; 1807 IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_WIDTH (ii) = width;
1766 IMAGE_INSTANCE_PIXMAP_HEIGHT (ii) = height; 1808 IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_HEIGHT (ii) = height;
1767 IMAGE_INSTANCE_PIXMAP_DEPTH (ii) = 1; 1809 IMAGE_INSTANCE_PIXMAP_DEPTH (ii) = 1;
1768 XSETINT (IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (ii), 0); 1810 XSETINT (IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (ii), 0);
1769 XSETINT (IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (ii), 0); 1811 XSETINT (IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (ii), 0);
1812 init_image_instance_geometry (ii);
1813
1770 IMAGE_INSTANCE_MSWINDOWS_MASK (ii) = mask ? mask : 1814 IMAGE_INSTANCE_MSWINDOWS_MASK (ii) = mask ? mask :
1771 xbm_create_bitmap_from_data (hdc, (Extbyte *) bits, width, height, 1815 xbm_create_bitmap_from_data (hdc, (Extbyte *) bits, width, height,
1772 TRUE, black, white); 1816 TRUE, black, white);
1773 1817
1774 switch (type) 1818 switch (type)
2164 needs to be checked and all appropriate widgets updated */ 2208 needs to be checked and all appropriate widgets updated */
2165 static void 2209 static void
2166 mswindows_update_widget (Lisp_Image_Instance *p) 2210 mswindows_update_widget (Lisp_Image_Instance *p)
2167 { 2211 {
2168 /* Possibly update the face font and colors. */ 2212 /* Possibly update the face font and colors. */
2169 if (IMAGE_INSTANCE_WIDGET_FACE_CHANGED (p)) 2213 if (IMAGE_INSTANCE_WIDGET_FACE_CHANGED (p)
2214 ||
2215 XFRAME (IMAGE_INSTANCE_SUBWINDOW_FRAME (p))->faces_changed
2216 ||
2217 IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (p))
2170 { 2218 {
2171 /* set the widget font from the widget face */ 2219 /* set the widget font from the widget face */
2172 SendMessage (WIDGET_INSTANCE_MSWINDOWS_HANDLE (p), 2220 SendMessage (WIDGET_INSTANCE_MSWINDOWS_HANDLE (p),
2173 WM_SETFONT, 2221 WM_SETFONT,
2174 (WPARAM) mswindows_widget_hfont 2222 (WPARAM) mswindows_widget_hfont
2196 2244
2197 /* register widgets into our hastable so that we can cope with the 2245 /* register widgets into our hastable so that we can cope with the
2198 callbacks. The hashtable is weak so deregistration is handled 2246 callbacks. The hashtable is weak so deregistration is handled
2199 automatically */ 2247 automatically */
2200 static int 2248 static int
2201 mswindows_register_gui_item (Lisp_Object gui, Lisp_Object domain) 2249 mswindows_register_gui_item (Lisp_Object image_instance,
2250 Lisp_Object gui, Lisp_Object domain)
2202 { 2251 {
2203 Lisp_Object frame = FW_FRAME (domain); 2252 Lisp_Object frame = FW_FRAME (domain);
2204 struct frame* f = XFRAME (frame); 2253 struct frame* f = XFRAME (frame);
2205 int id = gui_item_id_hash (FRAME_MSWINDOWS_WIDGET_HASH_TABLE (f), 2254 int id = gui_item_id_hash (FRAME_MSWINDOWS_WIDGET_HASH_TABLE2 (f),
2206 gui, 2255 gui,
2207 WIDGET_GLYPH_SLOT); 2256 WIDGET_GLYPH_SLOT);
2208 Fputhash (make_int (id), 2257 Fputhash (make_int (id), image_instance,
2209 XGUI_ITEM (gui)->callback, 2258 FRAME_MSWINDOWS_WIDGET_HASH_TABLE1 (f));
2210 FRAME_MSWINDOWS_WIDGET_HASH_TABLE (f)); 2259 Fputhash (make_int (id), XGUI_ITEM (gui)->callback,
2260 FRAME_MSWINDOWS_WIDGET_HASH_TABLE2 (f));
2261 Fputhash (make_int (id), XGUI_ITEM (gui)->callback_ex,
2262 FRAME_MSWINDOWS_WIDGET_HASH_TABLE3 (f));
2211 return id; 2263 return id;
2212 } 2264 }
2213 2265
2214 static int 2266 static int
2215 mswindows_register_widget_instance (Lisp_Object instance, Lisp_Object domain) 2267 mswindows_register_widget_instance (Lisp_Object instance, Lisp_Object domain)
2216 { 2268 {
2217 return mswindows_register_gui_item (XIMAGE_INSTANCE_WIDGET_ITEM (instance), 2269 return mswindows_register_gui_item (instance,
2270 XIMAGE_INSTANCE_WIDGET_ITEM (instance),
2218 domain); 2271 domain);
2219 } 2272 }
2220 2273
2221 static void 2274 static void
2222 mswindows_subwindow_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, 2275 mswindows_subwindow_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
2359 if (!gui_item_active_p (gui)) 2412 if (!gui_item_active_p (gui))
2360 flags |= WS_DISABLED; 2413 flags |= WS_DISABLED;
2361 2414
2362 style = pgui->style; 2415 style = pgui->style;
2363 2416
2364 if (!NILP (pgui->callback)) 2417 if (!NILP (pgui->callback) || !NILP (pgui->callback_ex))
2365 { 2418 {
2366 id = mswindows_register_widget_instance (image_instance, domain); 2419 id = mswindows_register_widget_instance (image_instance, domain);
2367 } 2420 }
2368 2421
2369 if (!NILP (IMAGE_INSTANCE_WIDGET_TEXT (ii))) 2422 if (!NILP (IMAGE_INSTANCE_WIDGET_TEXT (ii)))
2565 tvitem.item.mask = TVIF_TEXT | TVIF_CHILDREN; 2618 tvitem.item.mask = TVIF_TEXT | TVIF_CHILDREN;
2566 tvitem.item.cChildren = children; 2619 tvitem.item.cChildren = children;
2567 2620
2568 if (GUI_ITEMP (item)) 2621 if (GUI_ITEMP (item))
2569 { 2622 {
2570 tvitem.item.lParam = mswindows_register_gui_item (item, domain); 2623 tvitem.item.lParam = mswindows_register_gui_item (image_instance,
2624 item, domain);
2571 tvitem.item.mask |= TVIF_PARAM; 2625 tvitem.item.mask |= TVIF_PARAM;
2572 TO_EXTERNAL_FORMAT (LISP_STRING, XGUI_ITEM (item)->name, 2626 TO_EXTERNAL_FORMAT (LISP_STRING, XGUI_ITEM (item)->name,
2573 C_STRING_ALLOCA, tvitem.item.pszText, 2627 C_STRING_ALLOCA, tvitem.item.pszText,
2574 Qnative); 2628 Qnative);
2575 } 2629 }
2647 2701
2648 tvitem.mask = TCIF_TEXT; 2702 tvitem.mask = TCIF_TEXT;
2649 2703
2650 if (GUI_ITEMP (item)) 2704 if (GUI_ITEMP (item))
2651 { 2705 {
2652 tvitem.lParam = mswindows_register_gui_item (item, domain); 2706 tvitem.lParam = mswindows_register_gui_item (image_instance,
2707 item, domain);
2653 tvitem.mask |= TCIF_PARAM; 2708 tvitem.mask |= TCIF_PARAM;
2654 TO_EXTERNAL_FORMAT (LISP_STRING, XGUI_ITEM (item)->name, 2709 TO_EXTERNAL_FORMAT (LISP_STRING, XGUI_ITEM (item)->name,
2655 C_STRING_ALLOCA, tvitem.pszText, 2710 C_STRING_ALLOCA, tvitem.pszText,
2656 Qnative); 2711 Qnative);
2657 } 2712 }
2724 Lisp_Object rest; 2779 Lisp_Object rest;
2725 2780
2726 /* delete the pre-existing items */ 2781 /* delete the pre-existing items */
2727 SendMessage (wnd, TCM_DELETEALLITEMS, 0, 0); 2782 SendMessage (wnd, TCM_DELETEALLITEMS, 0, 0);
2728 2783
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 */ 2784 /* add items to the tab */
2735 LIST_LOOP (rest, XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii))) 2785 LIST_LOOP (rest, XCDR (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii)))
2736 { 2786 {
2737 add_tab_item (image_instance, wnd, XCAR (rest), 2787 add_tab_item (image_instance, wnd, XCAR (rest),
2738 IMAGE_INSTANCE_SUBWINDOW_FRAME (ii), i); 2788 IMAGE_INSTANCE_SUBWINDOW_FRAME (ii), i);
2739 if (gui_item_selected_p (XCAR (rest))) 2789 if (gui_item_selected_p (XCAR (rest)))
2740 selected = i; 2790 selected = i;
2879 static void 2929 static void
2880 mswindows_progress_gauge_update (Lisp_Object image_instance) 2930 mswindows_progress_gauge_update (Lisp_Object image_instance)
2881 { 2931 {
2882 Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); 2932 Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
2883 2933
2884 if (IMAGE_INSTANCE_WIDGET_PERCENT_CHANGED (ii)) 2934 if (IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (ii))
2885 { 2935 {
2886 /* #### I'm not convinced we should store this in the plist. */ 2936 Lisp_Object val;
2887 Lisp_Object val = Fplist_get (IMAGE_INSTANCE_WIDGET_PROPS (ii), 2937 #ifdef ERROR_CHECK_GLYPHS
2888 Q_percent, Qnil); 2938 assert (GUI_ITEMP (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii)));
2939 #endif
2940 val = XGUI_ITEM (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii))->value;
2941 #ifdef DEBUG_WIDGET_OUTPUT
2942 printf ("progress gauge displayed value on %p updated to %ld\n",
2943 WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii),
2944 XINT(val));
2945 #endif
2889 CHECK_INT (val); 2946 CHECK_INT (val);
2890 SendMessage (WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii), 2947 SendMessage (WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii),
2891 PBM_SETPOS, (WPARAM)XINT (val), 0); 2948 PBM_SETPOS, (WPARAM)XINT (val), 0);
2892 } 2949 }
2893 } 2950 }