aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDmitry Antipov2013-08-29 11:27:27 +0400
committerDmitry Antipov2013-08-29 11:27:27 +0400
commit1f5cf2009af2779ad81412b9d111b37f6e2fd841 (patch)
tree6320c70e1d3903472b7f2a75cbe330338185bb7d /src
parentd2b368135803170fc2d1f65237b7ef22676f9ecb (diff)
downloademacs-1f5cf2009af2779ad81412b9d111b37f6e2fd841.tar.gz
emacs-1f5cf2009af2779ad81412b9d111b37f6e2fd841.zip
* xterm.c (x_clear_area): Lost 7th arg because it is always False.
(x_after_update_window_line, x_scroll_bar_create): (x_scroll_bar_set_handle, XTset_vertical_scroll_bar): (handle_one_xevent, x_clear_frame_area): * gtkutil.c (xg_clear_under_internal_border, xg_update_scrollbar_pos): * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines): Adjust users. * xterm.h (x_clear_area): Adjust prototype.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog10
-rw-r--r--src/gtkutil.c49
-rw-r--r--src/xfns.c8
-rw-r--r--src/xterm.c51
-rw-r--r--src/xterm.h2
5 files changed, 55 insertions, 65 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 2105391755b..a2a58487672 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,15 @@
12013-08-29 Dmitry Antipov <dmantipov@yandex.ru> 12013-08-29 Dmitry Antipov <dmantipov@yandex.ru>
2 2
3 * xterm.c (x_clear_area): Lost 7th arg because it is always False.
4 (x_after_update_window_line, x_scroll_bar_create):
5 (x_scroll_bar_set_handle, XTset_vertical_scroll_bar):
6 (handle_one_xevent, x_clear_frame_area):
7 * gtkutil.c (xg_clear_under_internal_border, xg_update_scrollbar_pos):
8 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines): Adjust users.
9 * xterm.h (x_clear_area): Adjust prototype.
10
112013-08-29 Dmitry Antipov <dmantipov@yandex.ru>
12
3 Hook scanning and indentation functions to find_newline. This helps 13 Hook scanning and indentation functions to find_newline. This helps
4 to avoid duplicated code and renders more respect to newline cache. 14 to avoid duplicated code and renders more respect to newline cache.
5 * lisp.h (scan_newline): Prefer ptrdiff_t to EMACS_INT. 15 * lisp.h (scan_newline): Prefer ptrdiff_t to EMACS_INT.
diff --git a/src/gtkutil.c b/src/gtkutil.c
index f03ca592834..a1d217e06ed 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -872,29 +872,23 @@ xg_clear_under_internal_border (struct frame *f)
872 if (FRAME_INTERNAL_BORDER_WIDTH (f) > 0) 872 if (FRAME_INTERNAL_BORDER_WIDTH (f) > 0)
873 { 873 {
874 GtkWidget *wfixed = f->output_data.x->edit_widget; 874 GtkWidget *wfixed = f->output_data.x->edit_widget;
875
875 gtk_widget_queue_draw (wfixed); 876 gtk_widget_queue_draw (wfixed);
876 gdk_window_process_all_updates (); 877 gdk_window_process_all_updates ();
877 x_clear_area (FRAME_X_DISPLAY (f), 878
878 FRAME_X_WINDOW (f), 879 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 0, 0,
879 0, 0, 880 FRAME_PIXEL_WIDTH (f), FRAME_INTERNAL_BORDER_WIDTH (f));
880 FRAME_PIXEL_WIDTH (f), 881
881 FRAME_INTERNAL_BORDER_WIDTH (f), 0); 882 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 0, 0,
882 x_clear_area (FRAME_X_DISPLAY (f), 883 FRAME_INTERNAL_BORDER_WIDTH (f), FRAME_PIXEL_HEIGHT (f));
883 FRAME_X_WINDOW (f), 884
884 0, 0, 885 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 0,
885 FRAME_INTERNAL_BORDER_WIDTH (f), 886 FRAME_PIXEL_HEIGHT (f) - FRAME_INTERNAL_BORDER_WIDTH (f),
886 FRAME_PIXEL_HEIGHT (f), 0); 887 FRAME_PIXEL_WIDTH (f), FRAME_INTERNAL_BORDER_WIDTH (f));
887 x_clear_area (FRAME_X_DISPLAY (f), 888
888 FRAME_X_WINDOW (f), 889 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
889 0, FRAME_PIXEL_HEIGHT (f) - FRAME_INTERNAL_BORDER_WIDTH (f), 890 FRAME_PIXEL_WIDTH (f) - FRAME_INTERNAL_BORDER_WIDTH (f),
890 FRAME_PIXEL_WIDTH (f), 891 0, FRAME_INTERNAL_BORDER_WIDTH (f), FRAME_PIXEL_HEIGHT (f));
891 FRAME_INTERNAL_BORDER_WIDTH (f), 0);
892 x_clear_area (FRAME_X_DISPLAY (f),
893 FRAME_X_WINDOW (f),
894 FRAME_PIXEL_WIDTH (f) - FRAME_INTERNAL_BORDER_WIDTH (f),
895 0,
896 FRAME_INTERNAL_BORDER_WIDTH (f),
897 FRAME_PIXEL_HEIGHT (f), 0);
898 } 892 }
899} 893}
900 894
@@ -3751,14 +3745,11 @@ xg_update_scrollbar_pos (struct frame *f,
3751 gtk_widget_queue_draw (wfixed); 3745 gtk_widget_queue_draw (wfixed);
3752 gdk_window_process_all_updates (); 3746 gdk_window_process_all_updates ();
3753 if (oldx != -1 && oldw > 0 && oldh > 0) 3747 if (oldx != -1 && oldw > 0 && oldh > 0)
3754 { 3748 /* Clear under old scroll bar position. This must be done after
3755 /* Clear under old scroll bar position. This must be done after 3749 the gtk_widget_queue_draw and gdk_window_process_all_updates
3756 the gtk_widget_queue_draw and gdk_window_process_all_updates 3750 above. */
3757 above. */ 3751 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
3758 x_clear_area (FRAME_X_DISPLAY (f), 3752 oldx, oldy, oldw, oldh);
3759 FRAME_X_WINDOW (f),
3760 oldx, oldy, oldw, oldh, 0);
3761 }
3762 3753
3763 /* GTK does not redraw until the main loop is entered again, but 3754 /* GTK does not redraw until the main loop is entered again, but
3764 if there are no X events pending we will not enter it. So we sync 3755 if there are no X events pending we will not enter it. So we sync
diff --git a/src/xfns.c b/src/xfns.c
index 0c91e298ec8..48bf04dea13 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -1186,7 +1186,7 @@ x_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
1186 1186
1187 block_input (); 1187 block_input ();
1188 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 1188 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
1189 0, y, width, height, False); 1189 0, y, width, height);
1190 unblock_input (); 1190 unblock_input ();
1191 } 1191 }
1192 1192
@@ -1197,7 +1197,7 @@ x_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
1197 1197
1198 block_input (); 1198 block_input ();
1199 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 1199 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
1200 0, y, width, height, False); 1200 0, y, width, height);
1201 unblock_input (); 1201 unblock_input ();
1202 } 1202 }
1203 1203
@@ -1295,8 +1295,8 @@ x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
1295 if (height > 0 && width > 0) 1295 if (height > 0 && width > 0)
1296 { 1296 {
1297 block_input (); 1297 block_input ();
1298 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 1298 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
1299 0, y, width, height, False); 1299 0, y, width, height);
1300 unblock_input (); 1300 unblock_input ();
1301 } 1301 }
1302 1302
diff --git a/src/xterm.c b/src/xterm.c
index ef2a2bc8c8c..2ece8c40d2d 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -698,10 +698,10 @@ x_after_update_window_line (struct window *w, struct glyph_row *desired_row)
698 698
699 block_input (); 699 block_input ();
700 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 700 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
701 0, y, width, height, False); 701 0, y, width, height);
702 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 702 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
703 FRAME_PIXEL_WIDTH (f) - width, 703 FRAME_PIXEL_WIDTH (f) - width,
704 y, width, height, False); 704 y, width, height);
705 unblock_input (); 705 unblock_input ();
706 } 706 }
707} 707}
@@ -2968,10 +2968,10 @@ x_delete_glyphs (struct frame *f, register int n)
2968 If they are <= 0, this is probably an error. */ 2968 If they are <= 0, this is probably an error. */
2969 2969
2970void 2970void
2971x_clear_area (Display *dpy, Window window, int x, int y, int width, int height, int exposures) 2971x_clear_area (Display *dpy, Window window, int x, int y, int width, int height)
2972{ 2972{
2973 eassert (width > 0 && height > 0); 2973 eassert (width > 0 && height > 0);
2974 XClearArea (dpy, window, x, y, width, height, exposures); 2974 XClearArea (dpy, window, x, y, width, height, False);
2975} 2975}
2976 2976
2977 2977
@@ -4927,8 +4927,7 @@ x_scroll_bar_create (struct window *w, int top, int left, int width, int height)
4927 this case, no clear_frame is generated to reduce flickering. */ 4927 this case, no clear_frame is generated to reduce flickering. */
4928 if (width > 0 && height > 0) 4928 if (width > 0 && height > 0)
4929 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 4929 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
4930 left, top, width, 4930 left, top, width, window_box_height (w));
4931 window_box_height (w), False);
4932 4931
4933 window = XCreateWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 4932 window = XCreateWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
4934 /* Position and size of scroll bar. */ 4933 /* Position and size of scroll bar. */
@@ -5064,11 +5063,9 @@ x_scroll_bar_set_handle (struct scroll_bar *bar, int start, int end, int rebuild
5064 zero-height areas; that means "clear to end of window." */ 5063 zero-height areas; that means "clear to end of window." */
5065 if (start > 0) 5064 if (start > 0)
5066 x_clear_area (FRAME_X_DISPLAY (f), w, 5065 x_clear_area (FRAME_X_DISPLAY (f), w,
5067 /* x, y, width, height, and exposures. */
5068 VERTICAL_SCROLL_BAR_LEFT_BORDER, 5066 VERTICAL_SCROLL_BAR_LEFT_BORDER,
5069 VERTICAL_SCROLL_BAR_TOP_BORDER, 5067 VERTICAL_SCROLL_BAR_TOP_BORDER,
5070 inside_width, start, 5068 inside_width, start);
5071 False);
5072 5069
5073 /* Change to proper foreground color if one is specified. */ 5070 /* Change to proper foreground color if one is specified. */
5074 if (f->output_data.x->scroll_bar_foreground_pixel != -1) 5071 if (f->output_data.x->scroll_bar_foreground_pixel != -1)
@@ -5091,12 +5088,9 @@ x_scroll_bar_set_handle (struct scroll_bar *bar, int start, int end, int rebuild
5091 clear zero-height areas; that means "clear to end of window." */ 5088 clear zero-height areas; that means "clear to end of window." */
5092 if (end < inside_height) 5089 if (end < inside_height)
5093 x_clear_area (FRAME_X_DISPLAY (f), w, 5090 x_clear_area (FRAME_X_DISPLAY (f), w,
5094 /* x, y, width, height, and exposures. */
5095 VERTICAL_SCROLL_BAR_LEFT_BORDER, 5091 VERTICAL_SCROLL_BAR_LEFT_BORDER,
5096 VERTICAL_SCROLL_BAR_TOP_BORDER + end, 5092 VERTICAL_SCROLL_BAR_TOP_BORDER + end,
5097 inside_width, inside_height - end, 5093 inside_width, inside_height - end);
5098 False);
5099
5100 } 5094 }
5101 5095
5102 unblock_input (); 5096 unblock_input ();
@@ -5189,11 +5183,11 @@ XTset_vertical_scroll_bar (struct window *w, int portion, int whole, int positio
5189#ifdef USE_TOOLKIT_SCROLL_BARS 5183#ifdef USE_TOOLKIT_SCROLL_BARS
5190 if (fringe_extended_p) 5184 if (fringe_extended_p)
5191 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 5185 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
5192 sb_left, top, sb_width, height, False); 5186 sb_left, top, sb_width, height);
5193 else 5187 else
5194#endif 5188#endif
5195 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 5189 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
5196 left, top, width, height, False); 5190 left, top, width, height);
5197 unblock_input (); 5191 unblock_input ();
5198 } 5192 }
5199 5193
@@ -5228,10 +5222,10 @@ XTset_vertical_scroll_bar (struct window *w, int portion, int whole, int positio
5228 { 5222 {
5229 if (fringe_extended_p) 5223 if (fringe_extended_p)
5230 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 5224 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
5231 sb_left, top, sb_width, height, False); 5225 sb_left, top, sb_width, height);
5232 else 5226 else
5233 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 5227 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
5234 left, top, width, height, False); 5228 left, top, width, height);
5235 } 5229 }
5236#ifdef USE_GTK 5230#ifdef USE_GTK
5237 xg_update_scrollbar_pos (f, 5231 xg_update_scrollbar_pos (f,
@@ -5255,12 +5249,10 @@ XTset_vertical_scroll_bar (struct window *w, int portion, int whole, int positio
5255 if (VERTICAL_SCROLL_BAR_WIDTH_TRIM) 5249 if (VERTICAL_SCROLL_BAR_WIDTH_TRIM)
5256 { 5250 {
5257 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 5251 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
5258 left, top, VERTICAL_SCROLL_BAR_WIDTH_TRIM, 5252 left, top, VERTICAL_SCROLL_BAR_WIDTH_TRIM, height);
5259 height, False);
5260 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 5253 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
5261 left + width - VERTICAL_SCROLL_BAR_WIDTH_TRIM, 5254 left + width - VERTICAL_SCROLL_BAR_WIDTH_TRIM,
5262 top, VERTICAL_SCROLL_BAR_WIDTH_TRIM, 5255 top, VERTICAL_SCROLL_BAR_WIDTH_TRIM, height);
5263 height, False);
5264 } 5256 }
5265 5257
5266 /* Clear areas not covered by the scroll bar because it's not as 5258 /* Clear areas not covered by the scroll bar because it's not as
@@ -5274,11 +5266,10 @@ XTset_vertical_scroll_bar (struct window *w, int portion, int whole, int positio
5274 { 5266 {
5275 if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w)) 5267 if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w))
5276 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 5268 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
5277 left + area_width - rest, top, 5269 left + area_width - rest, top, rest, height);
5278 rest, height, False);
5279 else 5270 else
5280 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 5271 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
5281 left, top, rest, height, False); 5272 left, top, rest, height);
5282 } 5273 }
5283 } 5274 }
5284 5275
@@ -6122,11 +6113,10 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr,
6122 { 6113 {
6123#ifdef USE_GTK 6114#ifdef USE_GTK
6124 /* This seems to be needed for GTK 2.6. */ 6115 /* This seems to be needed for GTK 2.6. */
6125 x_clear_area (event.xexpose.display, 6116 x_clear_area (event.xexpose.display,
6126 event.xexpose.window, 6117 event.xexpose.window,
6127 event.xexpose.x, event.xexpose.y, 6118 event.xexpose.x, event.xexpose.y,
6128 event.xexpose.width, event.xexpose.height, 6119 event.xexpose.width, event.xexpose.height);
6129 FALSE);
6130#endif 6120#endif
6131 if (!FRAME_VISIBLE_P (f)) 6121 if (!FRAME_VISIBLE_P (f))
6132 { 6122 {
@@ -7349,8 +7339,7 @@ x_define_frame_cursor (struct frame *f, Cursor cursor)
7349static void 7339static void
7350x_clear_frame_area (struct frame *f, int x, int y, int width, int height) 7340x_clear_frame_area (struct frame *f, int x, int y, int width, int height)
7351{ 7341{
7352 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 7342 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), x, y, width, height);
7353 x, y, width, height, False);
7354#ifdef USE_GTK 7343#ifdef USE_GTK
7355 /* Must queue a redraw, because scroll bars might have been cleared. */ 7344 /* Must queue a redraw, because scroll bars might have been cleared. */
7356 if (FRAME_GTK_WIDGET (f)) 7345 if (FRAME_GTK_WIDGET (f))
diff --git a/src/xterm.h b/src/xterm.h
index 723550c57c4..26f6095d727 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -968,7 +968,7 @@ extern bool x_alloc_lighter_color_for_widget (Widget, Display *, Colormap,
968#endif 968#endif
969extern bool x_alloc_nearest_color (struct frame *, Colormap, XColor *); 969extern bool x_alloc_nearest_color (struct frame *, Colormap, XColor *);
970extern void x_query_color (struct frame *f, XColor *); 970extern void x_query_color (struct frame *f, XColor *);
971extern void x_clear_area (Display *, Window, int, int, int, int, int); 971extern void x_clear_area (Display *, Window, int, int, int, int);
972#if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK 972#if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK
973extern void x_mouse_leave (struct x_display_info *); 973extern void x_mouse_leave (struct x_display_info *);
974#endif 974#endif