aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog27
-rw-r--r--src/frame.h7
-rw-r--r--src/gnutls.c23
-rw-r--r--src/gtkutil.c154
-rw-r--r--src/gtkutil.h38
-rw-r--r--src/nsmenu.m12
-rw-r--r--src/w32menu.c4
-rw-r--r--src/w32term.c6
-rw-r--r--src/xfns.c9
-rw-r--r--src/xmenu.c11
-rw-r--r--src/xterm.c6
11 files changed, 157 insertions, 140 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index b17cb9ab60d..edf77f55331 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,30 @@
12012-09-23 Paul Eggert <eggert@cs.ucla.edu>
2
3 gnutls.c, gtkutil.c: Use bool for boolean.
4 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
5 (emacs_gnutls_handle_error):
6 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
7 (xg_hide_tooltip, xg_create_frame_widgets)
8 (create_dialog, xg_uses_old_file_dialog)
9 (xg_get_file_with_chooser, xg_get_file_with_selection)
10 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
11 (xg_item_label_same_p, xg_update_menubar)
12 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
13 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
14 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
15 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
16 (update_frame_tool_bar, free_frame_tool_bar):
17 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
18 * nsmenu.m (ns_update_menubar):
19 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
20 * xfns.c (Fx_show_tip) [USE_GTK]:
21 Use bool for boolean.
22 * gtkutil.c (xg_update_frame_menubar):
23 * xmenu.c (update_frame_menubar):
24 Return void, not int, since caller ignores return value.
25 * gtkutil.c (xg_change_toolbar_position):
26 Return void, not 1.
27
12012-09-23 Juanma Barranquero <lekktu@gmail.com> 282012-09-23 Juanma Barranquero <lekktu@gmail.com>
2 29
3 * makefile.w32-in (BLOCKINPUT_H): Remove. 30 * makefile.w32-in (BLOCKINPUT_H): Remove.
diff --git a/src/frame.h b/src/frame.h
index 661ea2ea67c..26235cc036e 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -1203,7 +1203,7 @@ extern Lisp_Object Qrun_hook_with_args;
1203extern void x_set_scroll_bar_default_width (struct frame *); 1203extern void x_set_scroll_bar_default_width (struct frame *);
1204extern void x_set_offset (struct frame *, int, int, int); 1204extern void x_set_offset (struct frame *, int, int, int);
1205extern void x_wm_set_icon_position (struct frame *, int, int); 1205extern void x_wm_set_icon_position (struct frame *, int, int);
1206extern void x_wm_set_size_hint (FRAME_PTR f, long flags, int user_position); 1206extern void x_wm_set_size_hint (FRAME_PTR f, long flags, bool user_position);
1207 1207
1208extern Lisp_Object x_new_font (struct frame *, Lisp_Object, int); 1208extern Lisp_Object x_new_font (struct frame *, Lisp_Object, int);
1209 1209
@@ -1249,7 +1249,7 @@ extern Lisp_Object display_x_get_resource (Display_Info *,
1249 Lisp_Object component, 1249 Lisp_Object component,
1250 Lisp_Object subclass); 1250 Lisp_Object subclass);
1251 1251
1252extern void set_frame_menubar (struct frame *f, int first_time, int deep_p); 1252extern void set_frame_menubar (struct frame *f, bool first_time, bool deep_p);
1253extern void x_set_window_size (struct frame *f, int change_grav, 1253extern void x_set_window_size (struct frame *f, int change_grav,
1254 int cols, int rows); 1254 int cols, int rows);
1255extern void x_sync (struct frame *); 1255extern void x_sync (struct frame *);
@@ -1283,9 +1283,6 @@ extern char *x_get_resource_string (const char *, const char *);
1283 1283
1284extern void x_query_colors (struct frame *f, XColor *, int); 1284extern void x_query_colors (struct frame *f, XColor *, int);
1285 1285
1286/* In xmenu.c */
1287extern void set_frame_menubar (FRAME_PTR, int, int);
1288
1289#endif /* HAVE_WINDOW_SYSTEM */ 1286#endif /* HAVE_WINDOW_SYSTEM */
1290 1287
1291INLINE_HEADER_END 1288INLINE_HEADER_END
diff --git a/src/gnutls.c b/src/gnutls.c
index cfe7d97aa59..e3d84a0b61b 100644
--- a/src/gnutls.c
+++ b/src/gnutls.c
@@ -30,15 +30,14 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
30#include "w32.h" 30#include "w32.h"
31#endif 31#endif
32 32
33static int 33static bool emacs_gnutls_handle_error (gnutls_session_t, int);
34emacs_gnutls_handle_error (gnutls_session_t, int err);
35 34
36static Lisp_Object Qgnutls_dll; 35static Lisp_Object Qgnutls_dll;
37static Lisp_Object Qgnutls_code; 36static Lisp_Object Qgnutls_code;
38static Lisp_Object Qgnutls_anon, Qgnutls_x509pki; 37static Lisp_Object Qgnutls_anon, Qgnutls_x509pki;
39static Lisp_Object Qgnutls_e_interrupted, Qgnutls_e_again, 38static Lisp_Object Qgnutls_e_interrupted, Qgnutls_e_again,
40 Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake; 39 Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake;
41static int gnutls_global_initialized; 40static bool gnutls_global_initialized;
42 41
43/* The following are for the property list of `gnutls-boot'. */ 42/* The following are for the property list of `gnutls-boot'. */
44static Lisp_Object QCgnutls_bootprop_priority; 43static Lisp_Object QCgnutls_bootprop_priority;
@@ -141,7 +140,7 @@ DEF_GNUTLS_FN (int, gnutls_x509_crt_import,
141 gnutls_x509_crt_fmt_t)); 140 gnutls_x509_crt_fmt_t));
142DEF_GNUTLS_FN (int, gnutls_x509_crt_init, (gnutls_x509_crt_t *)); 141DEF_GNUTLS_FN (int, gnutls_x509_crt_init, (gnutls_x509_crt_t *));
143 142
144static int 143static bool
145init_gnutls_functions (void) 144init_gnutls_functions (void)
146{ 145{
147 HMODULE library; 146 HMODULE library;
@@ -438,7 +437,7 @@ emacs_gnutls_read (struct Lisp_Process *proc, char *buf, ptrdiff_t nbyte)
438 else if (rtnval == GNUTLS_E_UNEXPECTED_PACKET_LENGTH) 437 else if (rtnval == GNUTLS_E_UNEXPECTED_PACKET_LENGTH)
439 /* The peer closed the connection. */ 438 /* The peer closed the connection. */
440 return 0; 439 return 0;
441 else if (emacs_gnutls_handle_error (state, rtnval) == 0) 440 else if (emacs_gnutls_handle_error (state, rtnval))
442 /* non-fatal error */ 441 /* non-fatal error */
443 return -1; 442 return -1;
444 else { 443 else {
@@ -447,19 +446,19 @@ emacs_gnutls_read (struct Lisp_Process *proc, char *buf, ptrdiff_t nbyte)
447 } 446 }
448} 447}
449 448
450/* report a GnuTLS error to the user. 449/* Report a GnuTLS error to the user.
451 Returns zero if the error code was successfully handled. */ 450 Return true if the error code was successfully handled. */
452static int 451static bool
453emacs_gnutls_handle_error (gnutls_session_t session, int err) 452emacs_gnutls_handle_error (gnutls_session_t session, int err)
454{ 453{
455 int max_log_level = 0; 454 int max_log_level = 0;
456 455
457 int ret; 456 bool ret;
458 const char *str; 457 const char *str;
459 458
460 /* TODO: use a Lisp_Object generated by gnutls_make_error? */ 459 /* TODO: use a Lisp_Object generated by gnutls_make_error? */
461 if (err >= 0) 460 if (err >= 0)
462 return 0; 461 return 1;
463 462
464 max_log_level = global_gnutls_log_level; 463 max_log_level = global_gnutls_log_level;
465 464
@@ -471,12 +470,12 @@ emacs_gnutls_handle_error (gnutls_session_t session, int err)
471 470
472 if (fn_gnutls_error_is_fatal (err)) 471 if (fn_gnutls_error_is_fatal (err))
473 { 472 {
474 ret = err; 473 ret = 0;
475 GNUTLS_LOG2 (0, max_log_level, "fatal error:", str); 474 GNUTLS_LOG2 (0, max_log_level, "fatal error:", str);
476 } 475 }
477 else 476 else
478 { 477 {
479 ret = 0; 478 ret = 1;
480 GNUTLS_LOG2 (1, max_log_level, "non-fatal error:", str); 479 GNUTLS_LOG2 (1, max_log_level, "non-fatal error:", str);
481 /* TODO: EAGAIN AKA Qgnutls_e_again should be level 2. */ 480 /* TODO: EAGAIN AKA Qgnutls_e_again should be level 2. */
482 } 481 }
diff --git a/src/gtkutil.c b/src/gtkutil.c
index bf635250380..1bf2b533b41 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -576,16 +576,16 @@ get_utf8_string (const char *str)
576 576
577/* Check for special colors used in face spec for region face. 577/* Check for special colors used in face spec for region face.
578 The colors are fetched from the Gtk+ theme. 578 The colors are fetched from the Gtk+ theme.
579 Return 1 if color was found, 0 if not. */ 579 Return true if color was found, false if not. */
580 580
581int 581bool
582xg_check_special_colors (struct frame *f, 582xg_check_special_colors (struct frame *f,
583 const char *color_name, 583 const char *color_name,
584 XColor *color) 584 XColor *color)
585{ 585{
586 int success_p = 0; 586 bool success_p = 0;
587 int get_bg = strcmp ("gtk_selection_bg_color", color_name) == 0; 587 bool get_bg = strcmp ("gtk_selection_bg_color", color_name) == 0;
588 int get_fg = !get_bg && strcmp ("gtk_selection_fg_color", color_name) == 0; 588 bool get_fg = !get_bg && strcmp ("gtk_selection_fg_color", color_name) == 0;
589 589
590 if (! FRAME_GTK_WIDGET (f) || ! (get_bg || get_fg)) 590 if (! FRAME_GTK_WIDGET (f) || ! (get_bg || get_fg))
591 return success_p; 591 return success_p;
@@ -604,8 +604,9 @@ xg_check_special_colors (struct frame *f,
604 gtk_style_context_get_background_color (gsty, state, &col); 604 gtk_style_context_get_background_color (gsty, state, &col);
605 605
606 sprintf (buf, "rgbi:%lf/%lf/%lf", col.red, col.green, col.blue); 606 sprintf (buf, "rgbi:%lf/%lf/%lf", col.red, col.green, col.blue);
607 success_p = XParseColor (FRAME_X_DISPLAY (f), FRAME_X_COLORMAP (f), 607 success_p = (XParseColor (FRAME_X_DISPLAY (f), FRAME_X_COLORMAP (f),
608 buf, color); 608 buf, color)
609 != 0);
609#else 610#else
610 GtkStyle *gsty = gtk_widget_get_style (FRAME_GTK_WIDGET (f)); 611 GtkStyle *gsty = gtk_widget_get_style (FRAME_GTK_WIDGET (f));
611 GdkColor *grgb = get_bg 612 GdkColor *grgb = get_bg
@@ -703,9 +704,9 @@ qttip_cb (GtkWidget *widget,
703#endif /* USE_GTK_TOOLTIP */ 704#endif /* USE_GTK_TOOLTIP */
704 705
705/* Prepare a tooltip to be shown, i.e. calculate WIDTH and HEIGHT. 706/* Prepare a tooltip to be shown, i.e. calculate WIDTH and HEIGHT.
706 Return zero if no system tooltip available, non-zero otherwise. */ 707 Return true if a system tooltip is available. */
707 708
708int 709bool
709xg_prepare_tooltip (FRAME_PTR f, 710xg_prepare_tooltip (FRAME_PTR f,
710 Lisp_Object string, 711 Lisp_Object string,
711 int *width, 712 int *width,
@@ -778,13 +779,13 @@ xg_show_tooltip (FRAME_PTR f, int root_x, int root_y)
778} 779}
779 780
780/* Hide tooltip if shown. Do nothing if not shown. 781/* Hide tooltip if shown. Do nothing if not shown.
781 Return non-zero if tip was hidden, non-zero if not (i.e. not using 782 Return true if tip was hidden, false if not (i.e. not using
782 system tooltips). */ 783 system tooltips). */
783 784
784int 785bool
785xg_hide_tooltip (FRAME_PTR f) 786xg_hide_tooltip (FRAME_PTR f)
786{ 787{
787 int ret = 0; 788 bool ret = 0;
788#ifdef USE_GTK_TOOLTIP 789#ifdef USE_GTK_TOOLTIP
789 if (f->output_data.x->ttip_window) 790 if (f->output_data.x->ttip_window)
790 { 791 {
@@ -1110,9 +1111,9 @@ delete_cb (GtkWidget *widget,
1110} 1111}
1111 1112
1112/* Create and set up the GTK widgets for frame F. 1113/* Create and set up the GTK widgets for frame F.
1113 Return 0 if creation failed, non-zero otherwise. */ 1114 Return true if creation succeeded. */
1114 1115
1115int 1116bool
1116xg_create_frame_widgets (FRAME_PTR f) 1117xg_create_frame_widgets (FRAME_PTR f)
1117{ 1118{
1118 GtkWidget *wtop; 1119 GtkWidget *wtop;
@@ -1309,11 +1310,11 @@ xg_free_frame_widgets (FRAME_PTR f)
1309/* Set the normal size hints for the window manager, for frame F. 1310/* Set the normal size hints for the window manager, for frame F.
1310 FLAGS is the flags word to use--or 0 meaning preserve the flags 1311 FLAGS is the flags word to use--or 0 meaning preserve the flags
1311 that the window now has. 1312 that the window now has.
1312 If USER_POSITION is nonzero, we set the User Position 1313 If USER_POSITION, set the User Position
1313 flag (this is useful when FLAGS is 0). */ 1314 flag (this is useful when FLAGS is 0). */
1314 1315
1315void 1316void
1316x_wm_set_size_hint (FRAME_PTR f, long int flags, int user_position) 1317x_wm_set_size_hint (FRAME_PTR f, long int flags, bool user_position)
1317{ 1318{
1318 /* Must use GTK routines here, otherwise GTK resets the size hints 1319 /* Must use GTK routines here, otherwise GTK resets the size hints
1319 to its own defaults. */ 1320 to its own defaults. */
@@ -1519,7 +1520,7 @@ create_dialog (widget_value *wv,
1519 1520
1520 /* If the number of buttons is greater than 4, make two rows of buttons 1521 /* If the number of buttons is greater than 4, make two rows of buttons
1521 instead. This looks better. */ 1522 instead. This looks better. */
1522 int make_two_rows = total_buttons > 4; 1523 bool make_two_rows = total_buttons > 4;
1523 1524
1524 if (right_buttons == 0) right_buttons = total_buttons/2; 1525 if (right_buttons == 0) right_buttons = total_buttons/2;
1525 left_buttons = total_buttons - right_buttons; 1526 left_buttons = total_buttons - right_buttons;
@@ -1716,10 +1717,9 @@ xg_dialog_run (FRAME_PTR f, GtkWidget *w)
1716/*********************************************************************** 1717/***********************************************************************
1717 File dialog functions 1718 File dialog functions
1718 ***********************************************************************/ 1719 ***********************************************************************/
1719/* Return non-zero if the old file selection dialog is being used. 1720/* Return true if the old file selection dialog is being used. */
1720 Return zero if not. */
1721 1721
1722int 1722bool
1723xg_uses_old_file_dialog (void) 1723xg_uses_old_file_dialog (void)
1724{ 1724{
1725#ifdef HAVE_GTK_FILE_SELECTION_NEW 1725#ifdef HAVE_GTK_FILE_SELECTION_NEW
@@ -1790,7 +1790,7 @@ xg_toggle_notify_cb (GObject *gobject, GParamSpec *arg1, gpointer user_data)
1790 F is the current frame. 1790 F is the current frame.
1791 PROMPT is a prompt to show to the user. May not be NULL. 1791 PROMPT is a prompt to show to the user. May not be NULL.
1792 DEFAULT_FILENAME is a default selection to be displayed. May be NULL. 1792 DEFAULT_FILENAME is a default selection to be displayed. May be NULL.
1793 If MUSTMATCH_P is non-zero, the returned file name must be an existing 1793 If MUSTMATCH_P, the returned file name must be an existing
1794 file. (Actually, this only has cosmetic effects, the user can 1794 file. (Actually, this only has cosmetic effects, the user can
1795 still enter a non-existing file.) *FUNC is set to a function that 1795 still enter a non-existing file.) *FUNC is set to a function that
1796 can be used to retrieve the selected file name from the returned widget. 1796 can be used to retrieve the selected file name from the returned widget.
@@ -1801,7 +1801,7 @@ static GtkWidget *
1801xg_get_file_with_chooser (FRAME_PTR f, 1801xg_get_file_with_chooser (FRAME_PTR f,
1802 char *prompt, 1802 char *prompt,
1803 char *default_filename, 1803 char *default_filename,
1804 int mustmatch_p, int only_dir_p, 1804 bool mustmatch_p, bool only_dir_p,
1805 xg_get_file_func *func) 1805 xg_get_file_func *func)
1806{ 1806{
1807 char msgbuf[1024]; 1807 char msgbuf[1024];
@@ -1913,7 +1913,7 @@ xg_get_file_name_from_selector (GtkWidget *w)
1913 F is the current frame. 1913 F is the current frame.
1914 PROMPT is a prompt to show to the user. May not be NULL. 1914 PROMPT is a prompt to show to the user. May not be NULL.
1915 DEFAULT_FILENAME is a default selection to be displayed. May be NULL. 1915 DEFAULT_FILENAME is a default selection to be displayed. May be NULL.
1916 If MUSTMATCH_P is non-zero, the returned file name must be an existing 1916 If MUSTMATCH_P, the returned file name must be an existing
1917 file. *FUNC is set to a function that can be used to retrieve the 1917 file. *FUNC is set to a function that can be used to retrieve the
1918 selected file name from the returned widget. 1918 selected file name from the returned widget.
1919 1919
@@ -1923,7 +1923,7 @@ static GtkWidget *
1923xg_get_file_with_selection (FRAME_PTR f, 1923xg_get_file_with_selection (FRAME_PTR f,
1924 char *prompt, 1924 char *prompt,
1925 char *default_filename, 1925 char *default_filename,
1926 int mustmatch_p, int only_dir_p, 1926 bool mustmatch_p, bool only_dir_p,
1927 xg_get_file_func *func) 1927 xg_get_file_func *func)
1928{ 1928{
1929 GtkWidget *filewin; 1929 GtkWidget *filewin;
@@ -1955,7 +1955,7 @@ xg_get_file_with_selection (FRAME_PTR f,
1955 F is the current frame. 1955 F is the current frame.
1956 PROMPT is a prompt to show to the user. May not be NULL. 1956 PROMPT is a prompt to show to the user. May not be NULL.
1957 DEFAULT_FILENAME is a default selection to be displayed. May be NULL. 1957 DEFAULT_FILENAME is a default selection to be displayed. May be NULL.
1958 If MUSTMATCH_P is non-zero, the returned file name must be an existing 1958 If MUSTMATCH_P, the returned file name must be an existing
1959 file. 1959 file.
1960 1960
1961 Returns a file name or NULL if no file was selected. 1961 Returns a file name or NULL if no file was selected.
@@ -1965,8 +1965,8 @@ char *
1965xg_get_file_name (FRAME_PTR f, 1965xg_get_file_name (FRAME_PTR f,
1966 char *prompt, 1966 char *prompt,
1967 char *default_filename, 1967 char *default_filename,
1968 int mustmatch_p, 1968 bool mustmatch_p,
1969 int only_dir_p) 1969 bool only_dir_p)
1970{ 1970{
1971 GtkWidget *w = 0; 1971 GtkWidget *w = 0;
1972 char *fn = 0; 1972 char *fn = 0;
@@ -2403,9 +2403,9 @@ make_menu_item (const char *utf8_label,
2403 2403
2404static int xg_detached_menus; 2404static int xg_detached_menus;
2405 2405
2406/* Returns non-zero if there are detached menus. */ 2406/* Return true if there are detached menus. */
2407 2407
2408int 2408bool
2409xg_have_tear_offs (void) 2409xg_have_tear_offs (void)
2410{ 2410{
2411 return xg_detached_menus > 0; 2411 return xg_detached_menus > 0;
@@ -2509,10 +2509,9 @@ xg_create_one_menuitem (widget_value *item,
2509 SELECT_CB is the callback to use when a menu item is selected. 2509 SELECT_CB is the callback to use when a menu item is selected.
2510 DEACTIVATE_CB is the callback to use when a sub menu is not shown anymore. 2510 DEACTIVATE_CB is the callback to use when a sub menu is not shown anymore.
2511 HIGHLIGHT_CB is the callback to call when entering/leaving menu items. 2511 HIGHLIGHT_CB is the callback to call when entering/leaving menu items.
2512 POP_UP_P is non-zero if we shall create a popup menu. 2512 If POP_UP_P, create a popup menu.
2513 MENU_BAR_P is non-zero if we shall create a menu bar. 2513 If MENU_BAR_P, create a menu bar.
2514 ADD_TEAROFF_P is non-zero if we shall add a tearoff menu item. Ignored 2514 If ADD_TEAROFF_P, add a tearoff menu item. Ignored if MENU_BAR_P.
2515 if MENU_BAR_P is non-zero.
2516 TOPMENU is the topmost GtkWidget that others shall be placed under. 2515 TOPMENU is the topmost GtkWidget that others shall be placed under.
2517 It may be NULL, in that case we create the appropriate widget 2516 It may be NULL, in that case we create the appropriate widget
2518 (menu bar or menu item depending on POP_UP_P and MENU_BAR_P) 2517 (menu bar or menu item depending on POP_UP_P and MENU_BAR_P)
@@ -2532,9 +2531,9 @@ create_menus (widget_value *data,
2532 GCallback select_cb, 2531 GCallback select_cb,
2533 GCallback deactivate_cb, 2532 GCallback deactivate_cb,
2534 GCallback highlight_cb, 2533 GCallback highlight_cb,
2535 int pop_up_p, 2534 bool pop_up_p,
2536 int menu_bar_p, 2535 bool menu_bar_p,
2537 int add_tearoff_p, 2536 bool add_tearoff_p,
2538 GtkWidget *topmenu, 2537 GtkWidget *topmenu,
2539 xg_menu_cb_data *cl_data, 2538 xg_menu_cb_data *cl_data,
2540 const char *name) 2539 const char *name)
@@ -2674,8 +2673,8 @@ xg_create_widget (const char *type, const char *name, FRAME_PTR f, widget_value
2674 GCallback highlight_cb) 2673 GCallback highlight_cb)
2675{ 2674{
2676 GtkWidget *w = 0; 2675 GtkWidget *w = 0;
2677 int menu_bar_p = strcmp (type, "menubar") == 0; 2676 bool menu_bar_p = strcmp (type, "menubar") == 0;
2678 int pop_up_p = strcmp (type, "popup") == 0; 2677 bool pop_up_p = strcmp (type, "popup") == 0;
2679 2678
2680 if (strcmp (type, "dialog") == 0) 2679 if (strcmp (type, "dialog") == 0)
2681 { 2680 {
@@ -2728,12 +2727,12 @@ xg_get_menu_item_label (GtkMenuItem *witem)
2728 return gtk_label_get_label (wlabel); 2727 return gtk_label_get_label (wlabel);
2729} 2728}
2730 2729
2731/* Return non-zero if the menu item WITEM has the text LABEL. */ 2730/* Return true if the menu item WITEM has the text LABEL. */
2732 2731
2733static int 2732static bool
2734xg_item_label_same_p (GtkMenuItem *witem, const char *label) 2733xg_item_label_same_p (GtkMenuItem *witem, const char *label)
2735{ 2734{
2736 int is_same = 0; 2735 bool is_same = 0;
2737 char *utf8_label = get_utf8_string (label); 2736 char *utf8_label = get_utf8_string (label);
2738 const char *old_label = witem ? xg_get_menu_item_label (witem) : 0; 2737 const char *old_label = witem ? xg_get_menu_item_label (witem) : 0;
2739 2738
@@ -2824,8 +2823,8 @@ xg_update_menubar (GtkWidget *menubar,
2824 { 2823 {
2825 GtkMenuItem *witem = GTK_MENU_ITEM (iter->data); 2824 GtkMenuItem *witem = GTK_MENU_ITEM (iter->data);
2826 GtkMenuItem *witem2 = 0; 2825 GtkMenuItem *witem2 = 0;
2827 int val_in_menubar = 0; 2826 bool val_in_menubar = 0;
2828 int iter_in_new_menubar = 0; 2827 bool iter_in_new_menubar = 0;
2829 GList *iter2; 2828 GList *iter2;
2830 widget_value *cur; 2829 widget_value *cur;
2831 2830
@@ -3103,7 +3102,7 @@ xg_update_submenu (GtkWidget *submenu,
3103 GList *list = 0; 3102 GList *list = 0;
3104 GList *iter; 3103 GList *iter;
3105 widget_value *cur; 3104 widget_value *cur;
3106 int has_tearoff_p = 0; 3105 bool has_tearoff_p = 0;
3107 GList *first_radio = 0; 3106 GList *first_radio = 0;
3108 3107
3109 if (submenu) 3108 if (submenu)
@@ -3225,7 +3224,7 @@ xg_update_submenu (GtkWidget *submenu,
3225/* Update the MENUBAR. 3224/* Update the MENUBAR.
3226 F is the frame the menu bar belongs to. 3225 F is the frame the menu bar belongs to.
3227 VAL describes the contents of the menu bar. 3226 VAL describes the contents of the menu bar.
3228 If DEEP_P is non-zero, rebuild all but the top level menu names in 3227 If DEEP_P, rebuild all but the top level menu names in
3229 the MENUBAR. If DEEP_P is zero, just rebuild the names in the menubar. 3228 the MENUBAR. If DEEP_P is zero, just rebuild the names in the menubar.
3230 SELECT_CB is the callback to use when a menu item is selected. 3229 SELECT_CB is the callback to use when a menu item is selected.
3231 DEACTIVATE_CB is the callback to use when a sub menu is not shown anymore. 3230 DEACTIVATE_CB is the callback to use when a sub menu is not shown anymore.
@@ -3233,7 +3232,7 @@ xg_update_submenu (GtkWidget *submenu,
3233 3232
3234void 3233void
3235xg_modify_menubar_widgets (GtkWidget *menubar, FRAME_PTR f, widget_value *val, 3234xg_modify_menubar_widgets (GtkWidget *menubar, FRAME_PTR f, widget_value *val,
3236 int deep_p, 3235 bool deep_p,
3237 GCallback select_cb, GCallback deactivate_cb, 3236 GCallback select_cb, GCallback deactivate_cb,
3238 GCallback highlight_cb) 3237 GCallback highlight_cb)
3239{ 3238{
@@ -3317,19 +3316,19 @@ menubar_map_cb (GtkWidget *w, gpointer user_data)
3317} 3316}
3318 3317
3319/* Recompute all the widgets of frame F, when the menu bar has been 3318/* Recompute all the widgets of frame F, when the menu bar has been
3320 changed. Value is non-zero if widgets were updated. */ 3319 changed. */
3321 3320
3322int 3321void
3323xg_update_frame_menubar (FRAME_PTR f) 3322xg_update_frame_menubar (FRAME_PTR f)
3324{ 3323{
3325 struct x_output *x = f->output_data.x; 3324 struct x_output *x = f->output_data.x;
3326 GtkRequisition req; 3325 GtkRequisition req;
3327 3326
3328 if (!x->menubar_widget || gtk_widget_get_mapped (x->menubar_widget)) 3327 if (!x->menubar_widget || gtk_widget_get_mapped (x->menubar_widget))
3329 return 0; 3328 return;
3330 3329
3331 if (x->menubar_widget && gtk_widget_get_parent (x->menubar_widget)) 3330 if (x->menubar_widget && gtk_widget_get_parent (x->menubar_widget))
3332 return 0; /* Already done this, happens for frames created invisible. */ 3331 return; /* Already done this, happens for frames created invisible. */
3333 3332
3334 block_input (); 3333 block_input ();
3335 3334
@@ -3352,8 +3351,6 @@ xg_update_frame_menubar (FRAME_PTR f)
3352 xg_height_or_width_changed (f); 3351 xg_height_or_width_changed (f);
3353 } 3352 }
3354 unblock_input (); 3353 unblock_input ();
3355
3356 return 1;
3357} 3354}
3358 3355
3359/* Get rid of the menu bar of frame F, and free its storage. 3356/* Get rid of the menu bar of frame F, and free its storage.
@@ -3378,7 +3375,7 @@ free_frame_menubar (FRAME_PTR f)
3378 } 3375 }
3379} 3376}
3380 3377
3381int 3378bool
3382xg_event_is_for_menubar (FRAME_PTR f, XEvent *event) 3379xg_event_is_for_menubar (FRAME_PTR f, XEvent *event)
3383{ 3380{
3384 struct x_output *x = f->output_data.x; 3381 struct x_output *x = f->output_data.x;
@@ -3425,7 +3422,7 @@ xg_event_is_for_menubar (FRAME_PTR f, XEvent *event)
3425 break; 3422 break;
3426 } 3423 }
3427 g_list_free (list); 3424 g_list_free (list);
3428 return iter == 0 ? 0 : 1; 3425 return iter != 0;
3429} 3426}
3430 3427
3431 3428
@@ -3438,7 +3435,7 @@ xg_event_is_for_menubar (FRAME_PTR f, XEvent *event)
3438/* Setting scroll bar values invokes the callback. Use this variable 3435/* Setting scroll bar values invokes the callback. Use this variable
3439 to indicate that callback should do nothing. */ 3436 to indicate that callback should do nothing. */
3440 3437
3441int xg_ignore_gtk_scrollbar; 3438bool xg_ignore_gtk_scrollbar;
3442 3439
3443/* The width of the scroll bar for the current theme. */ 3440/* The width of the scroll bar for the current theme. */
3444 3441
@@ -3764,7 +3761,7 @@ xg_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar,
3764 int size, value; 3761 int size, value;
3765 int old_size; 3762 int old_size;
3766 int new_step; 3763 int new_step;
3767 int changed = 0; 3764 bool changed = 0;
3768 3765
3769 adj = gtk_range_get_adjustment (GTK_RANGE (wscroll)); 3766 adj = gtk_range_get_adjustment (GTK_RANGE (wscroll));
3770 3767
@@ -3829,17 +3826,15 @@ xg_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar,
3829 } 3826 }
3830} 3827}
3831 3828
3832/* Return non-zero if EVENT is for a scroll bar in frame F. 3829/* Return true if EVENT is for a scroll bar in frame F.
3833 When the same X window is used for several Gtk+ widgets, we cannot 3830 When the same X window is used for several Gtk+ widgets, we cannot
3834 say for sure based on the X window alone if an event is for the 3831 say for sure based on the X window alone if an event is for the
3835 frame. This function does additional checks. 3832 frame. This function does additional checks. */
3836
3837 Return non-zero if the event is for a scroll bar, zero otherwise. */
3838 3833
3839int 3834bool
3840xg_event_is_for_scrollbar (FRAME_PTR f, XEvent *event) 3835xg_event_is_for_scrollbar (FRAME_PTR f, XEvent *event)
3841{ 3836{
3842 int retval = 0; 3837 bool retval = 0;
3843 3838
3844 if (f && event->type == ButtonPress && event->xbutton.button < 4) 3839 if (f && event->type == ButtonPress && event->xbutton.button < 4)
3845 { 3840 {
@@ -4270,7 +4265,7 @@ static void
4270xg_pack_tool_bar (FRAME_PTR f, Lisp_Object pos) 4265xg_pack_tool_bar (FRAME_PTR f, Lisp_Object pos)
4271{ 4266{
4272 struct x_output *x = f->output_data.x; 4267 struct x_output *x = f->output_data.x;
4273 int into_hbox = EQ (pos, Qleft) || EQ (pos, Qright); 4268 bool into_hbox = EQ (pos, Qleft) || EQ (pos, Qright);
4274 4269
4275 toolbar_set_orientation (x->toolbar_widget, 4270 toolbar_set_orientation (x->toolbar_widget,
4276 into_hbox 4271 into_hbox
@@ -4302,7 +4297,7 @@ xg_pack_tool_bar (FRAME_PTR f, Lisp_Object pos)
4302 } 4297 }
4303 else 4298 else
4304 { 4299 {
4305 int vbox_pos = x->menubar_widget ? 1 : 0; 4300 bool vbox_pos = x->menubar_widget != 0;
4306 gtk_handle_box_set_handle_position (GTK_HANDLE_BOX (x->handlebox_widget), 4301 gtk_handle_box_set_handle_position (GTK_HANDLE_BOX (x->handlebox_widget),
4307 GTK_POS_LEFT); 4302 GTK_POS_LEFT);
4308 gtk_box_pack_start (GTK_BOX (x->vbox_widget), x->handlebox_widget, 4303 gtk_box_pack_start (GTK_BOX (x->vbox_widget), x->handlebox_widget,
@@ -4393,7 +4388,7 @@ xg_make_tool_item (FRAME_PTR f,
4393 GtkWidget *wimage, 4388 GtkWidget *wimage,
4394 GtkWidget **wbutton, 4389 GtkWidget **wbutton,
4395 const char *label, 4390 const char *label,
4396 int i, int horiz, int text_image) 4391 int i, bool horiz, bool text_image)
4397{ 4392{
4398 GtkToolItem *ti = gtk_tool_item_new (); 4393 GtkToolItem *ti = gtk_tool_item_new ();
4399 GtkWidget *vb = gtk_box_new (horiz 4394 GtkWidget *vb = gtk_box_new (horiz
@@ -4488,11 +4483,11 @@ xg_make_tool_item (FRAME_PTR f,
4488 return ti; 4483 return ti;
4489} 4484}
4490 4485
4491static int 4486static bool
4492is_box_type (GtkWidget *vb, int is_horizontal) 4487is_box_type (GtkWidget *vb, bool is_horizontal)
4493{ 4488{
4494#ifdef HAVE_GTK3 4489#ifdef HAVE_GTK3
4495 int ret = 0; 4490 bool ret = 0;
4496 if (GTK_IS_BOX (vb)) 4491 if (GTK_IS_BOX (vb))
4497 { 4492 {
4498 GtkOrientation ori = gtk_orientable_get_orientation (GTK_ORIENTABLE (vb)); 4493 GtkOrientation ori = gtk_orientable_get_orientation (GTK_ORIENTABLE (vb));
@@ -4506,10 +4501,10 @@ is_box_type (GtkWidget *vb, int is_horizontal)
4506} 4501}
4507 4502
4508 4503
4509static int 4504static bool
4510xg_tool_item_stale_p (GtkWidget *wbutton, const char *stock_name, 4505xg_tool_item_stale_p (GtkWidget *wbutton, const char *stock_name,
4511 const char *icon_name, const struct image *img, 4506 const char *icon_name, const struct image *img,
4512 const char *label, int horiz) 4507 const char *label, bool horiz)
4513{ 4508{
4514 gpointer old; 4509 gpointer old;
4515 GtkWidget *wimage; 4510 GtkWidget *wimage;
@@ -4551,7 +4546,7 @@ xg_tool_item_stale_p (GtkWidget *wbutton, const char *stock_name,
4551 return 0; 4546 return 0;
4552} 4547}
4553 4548
4554static int 4549static bool
4555xg_update_tool_bar_sizes (FRAME_PTR f) 4550xg_update_tool_bar_sizes (FRAME_PTR f)
4556{ 4551{
4557 struct x_output *x = f->output_data.x; 4552 struct x_output *x = f->output_data.x;
@@ -4607,9 +4602,9 @@ update_frame_tool_bar (FRAME_PTR f)
4607 GtkToolbar *wtoolbar; 4602 GtkToolbar *wtoolbar;
4608 GtkToolItem *ti; 4603 GtkToolItem *ti;
4609 GtkTextDirection dir; 4604 GtkTextDirection dir;
4610 int pack_tool_bar = x->handlebox_widget == NULL; 4605 bool pack_tool_bar = x->handlebox_widget == NULL;
4611 Lisp_Object style; 4606 Lisp_Object style;
4612 int text_image, horiz; 4607 bool text_image, horiz;
4613 struct xg_frame_tb_info *tbinfo; 4608 struct xg_frame_tb_info *tbinfo;
4614 4609
4615 if (! FRAME_GTK_WIDGET (f)) 4610 if (! FRAME_GTK_WIDGET (f))
@@ -4673,8 +4668,8 @@ update_frame_tool_bar (FRAME_PTR f)
4673 4668
4674 for (i = j = 0; i < f->n_tool_bar_items; ++i) 4669 for (i = j = 0; i < f->n_tool_bar_items; ++i)
4675 { 4670 {
4676 int enabled_p = !NILP (PROP (TOOL_BAR_ITEM_ENABLED_P)); 4671 bool enabled_p = !NILP (PROP (TOOL_BAR_ITEM_ENABLED_P));
4677 int selected_p = !NILP (PROP (TOOL_BAR_ITEM_SELECTED_P)); 4672 bool selected_p = !NILP (PROP (TOOL_BAR_ITEM_SELECTED_P));
4678 int idx; 4673 int idx;
4679 ptrdiff_t img_id; 4674 ptrdiff_t img_id;
4680 int icon_size = 0; 4675 int icon_size = 0;
@@ -4687,7 +4682,7 @@ update_frame_tool_bar (FRAME_PTR f)
4687 Lisp_Object rtl; 4682 Lisp_Object rtl;
4688 GtkWidget *wbutton = NULL; 4683 GtkWidget *wbutton = NULL;
4689 Lisp_Object specified_file; 4684 Lisp_Object specified_file;
4690 int vert_only = ! NILP (PROP (TOOL_BAR_ITEM_VERT_ONLY)); 4685 bool vert_only = ! NILP (PROP (TOOL_BAR_ITEM_VERT_ONLY));
4691 const char *label 4686 const char *label
4692 = (EQ (style, Qimage) || (vert_only && horiz)) ? NULL 4687 = (EQ (style, Qimage) || (vert_only && horiz)) ? NULL
4693 : STRINGP (PROP (TOOL_BAR_ITEM_LABEL)) 4688 : STRINGP (PROP (TOOL_BAR_ITEM_LABEL))
@@ -4882,7 +4877,7 @@ free_frame_tool_bar (FRAME_PTR f)
4882 if (x->toolbar_widget) 4877 if (x->toolbar_widget)
4883 { 4878 {
4884 struct xg_frame_tb_info *tbinfo; 4879 struct xg_frame_tb_info *tbinfo;
4885 int is_packed = x->handlebox_widget != 0; 4880 bool is_packed = x->handlebox_widget != 0;
4886 block_input (); 4881 block_input ();
4887 /* We may have created the toolbar_widget in xg_create_tool_bar, but 4882 /* We may have created the toolbar_widget in xg_create_tool_bar, but
4888 not the x->handlebox_widget which is created in xg_pack_tool_bar. */ 4883 not the x->handlebox_widget which is created in xg_pack_tool_bar. */
@@ -4919,13 +4914,13 @@ free_frame_tool_bar (FRAME_PTR f)
4919 } 4914 }
4920} 4915}
4921 4916
4922int 4917void
4923xg_change_toolbar_position (FRAME_PTR f, Lisp_Object pos) 4918xg_change_toolbar_position (FRAME_PTR f, Lisp_Object pos)
4924{ 4919{
4925 struct x_output *x = f->output_data.x; 4920 struct x_output *x = f->output_data.x;
4926 4921
4927 if (! x->toolbar_widget || ! x->handlebox_widget) 4922 if (! x->toolbar_widget || ! x->handlebox_widget)
4928 return 1; 4923 return;
4929 4924
4930 block_input (); 4925 block_input ();
4931 g_object_ref (x->handlebox_widget); 4926 g_object_ref (x->handlebox_widget);
@@ -4941,7 +4936,6 @@ xg_change_toolbar_position (FRAME_PTR f, Lisp_Object pos)
4941 xg_height_or_width_changed (f); 4936 xg_height_or_width_changed (f);
4942 4937
4943 unblock_input (); 4938 unblock_input ();
4944 return 1;
4945} 4939}
4946 4940
4947 4941
diff --git a/src/gtkutil.h b/src/gtkutil.h
index 926478dd728..43f2b237a68 100644
--- a/src/gtkutil.h
+++ b/src/gtkutil.h
@@ -79,13 +79,13 @@ struct _widget_value;
79extern struct _widget_value *malloc_widget_value (void); 79extern struct _widget_value *malloc_widget_value (void);
80extern void free_widget_value (struct _widget_value *); 80extern void free_widget_value (struct _widget_value *);
81 81
82extern int xg_uses_old_file_dialog (void) ATTRIBUTE_CONST; 82extern bool xg_uses_old_file_dialog (void) ATTRIBUTE_CONST;
83 83
84extern char *xg_get_file_name (FRAME_PTR f, 84extern char *xg_get_file_name (FRAME_PTR f,
85 char *prompt, 85 char *prompt,
86 char *default_filename, 86 char *default_filename,
87 int mustmatch_p, 87 bool mustmatch_p,
88 int only_dir_p); 88 bool only_dir_p);
89 89
90extern Lisp_Object xg_get_font (FRAME_PTR f, const char *); 90extern Lisp_Object xg_get_font (FRAME_PTR f, const char *);
91 91
@@ -100,16 +100,16 @@ extern GtkWidget *xg_create_widget (const char *type,
100extern void xg_modify_menubar_widgets (GtkWidget *menubar, 100extern void xg_modify_menubar_widgets (GtkWidget *menubar,
101 FRAME_PTR f, 101 FRAME_PTR f,
102 struct _widget_value *val, 102 struct _widget_value *val,
103 int deep_p, 103 bool deep_p,
104 GCallback select_cb, 104 GCallback select_cb,
105 GCallback deactivate_cb, 105 GCallback deactivate_cb,
106 GCallback highlight_cb); 106 GCallback highlight_cb);
107 107
108extern int xg_update_frame_menubar (FRAME_PTR f); 108extern void xg_update_frame_menubar (FRAME_PTR f);
109 109
110extern int xg_event_is_for_menubar (FRAME_PTR f, XEvent *event); 110extern bool xg_event_is_for_menubar (FRAME_PTR f, XEvent *event);
111 111
112extern int xg_have_tear_offs (void); 112extern bool xg_have_tear_offs (void);
113 113
114extern ptrdiff_t xg_get_scroll_id_for_window (Display *dpy, Window wid); 114extern ptrdiff_t xg_get_scroll_id_for_window (Display *dpy, Window wid);
115 115
@@ -131,12 +131,12 @@ extern void xg_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar,
131 int portion, 131 int portion,
132 int position, 132 int position,
133 int whole); 133 int whole);
134extern int xg_event_is_for_scrollbar (FRAME_PTR f, XEvent *event); 134extern bool xg_event_is_for_scrollbar (FRAME_PTR f, XEvent *event);
135extern int xg_get_default_scrollbar_width (void); 135extern int xg_get_default_scrollbar_width (void);
136 136
137extern void update_frame_tool_bar (FRAME_PTR f); 137extern void update_frame_tool_bar (FRAME_PTR f);
138extern void free_frame_tool_bar (FRAME_PTR f); 138extern void free_frame_tool_bar (FRAME_PTR f);
139extern int xg_change_toolbar_position (FRAME_PTR f, Lisp_Object pos); 139extern void xg_change_toolbar_position (FRAME_PTR f, Lisp_Object pos);
140 140
141extern void xg_frame_resized (FRAME_PTR f, 141extern void xg_frame_resized (FRAME_PTR f,
142 int pixelwidth, 142 int pixelwidth,
@@ -148,23 +148,23 @@ extern void xg_display_open (char *display_name, Display **dpy);
148extern void xg_display_close (Display *dpy); 148extern void xg_display_close (Display *dpy);
149extern GdkCursor * xg_create_default_cursor (Display *dpy); 149extern GdkCursor * xg_create_default_cursor (Display *dpy);
150 150
151extern int xg_create_frame_widgets (FRAME_PTR f); 151extern bool xg_create_frame_widgets (FRAME_PTR f);
152extern void xg_free_frame_widgets (FRAME_PTR f); 152extern void xg_free_frame_widgets (FRAME_PTR f);
153extern void xg_set_background_color (FRAME_PTR f, unsigned long bg); 153extern void xg_set_background_color (FRAME_PTR f, unsigned long bg);
154extern int xg_check_special_colors (struct frame *f, 154extern bool xg_check_special_colors (struct frame *f,
155 const char *color_name, 155 const char *color_name,
156 XColor *color); 156 XColor *color);
157 157
158extern void xg_set_frame_icon (FRAME_PTR f, 158extern void xg_set_frame_icon (FRAME_PTR f,
159 Pixmap icon_pixmap, 159 Pixmap icon_pixmap,
160 Pixmap icon_mask); 160 Pixmap icon_mask);
161 161
162extern int xg_prepare_tooltip (FRAME_PTR f, 162extern bool xg_prepare_tooltip (FRAME_PTR f,
163 Lisp_Object string, 163 Lisp_Object string,
164 int *width, 164 int *width,
165 int *height); 165 int *height);
166extern void xg_show_tooltip (FRAME_PTR f, int root_x, int root_y); 166extern void xg_show_tooltip (FRAME_PTR f, int root_x, int root_y);
167extern int xg_hide_tooltip (FRAME_PTR f); 167extern bool xg_hide_tooltip (FRAME_PTR f);
168 168
169 169
170/* Mark all callback data that are Lisp_object:s during GC. */ 170/* Mark all callback data that are Lisp_object:s during GC. */
@@ -175,7 +175,7 @@ extern void xg_initialize (void);
175 175
176/* Setting scrollbar values invokes the callback. Use this variable 176/* Setting scrollbar values invokes the callback. Use this variable
177 to indicate that the callback should do nothing. */ 177 to indicate that the callback should do nothing. */
178extern int xg_ignore_gtk_scrollbar; 178extern bool xg_ignore_gtk_scrollbar;
179 179
180#endif /* USE_GTK */ 180#endif /* USE_GTK */
181#endif /* GTKUTIL_H */ 181#endif /* GTKUTIL_H */
diff --git a/src/nsmenu.m b/src/nsmenu.m
index ed5e76cad0d..b60cc005c5f 100644
--- a/src/nsmenu.m
+++ b/src/nsmenu.m
@@ -115,13 +115,13 @@ popup_activated (void)
115 115
116/* -------------------------------------------------------------------------- 116/* --------------------------------------------------------------------------
117 Update menubar. Three cases: 117 Update menubar. Three cases:
118 1) deep_p = 0, submenu = nil: Fresh switch onto a frame -- either set up 118 1) ! deep_p, submenu = nil: Fresh switch onto a frame -- either set up
119 just top-level menu strings (OS X), or goto case (2) (GNUstep). 119 just top-level menu strings (OS X), or goto case (2) (GNUstep).
120 2) deep_p = 1, submenu = nil: Recompute all submenus. 120 2) deep_p, submenu = nil: Recompute all submenus.
121 3) deep_p = 1, submenu = non-nil: Update contents of a single submenu. 121 3) deep_p, submenu = non-nil: Update contents of a single submenu.
122 -------------------------------------------------------------------------- */ 122 -------------------------------------------------------------------------- */
123void 123void
124ns_update_menubar (struct frame *f, int deep_p, EmacsMenu *submenu) 124ns_update_menubar (struct frame *f, bool deep_p, EmacsMenu *submenu)
125{ 125{
126 NSAutoreleasePool *pool; 126 NSAutoreleasePool *pool;
127 id menu = [NSApp mainMenu]; 127 id menu = [NSApp mainMenu];
@@ -507,7 +507,7 @@ ns_update_menubar (struct frame *f, int deep_p, EmacsMenu *submenu)
507 frame's menus have changed, and the *step representation should be updated 507 frame's menus have changed, and the *step representation should be updated
508 from Lisp. */ 508 from Lisp. */
509void 509void
510set_frame_menubar (struct frame *f, int first_time, int deep_p) 510set_frame_menubar (struct frame *f, bool first_time, bool deep_p)
511{ 511{
512 ns_update_menubar (f, deep_p, nil); 512 ns_update_menubar (f, deep_p, nil);
513} 513}
@@ -1766,7 +1766,7 @@ ns_popup_dialog (Lisp_Object position, Lisp_Object contents, Lisp_Object header)
1766} 1766}
1767 1767
1768 1768
1769 1769
1770- (void)timeout_handler: (NSTimer *)timedEntry 1770- (void)timeout_handler: (NSTimer *)timedEntry
1771{ 1771{
1772 NSEvent *nxev = [NSEvent otherEventWithType: NSApplicationDefined 1772 NSEvent *nxev = [NSEvent otherEventWithType: NSApplicationDefined
diff --git a/src/w32menu.c b/src/w32menu.c
index 651364d5778..fb1cb606940 100644
--- a/src/w32menu.c
+++ b/src/w32menu.c
@@ -85,7 +85,7 @@ MessageBoxW_Proc unicode_message_box = NULL;
85 85
86Lisp_Object Qdebug_on_next_call; 86Lisp_Object Qdebug_on_next_call;
87 87
88void set_frame_menubar (FRAME_PTR, int, int); 88void set_frame_menubar (FRAME_PTR, bool, bool);
89 89
90#ifdef HAVE_DIALOGS 90#ifdef HAVE_DIALOGS
91static Lisp_Object w32_dialog_show (FRAME_PTR, int, Lisp_Object, char**); 91static Lisp_Object w32_dialog_show (FRAME_PTR, int, Lisp_Object, char**);
@@ -356,7 +356,7 @@ menubar_selection_callback (FRAME_PTR f, void * client_data)
356 it is set the first time this is called, from initialize_frame_menubar. */ 356 it is set the first time this is called, from initialize_frame_menubar. */
357 357
358void 358void
359set_frame_menubar (FRAME_PTR f, int first_time, int deep_p) 359set_frame_menubar (FRAME_PTR f, bool first_time, bool deep_p)
360{ 360{
361 HMENU menubar_widget = f->output_data.w32->menubar_widget; 361 HMENU menubar_widget = f->output_data.w32->menubar_widget;
362 Lisp_Object items; 362 Lisp_Object items;
diff --git a/src/w32term.c b/src/w32term.c
index f5424a4d5f1..5d5e572c475 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -197,7 +197,7 @@ static void w32_define_cursor (Window, Cursor);
197 197
198void x_lower_frame (struct frame *); 198void x_lower_frame (struct frame *);
199void x_scroll_bar_clear (struct frame *); 199void x_scroll_bar_clear (struct frame *);
200void x_wm_set_size_hint (struct frame *, long, int); 200void x_wm_set_size_hint (struct frame *, long, bool);
201void x_raise_frame (struct frame *); 201void x_raise_frame (struct frame *);
202void x_set_window_size (struct frame *, int, int, int); 202void x_set_window_size (struct frame *, int, int, int);
203void x_wm_set_window_state (struct frame *, int); 203void x_wm_set_window_state (struct frame *, int);
@@ -5982,10 +5982,10 @@ x_destroy_window (struct frame *f)
5982/* Set the normal size hints for the window manager, for frame F. 5982/* Set the normal size hints for the window manager, for frame F.
5983 FLAGS is the flags word to use--or 0 meaning preserve the flags 5983 FLAGS is the flags word to use--or 0 meaning preserve the flags
5984 that the window now has. 5984 that the window now has.
5985 If USER_POSITION is nonzero, we set the USPosition 5985 If USER_POSITION, set the USPosition
5986 flag (this is useful when FLAGS is 0). */ 5986 flag (this is useful when FLAGS is 0). */
5987void 5987void
5988x_wm_set_size_hint (struct frame *f, long flags, int user_position) 5988x_wm_set_size_hint (struct frame *f, long flags, bool user_position)
5989{ 5989{
5990 Window window = FRAME_W32_WINDOW (f); 5990 Window window = FRAME_W32_WINDOW (f);
5991 5991
diff --git a/src/xfns.c b/src/xfns.c
index 192ccb71a09..74808e6758f 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -656,8 +656,8 @@ x_set_tool_bar_position (struct frame *f,
656 if (EQ (new_value, old_value)) return; 656 if (EQ (new_value, old_value)) return;
657 657
658#ifdef USE_GTK 658#ifdef USE_GTK
659 if (xg_change_toolbar_position (f, new_value)) 659 xg_change_toolbar_position (f, new_value);
660 fset_tool_bar_position (f, new_value); 660 fset_tool_bar_position (f, new_value);
661#endif 661#endif
662} 662}
663 663
@@ -4985,13 +4985,14 @@ Text larger than the specified size is clipped. */)
4985#ifdef USE_GTK 4985#ifdef USE_GTK
4986 if (x_gtk_use_system_tooltips) 4986 if (x_gtk_use_system_tooltips)
4987 { 4987 {
4988 int ok; 4988 bool ok;
4989 4989
4990 /* Hide a previous tip, if any. */ 4990 /* Hide a previous tip, if any. */
4991 Fx_hide_tip (); 4991 Fx_hide_tip ();
4992 4992
4993 block_input (); 4993 block_input ();
4994 if ((ok = xg_prepare_tooltip (f, string, &width, &height)) != 0) 4994 ok = xg_prepare_tooltip (f, string, &width, &height);
4995 if (ok)
4995 { 4996 {
4996 compute_tip_xy (f, parms, dx, dy, width, height, &root_x, &root_y); 4997 compute_tip_xy (f, parms, dx, dy, width, height, &root_x, &root_y);
4997 xg_show_tooltip (f, root_x, root_y); 4998 xg_show_tooltip (f, root_x, root_y);
diff --git a/src/xmenu.c b/src/xmenu.c
index 06d6cb055c0..96a1ae87fdc 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -834,13 +834,13 @@ menubar_selection_callback (Widget widget, LWLIB_ID id, XtPointer client_data)
834#endif /* not USE_GTK */ 834#endif /* not USE_GTK */
835 835
836/* Recompute all the widgets of frame F, when the menu bar has been 836/* Recompute all the widgets of frame F, when the menu bar has been
837 changed. Value is non-zero if widgets were updated. */ 837 changed. */
838 838
839static int 839static void
840update_frame_menubar (FRAME_PTR f) 840update_frame_menubar (FRAME_PTR f)
841{ 841{
842#ifdef USE_GTK 842#ifdef USE_GTK
843 return xg_update_frame_menubar (f); 843 xg_update_frame_menubar (f);
844#else 844#else
845 struct x_output *x; 845 struct x_output *x;
846 int columns, rows; 846 int columns, rows;
@@ -851,7 +851,7 @@ update_frame_menubar (FRAME_PTR f)
851 x = f->output_data.x; 851 x = f->output_data.x;
852 852
853 if (!x->menubar_widget || XtIsManaged (x->menubar_widget)) 853 if (!x->menubar_widget || XtIsManaged (x->menubar_widget))
854 return 0; 854 return;
855 855
856 block_input (); 856 block_input ();
857 /* Save the size of the frame because the pane widget doesn't accept 857 /* Save the size of the frame because the pane widget doesn't accept
@@ -882,7 +882,6 @@ update_frame_menubar (FRAME_PTR f)
882 EmacsFrameSetCharSize (x->edit_widget, columns, rows); 882 EmacsFrameSetCharSize (x->edit_widget, columns, rows);
883 unblock_input (); 883 unblock_input ();
884#endif 884#endif
885 return 1;
886} 885}
887 886
888#ifdef USE_LUCID 887#ifdef USE_LUCID
@@ -921,7 +920,7 @@ apply_systemfont_to_menu (struct frame *f, Widget w)
921 it is set the first time this is called, from initialize_frame_menubar. */ 920 it is set the first time this is called, from initialize_frame_menubar. */
922 921
923void 922void
924set_frame_menubar (FRAME_PTR f, int first_time, int deep_p) 923set_frame_menubar (FRAME_PTR f, bool first_time, bool deep_p)
925{ 924{
926 xt_or_gtk_widget menubar_widget; 925 xt_or_gtk_widget menubar_widget;
927#ifdef USE_X_TOOLKIT 926#ifdef USE_X_TOOLKIT
diff --git a/src/xterm.c b/src/xterm.c
index 15a78147d24..c33fbf74c77 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -9541,13 +9541,13 @@ x_destroy_window (struct frame *f)
9541/* Set the normal size hints for the window manager, for frame F. 9541/* Set the normal size hints for the window manager, for frame F.
9542 FLAGS is the flags word to use--or 0 meaning preserve the flags 9542 FLAGS is the flags word to use--or 0 meaning preserve the flags
9543 that the window now has. 9543 that the window now has.
9544 If USER_POSITION is nonzero, we set the USPosition 9544 If USER_POSITION, set the USPosition
9545 flag (this is useful when FLAGS is 0). 9545 flag (this is useful when FLAGS is 0).
9546 The GTK version is in gtkutils.c */ 9546 The GTK version is in gtkutils.c. */
9547 9547
9548#ifndef USE_GTK 9548#ifndef USE_GTK
9549void 9549void
9550x_wm_set_size_hint (struct frame *f, long flags, int user_position) 9550x_wm_set_size_hint (struct frame *f, long flags, bool user_position)
9551{ 9551{
9552 XSizeHints size_hints; 9552 XSizeHints size_hints;
9553 Window window = FRAME_OUTER_WINDOW (f); 9553 Window window = FRAME_OUTER_WINDOW (f);