X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/1c50b3adb636addc4244942e8f0e33b1e557ec07..0064e36f4fc76b0e8d2fc8d3e6f63da6e579a414:/src/gtkutil.c diff --git a/src/gtkutil.c b/src/gtkutil.c index 6db8858923..694278a2b4 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -1,6 +1,6 @@ /* Functions for creating and updating GTK widgets. -Copyright (C) 2003-2014 Free Software Foundation, Inc. +Copyright (C) 2003-2015 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -79,6 +79,20 @@ along with GNU Emacs. If not, see . */ #define remove_submenu(w) gtk_menu_item_remove_submenu ((w)) #endif +#if ! GTK_CHECK_VERSION (2, 14, 0) +#define gtk_adjustment_configure(adj, xvalue, xlower, \ + xupper, xstep_increment, \ + xpage_increment, xpagesize) \ + do { \ + adj->lower = xlower; \ + adj->upper = xupper; \ + adj->page_size = xpagesize; \ + gtk_adjustment_set_value (adj, xvalue); \ + adj->page_increment = xpage_increment; \ + adj->step_increment = xstep_increment; \ + } while (0) +#endif /* < Gtk+ 2.14 */ + #ifdef HAVE_FREETYPE #if GTK_CHECK_VERSION (3, 2, 0) #define USE_NEW_GTK_FONT_CHOOSER 1 @@ -940,7 +954,7 @@ xg_frame_set_char_size (struct frame *f, int width, int height) x_wait_for_event (f, ConfigureNotify); } else - adjust_frame_size (f, -1, -1, 5, 0, Qnil); + adjust_frame_size (f, -1, -1, 5, 0, Qxg_frame_set_char_size); } /* Handle height/width changes (i.e. add/remove/move menu/toolbar). @@ -1825,12 +1839,12 @@ xg_get_file_with_chooser (struct frame *f, if (x_gtk_file_dialog_help_text) { - msgbuf[0] = '\0'; + char *z = msgbuf; /* Gtk+ 2.10 has the file name text entry box integrated in the dialog. Show the C-l help text only for versions < 2.10. */ if (gtk_check_version (2, 10, 0) && action != GTK_FILE_CHOOSER_ACTION_SAVE) - strcat (msgbuf, "\nType C-l to display a file name text entry box.\n"); - strcat (msgbuf, "\nIf you don't like this file selector, use the " + z = stpcpy (z, "\nType C-l to display a file name text entry box.\n"); + strcpy (z, "\nIf you don't like this file selector, use the " "corresponding\nkey binding or customize " "use-file-dialog to turn it off."); @@ -3938,18 +3952,9 @@ xg_set_toolkit_horizontal_scroll_bar_thumb (struct scroll_bar *bar, block_input (); adj = gtk_range_get_adjustment (GTK_RANGE (wscroll)); -#if GTK_CHECK_VERSION (2, 3, 16) gtk_adjustment_configure (adj, (gdouble) value, (gdouble) lower, (gdouble) upper, (gdouble) step_increment, (gdouble) page_increment, (gdouble) pagesize); -#else - gtk_adjustment_set_lower (adj, (gdouble) lower); - gtk_adjustment_set_upper (adj, (gdouble) upper); - gtk_adjustment_set_page_size (adj, (gdouble) pagesize); - gtk_adjustment_set_value (adj, (gdouble) value); - gtk_adjustment_set_page_increment (adj, (gdouble) page_increment); - gtk_adjustment_set_step_increment (adj, (gdouble) step_increment); -#endif gtk_adjustment_changed (adj); unblock_input (); }