comparison src/toolbar-msw.c @ 1726:a8d8f419b459

[xemacs-hg @ 2003-09-30 15:26:34 by james] Add type information to xfree to avoid alias creation.
author james
date Tue, 30 Sep 2003 15:27:01 +0000
parents f0af455e89d9
children 04bc9d2f42c7
comparison
equal deleted inserted replaced
1725:7ff8f4d70aec 1726:a8d8f419b459
292 IMAGE_INSTANCE_PIXMAP_WIDTH (p)); 292 IMAGE_INSTANCE_PIXMAP_WIDTH (p));
293 293
294 if (! (bitmap = mswindows_create_resized_bitmap 294 if (! (bitmap = mswindows_create_resized_bitmap
295 (p, f, bmwidth, bmheight))) 295 (p, f, bmwidth, bmheight)))
296 { 296 {
297 xfree (button_tbl); 297 xfree (button_tbl, TBBUTTON *);
298 if (ilist) ImageList_Destroy (ilist); 298 if (ilist) ImageList_Destroy (ilist);
299 gui_error ("Couldn't resize pixmap", instance); 299 gui_error ("Couldn't resize pixmap", instance);
300 } 300 }
301 /* we don't care if the mask fails */ 301 /* we don't care if the mask fails */
302 mask = mswindows_create_resized_mask 302 mask = mswindows_create_resized_mask
315 ( bmwidth, bmheight, 315 ( bmwidth, bmheight,
316 (IMAGE_INSTANCE_MSWINDOWS_MASK (p) 316 (IMAGE_INSTANCE_MSWINDOWS_MASK (p)
317 ? ILC_MASK : 0) | ILC_COLOR24, 317 ? ILC_MASK : 0) | ILC_COLOR24,
318 nbuttons, nbuttons * 2 ))) 318 nbuttons, nbuttons * 2 )))
319 { 319 {
320 xfree (button_tbl); 320 xfree (button_tbl, TBBUTTON *);
321 gui_error ("Couldn't create image list", instance); 321 gui_error ("Couldn't create image list", instance);
322 } 322 }
323 323
324 /* make the mask actually do something */ 324 /* make the mask actually do something */
325 ImageList_SetBkColor (ilist, CLR_NONE); 325 ImageList_SetBkColor (ilist, CLR_NONE);
330 bitmap ? bitmap 330 bitmap ? bitmap
331 : IMAGE_INSTANCE_MSWINDOWS_BITMAP (p), 331 : IMAGE_INSTANCE_MSWINDOWS_BITMAP (p),
332 mask ? mask 332 mask ? mask
333 : IMAGE_INSTANCE_MSWINDOWS_MASK (p))) < 0) 333 : IMAGE_INSTANCE_MSWINDOWS_MASK (p))) < 0)
334 { 334 {
335 xfree (button_tbl); 335 xfree (button_tbl, TBBUTTON *);
336 if (ilist) 336 if (ilist)
337 ImageList_Destroy (ilist); 337 ImageList_Destroy (ilist);
338 gui_error 338 gui_error
339 ("couldn't add image to image list", instance); 339 ("couldn't add image to image list", instance);
340 } 340 }
392 FRAME_MSWINDOWS_HANDLE (f), 392 FRAME_MSWINDOWS_HANDLE (f),
393 (HMENU)(TOOLBAR_ID_BIAS + pos), 393 (HMENU)(TOOLBAR_ID_BIAS + pos),
394 NULL, 394 NULL,
395 NULL))==NULL) 395 NULL))==NULL)
396 { 396 {
397 xfree (button_tbl); 397 xfree (button_tbl, TBBUTTON *);
398 ImageList_Destroy (ilist); 398 ImageList_Destroy (ilist);
399 gui_error ("couldn't create toolbar", Qunbound); 399 gui_error ("couldn't create toolbar", Qunbound);
400 } 400 }
401 401
402 /* finally populate with images */ 402 /* finally populate with images */
465 ShowWindow (toolbarwnd, SW_SHOW); 465 ShowWindow (toolbarwnd, SW_SHOW);
466 /* no idea why this is necessary but initial display will not 466 /* no idea why this is necessary but initial display will not
467 happen otherwise. */ 467 happen otherwise. */
468 mswindows_move_toolbar (f, pos); 468 mswindows_move_toolbar (f, pos);
469 469
470 if (button_tbl) xfree (button_tbl); 470 if (button_tbl)
471 xfree (button_tbl, TBBUTTON *);
471 472
472 SET_TOOLBAR_WAS_VISIBLE_FLAG (f, pos, 1); 473 SET_TOOLBAR_WAS_VISIBLE_FLAG (f, pos, 1);
473 } 474 }
474 } 475 }
475 476