comparison src/xdisp.c @ 49322:2cbb0b823e83

GTK version
author Jan Djärv <jan.h.d@swipnet.se>
date Sun, 19 Jan 2003 21:50:03 +0000
parents 4f977a0478bc
children 50665500140c
comparison
equal deleted inserted replaced
49321:2b92ca3f78f6 49322:2cbb0b823e83
198 #include "macterm.h" 198 #include "macterm.h"
199 #endif 199 #endif
200 200
201 #define INFINITY 10000000 201 #define INFINITY 10000000
202 202
203 #if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI) || defined (MAC_OS) 203 #if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI) || defined (MAC_OS) \
204 || defined (USE_GTK)
204 extern void set_frame_menubar P_ ((struct frame *f, int, int)); 205 extern void set_frame_menubar P_ ((struct frame *f, int, int));
205 extern int pending_menu_activation; 206 extern int pending_menu_activation;
206 #endif 207 #endif
207 208
208 extern int interrupt_input; 209 extern int interrupt_input;
7516 w->update_mode_line = Qt; 7517 w->update_mode_line = Qt;
7517 #endif 7518 #endif
7518 7519
7519 if (FRAME_WINDOW_P (f) 7520 if (FRAME_WINDOW_P (f)
7520 ? 7521 ?
7521 #if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI) || defined (MAC_OS) 7522 #if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI) || defined (MAC_OS) \
7523 || defined (USE_GTK)
7522 FRAME_EXTERNAL_MENU_BAR (f) 7524 FRAME_EXTERNAL_MENU_BAR (f)
7523 #else 7525 #else
7524 FRAME_MENU_BAR_LINES (f) > 0 7526 FRAME_MENU_BAR_LINES (f) > 0
7525 #endif 7527 #endif
7526 : FRAME_MENU_BAR_LINES (f) > 0) 7528 : FRAME_MENU_BAR_LINES (f) > 0)
7567 7569
7568 safe_run_hooks (Qmenu_bar_update_hook); 7570 safe_run_hooks (Qmenu_bar_update_hook);
7569 FRAME_MENU_BAR_ITEMS (f) = menu_bar_items (FRAME_MENU_BAR_ITEMS (f)); 7571 FRAME_MENU_BAR_ITEMS (f) = menu_bar_items (FRAME_MENU_BAR_ITEMS (f));
7570 7572
7571 /* Redisplay the menu bar in case we changed it. */ 7573 /* Redisplay the menu bar in case we changed it. */
7572 #if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI) || defined (MAC_OS) 7574 #if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI) || defined (MAC_OS) \
7575 || defined (USE_GTK)
7573 if (FRAME_WINDOW_P (f) 7576 if (FRAME_WINDOW_P (f)
7574 #if defined (MAC_OS) 7577 #if defined (MAC_OS)
7575 /* All frames on Mac OS share the same menubar. So only the 7578 /* All frames on Mac OS share the same menubar. So only the
7576 selected frame should be allowed to set it. */ 7579 selected frame should be allowed to set it. */
7577 && f == SELECTED_FRAME () 7580 && f == SELECTED_FRAME ()
7580 set_frame_menubar (f, 0, 0); 7583 set_frame_menubar (f, 0, 0);
7581 else 7584 else
7582 /* On a terminal screen, the menu bar is an ordinary screen 7585 /* On a terminal screen, the menu bar is an ordinary screen
7583 line, and this makes it get updated. */ 7586 line, and this makes it get updated. */
7584 w->update_mode_line = Qt; 7587 w->update_mode_line = Qt;
7585 #else /* ! (USE_X_TOOLKIT || HAVE_NTGUI) */ 7588 #else /* ! (USE_X_TOOLKIT || HAVE_NTGUI || MAC_OS || USE_GTK) */
7586 /* In the non-toolkit version, the menu bar is an ordinary screen 7589 /* In the non-toolkit version, the menu bar is an ordinary screen
7587 line, and this makes it get updated. */ 7590 line, and this makes it get updated. */
7588 w->update_mode_line = Qt; 7591 w->update_mode_line = Qt;
7589 #endif /* ! (USE_X_TOOLKIT || HAVE_NTGUI) */ 7592 #endif /* ! (USE_X_TOOLKIT || HAVE_NTGUI || MAC_OS || USE_GTK) */
7590 7593
7591 unbind_to (count, Qnil); 7594 unbind_to (count, Qnil);
7592 set_buffer_internal_1 (prev); 7595 set_buffer_internal_1 (prev);
7593 } 7596 }
7594 } 7597 }
7610 static void 7613 static void
7611 update_tool_bar (f, save_match_data) 7614 update_tool_bar (f, save_match_data)
7612 struct frame *f; 7615 struct frame *f;
7613 int save_match_data; 7616 int save_match_data;
7614 { 7617 {
7615 if (WINDOWP (f->tool_bar_window) 7618 #ifdef USE_GTK
7616 && XFASTINT (XWINDOW (f->tool_bar_window)->height) > 0) 7619 int do_update = FRAME_EXTERNAL_TOOL_BAR(f);
7620 #else
7621 int do_update = WINDOWP (f->tool_bar_window)
7622 && XFASTINT (XWINDOW (f->tool_bar_window)->height) > 0;
7623 #endif
7624
7625 if (do_update)
7617 { 7626 {
7618 Lisp_Object window; 7627 Lisp_Object window;
7619 struct window *w; 7628 struct window *w;
7620 7629
7621 window = FRAME_SELECTED_WINDOW (f); 7630 window = FRAME_SELECTED_WINDOW (f);
7989 { 7998 {
7990 struct window *w; 7999 struct window *w;
7991 struct it it; 8000 struct it it;
7992 struct glyph_row *row; 8001 struct glyph_row *row;
7993 int change_height_p = 0; 8002 int change_height_p = 0;
8003
8004 #ifdef USE_GTK
8005 if (FRAME_EXTERNAL_TOOL_BAR(f))
8006 update_frame_tool_bar (f);
8007 return 0;
8008 #endif
7994 8009
7995 /* If frame hasn't a tool-bar window or if it is zero-height, don't 8010 /* If frame hasn't a tool-bar window or if it is zero-height, don't
7996 do anything. This means you must start with tool-bar-lines 8011 do anything. This means you must start with tool-bar-lines
7997 non-zero to get the auto-sizing effect. Or in other words, you 8012 non-zero to get the auto-sizing effect. Or in other words, you
7998 can turn off tool-bars by specifying tool-bar-lines zero. */ 8013 can turn off tool-bars by specifying tool-bar-lines zero. */
7999 if (!WINDOWP (f->tool_bar_window) 8014 if (!WINDOWP (f->tool_bar_window)
8000 || (w = XWINDOW (f->tool_bar_window), 8015 || (w = XWINDOW (f->tool_bar_window),
8001 XFASTINT (w->height) == 0)) 8016 XFASTINT (w->height) == 0))
8002 return 0; 8017 return 0;
8003 8018
8004 /* Set up an iterator for the tool-bar window. */ 8019 /* Set up an iterator for the tool-bar window. */
8005 init_iterator (&it, w, -1, -1, w->desired_matrix->rows, TOOL_BAR_FACE_ID); 8020 init_iterator (&it, w, -1, -1, w->desired_matrix->rows, TOOL_BAR_FACE_ID);
8006 it.first_visible_x = 0; 8021 it.first_visible_x = 0;
8548 redisplay_performed_directly_p = 0; 8563 redisplay_performed_directly_p = 0;
8549 if (!hscroll_windows (selected_window)) 8564 if (!hscroll_windows (selected_window))
8550 return; 8565 return;
8551 } 8566 }
8552 8567
8553 #ifdef USE_X_TOOLKIT 8568 #if defined (USE_X_TOOLKIT) || defined (USE_GTK)
8554 if (popup_activated ()) 8569 if (popup_activated ())
8555 return; 8570 return;
8556 #endif 8571 #endif
8557 8572
8558 /* I don't think this happens but let's be paranoid. */ 8573 /* I don't think this happens but let's be paranoid. */
10783 /* When we reach a frame's selected window, redo the frame's menu bar. */ 10798 /* When we reach a frame's selected window, redo the frame's menu bar. */
10784 if (update_mode_line 10799 if (update_mode_line
10785 && EQ (FRAME_SELECTED_WINDOW (f), window)) 10800 && EQ (FRAME_SELECTED_WINDOW (f), window))
10786 { 10801 {
10787 int redisplay_menu_p = 0; 10802 int redisplay_menu_p = 0;
10803 int redisplay_tool_bar_p = 0;
10788 10804
10789 if (FRAME_WINDOW_P (f)) 10805 if (FRAME_WINDOW_P (f))
10790 { 10806 {
10791 #if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI) || defined (MAC_OS) 10807 #if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI) || defined (MAC_OS) \
10808 || defined (USE_GTK)
10792 redisplay_menu_p = FRAME_EXTERNAL_MENU_BAR (f); 10809 redisplay_menu_p = FRAME_EXTERNAL_MENU_BAR (f);
10793 #else 10810 #else
10794 redisplay_menu_p = FRAME_MENU_BAR_LINES (f) > 0; 10811 redisplay_menu_p = FRAME_MENU_BAR_LINES (f) > 0;
10795 #endif 10812 #endif
10796 } 10813 }
10799 10816
10800 if (redisplay_menu_p) 10817 if (redisplay_menu_p)
10801 display_menu_bar (w); 10818 display_menu_bar (w);
10802 10819
10803 #ifdef HAVE_WINDOW_SYSTEM 10820 #ifdef HAVE_WINDOW_SYSTEM
10804 if (WINDOWP (f->tool_bar_window) 10821 #ifdef USE_GTK
10805 && (FRAME_TOOL_BAR_LINES (f) > 0 10822 redisplay_tool_bar_p = FRAME_EXTERNAL_TOOL_BAR (f);
10806 || auto_resize_tool_bars_p)) 10823 #else
10807 redisplay_tool_bar (f); 10824 redisplay_tool_bar_p = WINDOWP (f->tool_bar_window)
10825 && (FRAME_TOOL_BAR_LINES (f) > 0
10826 || auto_resize_tool_bars_p);
10827
10828 #endif
10829
10830 if (redisplay_tool_bar_p)
10831 redisplay_tool_bar (f);
10808 #endif 10832 #endif
10809 } 10833 }
10810 10834
10811 /* We go to this label, with fonts_changed_p nonzero, 10835 /* We go to this label, with fonts_changed_p nonzero,
10812 if it is necessary to try again using larger glyph matrices. 10836 if it is necessary to try again using larger glyph matrices.
13533 /* Don't do all this for graphical frames. */ 13557 /* Don't do all this for graphical frames. */
13534 #ifdef HAVE_NTGUI 13558 #ifdef HAVE_NTGUI
13535 if (!NILP (Vwindow_system)) 13559 if (!NILP (Vwindow_system))
13536 return; 13560 return;
13537 #endif 13561 #endif
13538 #ifdef USE_X_TOOLKIT 13562 #if defined (USE_X_TOOLKIT) || defined (USE_GTK)
13539 if (FRAME_X_P (f)) 13563 if (FRAME_X_P (f))
13540 return; 13564 return;
13541 #endif 13565 #endif
13542 #ifdef MAC_OS 13566 #ifdef MAC_OS
13543 if (FRAME_MAC_P (f)) 13567 if (FRAME_MAC_P (f))