comparison src/toolbar-msw.c @ 398:74fd4e045ea6 r21-2-29

Import from CVS: tag r21-2-29
author cvs
date Mon, 13 Aug 2007 11:13:30 +0200
parents 8626e4521993
children a86b2b5e0111
comparison
equal deleted inserted replaced
397:f4aeb21a5bad 398:74fd4e045ea6
56 #define TB_SETPADDING (WM_USER + 87) 56 #define TB_SETPADDING (WM_USER + 87)
57 #endif 57 #endif
58 #define MSWINDOWS_BUTTON_SHADOW_THICKNESS 2 58 #define MSWINDOWS_BUTTON_SHADOW_THICKNESS 2
59 #define MSWINDOWS_BLANK_SIZE 5 59 #define MSWINDOWS_BLANK_SIZE 5
60 #define MSWINDOWS_MINIMUM_TOOLBAR_SIZE 8 60 #define MSWINDOWS_MINIMUM_TOOLBAR_SIZE 8
61
62 static void
63 mswindows_move_toolbar (struct frame *f, enum toolbar_pos pos);
61 64
62 #define SET_TOOLBAR_WAS_VISIBLE_FLAG(frame, pos, flag) \ 65 #define SET_TOOLBAR_WAS_VISIBLE_FLAG(frame, pos, flag) \
63 do { \ 66 do { \
64 switch (pos) \ 67 switch (pos) \
65 { \ 68 { \
203 immediately. */ 206 immediately. */
204 while (!NILP (button)) 207 while (!NILP (button))
205 { 208 {
206 209
207 struct toolbar_button *tb = XTOOLBAR_BUTTON (button); 210 struct toolbar_button *tb = XTOOLBAR_BUTTON (button);
208 checksum = HASH4 (checksum, 211 checksum = HASH5 (checksum,
209 internal_hash (get_toolbar_button_glyph(w, tb), 0), 212 internal_hash (get_toolbar_button_glyph(w, tb), 0),
210 internal_hash (tb->callback, 0), 213 internal_hash (tb->callback, 0),
211 width); 214 width,
215 LISP_HASH (w->toolbar_buttons_captioned_p));
212 button = tb->next; 216 button = tb->next;
213 nbuttons++; 217 nbuttons++;
214 } 218 }
215 219
216 /* only rebuild if something has changed */ 220 /* only rebuild if something has changed */
256 else 260 else
257 instance = Qnil; 261 instance = Qnil;
258 262
259 if (IMAGE_INSTANCEP (instance)) 263 if (IMAGE_INSTANCEP (instance))
260 { 264 {
261 struct Lisp_Image_Instance* p = XIMAGE_INSTANCE (instance); 265 Lisp_Image_Instance* p = XIMAGE_INSTANCE (instance);
262 266
263 if (IMAGE_INSTANCE_PIXMAP_TYPE_P (p)) 267 if (IMAGE_INSTANCE_PIXMAP_TYPE_P (p))
264 { 268 {
265 /* we are going to honor the toolbar settings 269 /* we are going to honor the toolbar settings
266 and resize the bitmaps accordingly if they are 270 and resize the bitmaps accordingly if they are
457 error ("couldn't add image list to toolbar"); 461 error ("couldn't add image list to toolbar");
458 } 462 }
459 463
460 /* now display the window */ 464 /* now display the window */
461 ShowWindow (toolbarwnd, SW_SHOW); 465 ShowWindow (toolbarwnd, SW_SHOW);
466 /* no idea why this is necessary but initial display will not
467 happen otherwise. */
468 mswindows_move_toolbar (f, pos);
462 469
463 if (button_tbl) xfree (button_tbl); 470 if (button_tbl) xfree (button_tbl);
464 471
465 SET_TOOLBAR_WAS_VISIBLE_FLAG (f, pos, 1); 472 SET_TOOLBAR_WAS_VISIBLE_FLAG (f, pos, 1);
466 } 473 }
522 if (FRAME_REAL_RIGHT_TOOLBAR_VISIBLE (f)) 529 if (FRAME_REAL_RIGHT_TOOLBAR_VISIBLE (f))
523 mswindows_move_toolbar (f, RIGHT_TOOLBAR); 530 mswindows_move_toolbar (f, RIGHT_TOOLBAR);
524 } 531 }
525 532
526 static void 533 static void
534 mswindows_redraw_frame_toolbars (struct frame *f)
535 {
536 mswindows_redraw_exposed_toolbars (f, 0, 0, FRAME_PIXWIDTH (f),
537 FRAME_PIXHEIGHT (f));
538 }
539
540 static void
527 mswindows_initialize_frame_toolbars (struct frame *f) 541 mswindows_initialize_frame_toolbars (struct frame *f)
528 { 542 {
529 543
530 } 544 }
531 545
570 DELETE_TOOLBAR(RIGHT_TOOLBAR); 584 DELETE_TOOLBAR(RIGHT_TOOLBAR);
571 #undef DELETE_TOOLBAR 585 #undef DELETE_TOOLBAR
572 } 586 }
573 587
574 /* map toolbar hwnd to pos*/ 588 /* map toolbar hwnd to pos*/
575 int mswindows_find_toolbar_pos(struct frame* f, HWND ctrl) 589 static int mswindows_find_toolbar_pos(struct frame* f, HWND ctrl)
576 { 590 {
577 int id = GetDlgCtrlID(ctrl); 591 int id = GetDlgCtrlID(ctrl);
578 return id ? id - TOOLBAR_ID_BIAS : -1; 592 return id ? id - TOOLBAR_ID_BIAS : -1;
579 } 593 }
580 594
633 { 647 {
634 CONSOLE_HAS_METHOD (mswindows, output_frame_toolbars); 648 CONSOLE_HAS_METHOD (mswindows, output_frame_toolbars);
635 CONSOLE_HAS_METHOD (mswindows, initialize_frame_toolbars); 649 CONSOLE_HAS_METHOD (mswindows, initialize_frame_toolbars);
636 CONSOLE_HAS_METHOD (mswindows, free_frame_toolbars); 650 CONSOLE_HAS_METHOD (mswindows, free_frame_toolbars);
637 CONSOLE_HAS_METHOD (mswindows, redraw_exposed_toolbars); 651 CONSOLE_HAS_METHOD (mswindows, redraw_exposed_toolbars);
638 } 652 CONSOLE_HAS_METHOD (mswindows, redraw_frame_toolbars);
639 653 }
654