aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJan Djärv2010-02-24 19:23:48 +0100
committerJan Djärv2010-02-24 19:23:48 +0100
commit32e737d7ca2f35f7490cdbd88fd5e3f1248f1728 (patch)
tree461008598d91aa13ab0cf8691d46eb5f6b2f8dee /src
parent86f5c0343d53ede798550e70ba66bd4610584126 (diff)
downloademacs-32e737d7ca2f35f7490cdbd88fd5e3f1248f1728.tar.gz
emacs-32e737d7ca2f35f7490cdbd88fd5e3f1248f1728.zip
Move declarations before statements.
* xterm.c (XTflash): Move declarations before statements. * gtkutil.c (xg_get_gdk_display): Remove (unused). (xg_get_pixbuf_from_pix_and_mask, xg_create_frame_widgets) (xg_toggle_notify_cb, xg_set_toolkit_scroll_bar_thumb) (xg_create_tool_bar): Remove unused variables. (x_wm_set_size_hint): Move declarations before statements. (xg_create_frame_widgets): Remove variable grav,
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog11
-rw-r--r--src/gtkutil.c34
-rw-r--r--src/xterm.c9
3 files changed, 25 insertions, 29 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 74a9c2e2179..542a0781783 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,14 @@
12010-02-24 Jan Djärv <jan.h.d@swipnet.se>
2
3 * xterm.c (XTflash): Move declarations before statements.
4
5 * gtkutil.c (xg_get_gdk_display): Remove (unused).
6 (xg_get_pixbuf_from_pix_and_mask, xg_create_frame_widgets)
7 (xg_toggle_notify_cb, xg_set_toolkit_scroll_bar_thumb)
8 (xg_create_tool_bar): Remove unused variables.
9 (x_wm_set_size_hint): Move declarations before statements.
10 (xg_create_frame_widgets): Remove variable grav,
11
12010-02-21 Chong Yidong <cyd@stupidchicken.com> 122010-02-21 Chong Yidong <cyd@stupidchicken.com>
2 13
3 * m/arm.h: Define the LIB_GCC flag to be -lgcc_s (Bug#5518). 14 * m/arm.h: Define the LIB_GCC flag to be -lgcc_s (Bug#5518).
diff --git a/src/gtkutil.c b/src/gtkutil.c
index a42c07aef5d..2764382e8a1 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -58,15 +58,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
58 58
59static GdkDisplay *gdpy_def; 59static GdkDisplay *gdpy_def;
60 60
61/* Return the GdkDisplay that corresponds to the X display DPY. */
62
63static GdkDisplay *
64xg_get_gdk_display (dpy)
65 Display *dpy;
66{
67 return gdk_x11_lookup_xdisplay (dpy);
68}
69
70/* When the GTK widget W is to be created on a display for F that 61/* When the GTK widget W is to be created on a display for F that
71 is not the default display, set the display for W. 62 is not the default display, set the display for W.
72 W can be a GtkMenu or a GtkWindow widget. */ 63 W can be a GtkMenu or a GtkWindow widget. */
@@ -252,10 +243,8 @@ xg_get_pixbuf_from_pix_and_mask (gpix, gmask, cmap)
252 GdkPixmap *gmask; 243 GdkPixmap *gmask;
253 GdkColormap *cmap; 244 GdkColormap *cmap;
254{ 245{
255 int x, y, width, height, rowstride, mask_rowstride; 246 int width, height;
256 GdkPixbuf *icon_buf, *tmp_buf; 247 GdkPixbuf *icon_buf, *tmp_buf;
257 guchar *pixels;
258 guchar *mask_pixels;
259 248
260 gdk_drawable_get_size (gpix, &width, &height); 249 gdk_drawable_get_size (gpix, &width, &height);
261 tmp_buf = gdk_pixbuf_get_from_drawable (NULL, gpix, cmap, 250 tmp_buf = gdk_pixbuf_get_from_drawable (NULL, gpix, cmap,
@@ -776,7 +765,6 @@ xg_create_frame_widgets (f)
776 GtkWidget *wfixed; 765 GtkWidget *wfixed;
777 GdkColor bg; 766 GdkColor bg;
778 GtkRcStyle *style; 767 GtkRcStyle *style;
779 int i;
780 char *title = 0; 768 char *title = 0;
781 769
782 BLOCK_INPUT; 770 BLOCK_INPUT;
@@ -844,8 +832,8 @@ xg_create_frame_widgets (f)
844 and specify it. 832 and specify it.
845 GTK will itself handle calculating the real position this way. */ 833 GTK will itself handle calculating the real position this way. */
846 xg_set_geometry (f); 834 xg_set_geometry (f);
847 int grav = gtk_window_get_gravity (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f))); 835 f->win_gravity
848 f->win_gravity = grav; 836 = gtk_window_get_gravity (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)));
849 837
850 gtk_widget_add_events (wfixed, 838 gtk_widget_add_events (wfixed,
851 GDK_POINTER_MOTION_MASK 839 GDK_POINTER_MOTION_MASK
@@ -901,12 +889,6 @@ x_wm_set_size_hint (f, flags, user_position)
901 long flags; 889 long flags;
902 int user_position; 890 int user_position;
903{ 891{
904 /* Don't set size hints during initialization; that apparently leads
905 to a race condition. See the thread at
906 http://lists.gnu.org/archive/html/emacs-devel/2008-10/msg00033.html */
907 if (NILP (Vafter_init_time) || !FRAME_GTK_OUTER_WIDGET (f))
908 return;
909
910 /* Must use GTK routines here, otherwise GTK resets the size hints 892 /* Must use GTK routines here, otherwise GTK resets the size hints
911 to its own defaults. */ 893 to its own defaults. */
912 GdkGeometry size_hints; 894 GdkGeometry size_hints;
@@ -915,6 +897,12 @@ x_wm_set_size_hint (f, flags, user_position)
915 int min_rows = 0, min_cols = 0; 897 int min_rows = 0, min_cols = 0;
916 int win_gravity = f->win_gravity; 898 int win_gravity = f->win_gravity;
917 899
900 /* Don't set size hints during initialization; that apparently leads
901 to a race condition. See the thread at
902 http://lists.gnu.org/archive/html/emacs-devel/2008-10/msg00033.html */
903 if (NILP (Vafter_init_time) || !FRAME_GTK_OUTER_WIDGET (f))
904 return;
905
918 if (flags) 906 if (flags)
919 { 907 {
920 memset (&size_hints, 0, sizeof (size_hints)); 908 memset (&size_hints, 0, sizeof (size_hints));
@@ -1391,7 +1379,6 @@ xg_toggle_notify_cb (gobject, arg1, user_data)
1391 1379
1392 if (strcmp (arg1->name, "show-hidden") == 0) 1380 if (strcmp (arg1->name, "show-hidden") == 0)
1393 { 1381 {
1394 GtkFileChooser *dialog = GTK_FILE_CHOOSER (gobject);
1395 GtkWidget *wtoggle = GTK_WIDGET (user_data); 1382 GtkWidget *wtoggle = GTK_WIDGET (user_data);
1396 gboolean visible, toggle_on; 1383 gboolean visible, toggle_on;
1397 1384
@@ -3347,8 +3334,6 @@ xg_set_toolkit_scroll_bar_thumb (bar, portion, position, whole)
3347 3334
3348 if (changed || (int) gtk_range_get_value (GTK_RANGE (wscroll)) != value) 3335 if (changed || (int) gtk_range_get_value (GTK_RANGE (wscroll)) != value)
3349 { 3336 {
3350 GtkWidget *wfixed = f->output_data.x->edit_widget;
3351
3352 BLOCK_INPUT; 3337 BLOCK_INPUT;
3353 3338
3354 /* gtk_range_set_value invokes the callback. Set 3339 /* gtk_range_set_value invokes the callback. Set
@@ -3801,7 +3786,6 @@ xg_create_tool_bar (f)
3801 FRAME_PTR f; 3786 FRAME_PTR f;
3802{ 3787{
3803 struct x_output *x = f->output_data.x; 3788 struct x_output *x = f->output_data.x;
3804 GtkRequisition req;
3805 3789
3806 x->toolbar_widget = gtk_toolbar_new (); 3790 x->toolbar_widget = gtk_toolbar_new ();
3807 x->toolbar_detached = 0; 3791 x->toolbar_detached = 0;
diff --git a/src/xterm.c b/src/xterm.c
index b4a04195430..fd09d6d4815 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -3019,13 +3019,14 @@ XTflash (f)
3019 /* Use Gdk routines to draw. This way, we won't draw over scroll bars 3019 /* Use Gdk routines to draw. This way, we won't draw over scroll bars
3020 when the scroll bars and the edit widget share the same X window. */ 3020 when the scroll bars and the edit widget share the same X window. */
3021 GdkGCValues vals; 3021 GdkGCValues vals;
3022 GdkGC *gc;
3022 vals.foreground.pixel = (FRAME_FOREGROUND_PIXEL (f) 3023 vals.foreground.pixel = (FRAME_FOREGROUND_PIXEL (f)
3023 ^ FRAME_BACKGROUND_PIXEL (f)); 3024 ^ FRAME_BACKGROUND_PIXEL (f));
3024 vals.function = GDK_XOR; 3025 vals.function = GDK_XOR;
3025 GdkGC *gc = gdk_gc_new_with_values (FRAME_GTK_WIDGET (f)->window, 3026 gc = gdk_gc_new_with_values (FRAME_GTK_WIDGET (f)->window,
3026 &vals, 3027 &vals,
3027 GDK_GC_FUNCTION 3028 GDK_GC_FUNCTION
3028 | GDK_GC_FOREGROUND); 3029 | GDK_GC_FOREGROUND);
3029#define XFillRectangle(d, win, gc, x, y, w, h) \ 3030#define XFillRectangle(d, win, gc, x, y, w, h) \
3030 gdk_draw_rectangle (FRAME_GTK_WIDGET (f)->window, \ 3031 gdk_draw_rectangle (FRAME_GTK_WIDGET (f)->window, \
3031 gc, TRUE, x, y, w, h) 3032 gc, TRUE, x, y, w, h)