comparison src/xdisp.c @ 53612:2ddd2a0d047a

Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-41 Make fringe-drawing stuff compile without a window-system * src/xdisp.c (Voverflow_newline_into_fringe) (move_it_in_display_line_to, redisplay_internal) (update_window_fringes, redisplay_window, display_line, window): Add `#ifdef HAVE_WINDOW_SYSTEM' around fringe-drawing stuff, so that it compiles without a window-system. * src/dispnew.c (direct_output_for_insert, update_window): Likewise.
author Miles Bader <miles@gnu.org>
date Sat, 17 Jan 2004 03:31:26 +0000
parents 81b31a8c3313
children 3cc32cd9cf25 82c3b4da43ca
comparison
equal deleted inserted replaced
53611:6072da675015 53612:2ddd2a0d047a
1 /* Display generation from window structure and buffer text. 1 /* Display generation from window structure and buffer text.
2 Copyright (C) 1985,86,87,88,93,94,95,97,98,99,2000,01,02,03 2 Copyright (C) 1985,86,87,88,93,94,95,97,98,99,2000,01,02,03,04
3 Free Software Foundation, Inc. 3 Free Software Foundation, Inc.
4 4
5 This file is part of GNU Emacs. 5 This file is part of GNU Emacs.
6 6
7 GNU Emacs is free software; you can redistribute it and/or modify 7 GNU Emacs is free software; you can redistribute it and/or modify
308 308
309 /* Non-nil means highlight trailing whitespace. */ 309 /* Non-nil means highlight trailing whitespace. */
310 310
311 Lisp_Object Vshow_trailing_whitespace; 311 Lisp_Object Vshow_trailing_whitespace;
312 312
313 #ifdef HAVE_WINDOW_SYSTEM
313 /* Non-nil means that newline may flow into the right fringe. */ 314 /* Non-nil means that newline may flow into the right fringe. */
314 315
315 Lisp_Object Voverflow_newline_into_fringe; 316 Lisp_Object Voverflow_newline_into_fringe;
317 #endif /* HAVE_WINDOW_SYSTEM */
316 318
317 /* Test if overflow newline into fringe. Called with iterator IT 319 /* Test if overflow newline into fringe. Called with iterator IT
318 at or past right window margin, and with IT->current_x set. */ 320 at or past right window margin, and with IT->current_x set. */
319 321
320 #define IT_OVERFLOW_NEWLINE_INTO_FRINGE(it) \ 322 #define IT_OVERFLOW_NEWLINE_INTO_FRINGE(it) \
5607 ++it->hpos; 5609 ++it->hpos;
5608 it->current_x = new_x; 5610 it->current_x = new_x;
5609 if (i == it->nglyphs - 1) 5611 if (i == it->nglyphs - 1)
5610 { 5612 {
5611 set_iterator_to_next (it, 1); 5613 set_iterator_to_next (it, 1);
5614 #ifdef HAVE_WINDOW_SYSTEM
5612 if (IT_OVERFLOW_NEWLINE_INTO_FRINGE (it)) 5615 if (IT_OVERFLOW_NEWLINE_INTO_FRINGE (it))
5613 { 5616 {
5614 get_next_display_element (it); 5617 get_next_display_element (it);
5615 if (ITERATOR_AT_END_OF_LINE_P (it)) 5618 if (ITERATOR_AT_END_OF_LINE_P (it))
5616 { 5619 {
5617 result = MOVE_NEWLINE_OR_CR; 5620 result = MOVE_NEWLINE_OR_CR;
5618 break; 5621 break;
5619 } 5622 }
5620 } 5623 }
5624 #endif /* HAVE_WINDOW_SYSTEM */
5621 } 5625 }
5622 } 5626 }
5623 else 5627 else
5624 { 5628 {
5625 it->current_x = x; 5629 it->current_x = x;
5673 /* Stop if lines are truncated and IT's current x-position is 5677 /* Stop if lines are truncated and IT's current x-position is
5674 past the right edge of the window now. */ 5678 past the right edge of the window now. */
5675 if (it->truncate_lines_p 5679 if (it->truncate_lines_p
5676 && it->current_x >= it->last_visible_x) 5680 && it->current_x >= it->last_visible_x)
5677 { 5681 {
5682 #ifdef HAVE_WINDOW_SYSTEM
5678 if (IT_OVERFLOW_NEWLINE_INTO_FRINGE (it)) 5683 if (IT_OVERFLOW_NEWLINE_INTO_FRINGE (it))
5679 { 5684 {
5680 get_next_display_element (it); 5685 get_next_display_element (it);
5681 if (ITERATOR_AT_END_OF_LINE_P (it)) 5686 if (ITERATOR_AT_END_OF_LINE_P (it))
5682 { 5687 {
5683 result = MOVE_NEWLINE_OR_CR; 5688 result = MOVE_NEWLINE_OR_CR;
5684 break; 5689 break;
5685 } 5690 }
5686 } 5691 }
5692 #endif /* HAVE_WINDOW_SYSTEM */
5687 result = MOVE_LINE_TRUNCATED; 5693 result = MOVE_LINE_TRUNCATED;
5688 break; 5694 break;
5689 } 5695 }
5690 } 5696 }
5691 5697
10255 10261
10256 #if GLYPH_DEBUG 10262 #if GLYPH_DEBUG
10257 *w->desired_matrix->method = 0; 10263 *w->desired_matrix->method = 0;
10258 debug_method_add (w, "optimization 1"); 10264 debug_method_add (w, "optimization 1");
10259 #endif 10265 #endif
10266 #ifdef HAVE_WINDOW_SYSTEM
10260 update_window_fringes (w, 0); 10267 update_window_fringes (w, 0);
10268 #endif
10261 goto update; 10269 goto update;
10262 } 10270 }
10263 else 10271 else
10264 goto cancel; 10272 goto cancel;
10265 } 10273 }
11666 11674
11667 /* Indicate what this scroll bar ought to be displaying now. */ 11675 /* Indicate what this scroll bar ought to be displaying now. */
11668 set_vertical_scroll_bar_hook (w, end - start, whole, start); 11676 set_vertical_scroll_bar_hook (w, end - start, whole, start);
11669 } 11677 }
11670 11678
11679 #ifdef HAVE_WINDOW_SYSTEM
11671 11680
11672 /* Recalculate the bitmaps to show in the fringes of window W. 11681 /* Recalculate the bitmaps to show in the fringes of window W.
11673 If FORCE_P is 0, only mark rows with modified bitmaps for update in 11682 If FORCE_P is 0, only mark rows with modified bitmaps for update in
11674 redraw_fringe_bitmaps_p; else mark all rows for update. */ 11683 redraw_fringe_bitmaps_p; else mark all rows for update. */
11675 11684
11794 } 11803 }
11795 11804
11796 return redraw_p; 11805 return redraw_p;
11797 } 11806 }
11798 11807
11808 #endif /* HAVE_WINDOW_SYSTEM */
11799 11809
11800 /* Redisplay leaf window WINDOW. JUST_THIS_ONE_P non-zero means only 11810 /* Redisplay leaf window WINDOW. JUST_THIS_ONE_P non-zero means only
11801 selected_window is redisplayed. 11811 selected_window is redisplayed.
11802 11812
11803 We can return without actually redisplaying the window if 11813 We can return without actually redisplaying the window if
12482 if (redisplay_tool_bar_p) 12492 if (redisplay_tool_bar_p)
12483 redisplay_tool_bar (f); 12493 redisplay_tool_bar (f);
12484 #endif 12494 #endif
12485 } 12495 }
12486 12496
12497 #ifdef HAVE_WINDOW_SYSTEM
12487 if (update_window_fringes (w, 0) 12498 if (update_window_fringes (w, 0)
12488 && (used_current_matrix_p || overlay_arrow_seen) 12499 && (used_current_matrix_p || overlay_arrow_seen)
12489 && !w->pseudo_window_p) 12500 && !w->pseudo_window_p)
12490 { 12501 {
12491 update_begin (f); 12502 update_begin (f);
12492 BLOCK_INPUT; 12503 BLOCK_INPUT;
12493 draw_window_fringes (w); 12504 draw_window_fringes (w);
12494 UNBLOCK_INPUT; 12505 UNBLOCK_INPUT;
12495 update_end (f); 12506 update_end (f);
12496 } 12507 }
12508 #endif /* HAVE_WINDOW_SYSTEM */
12497 12509
12498 /* We go to this label, with fonts_changed_p nonzero, 12510 /* We go to this label, with fonts_changed_p nonzero,
12499 if it is necessary to try again using larger glyph matrices. 12511 if it is necessary to try again using larger glyph matrices.
12500 We have to redeem the scroll bar even in this case, 12512 We have to redeem the scroll bar even in this case,
12501 because the loop in redisplay_internal expects that. */ 12513 because the loop in redisplay_internal expects that. */
14931 it->continuation_lines_width += new_x; 14943 it->continuation_lines_width += new_x;
14932 ++it->hpos; 14944 ++it->hpos;
14933 if (i == nglyphs - 1) 14945 if (i == nglyphs - 1)
14934 { 14946 {
14935 set_iterator_to_next (it, 1); 14947 set_iterator_to_next (it, 1);
14948 #ifdef HAVE_WINDOW_SYSTEM
14936 if (IT_OVERFLOW_NEWLINE_INTO_FRINGE (it)) 14949 if (IT_OVERFLOW_NEWLINE_INTO_FRINGE (it))
14937 { 14950 {
14938 get_next_display_element (it); 14951 get_next_display_element (it);
14939 if (ITERATOR_AT_END_OF_LINE_P (it)) 14952 if (ITERATOR_AT_END_OF_LINE_P (it))
14940 { 14953 {
14941 row->continued_p = 0; 14954 row->continued_p = 0;
14942 row->exact_window_width_line_p = 1; 14955 row->exact_window_width_line_p = 1;
14943 } 14956 }
14944 } 14957 }
14958 #endif /* HAVE_WINDOW_SYSTEM */
14945 } 14959 }
14946 } 14960 }
14947 else if (CHAR_GLYPH_PADDING_P (*glyph) 14961 else if (CHAR_GLYPH_PADDING_P (*glyph)
14948 && !FRAME_WINDOW_P (it->f)) 14962 && !FRAME_WINDOW_P (it->f))
14949 { 14963 {
15052 { 15066 {
15053 int used_before = row->used[TEXT_AREA]; 15067 int used_before = row->used[TEXT_AREA];
15054 15068
15055 row->ends_in_newline_from_string_p = STRINGP (it->object); 15069 row->ends_in_newline_from_string_p = STRINGP (it->object);
15056 15070
15071 #ifdef HAVE_WINDOW_SYSTEM
15057 /* Add a space at the end of the line that is used to 15072 /* Add a space at the end of the line that is used to
15058 display the cursor there. */ 15073 display the cursor there. */
15059 if (!IT_OVERFLOW_NEWLINE_INTO_FRINGE (it)) 15074 if (!IT_OVERFLOW_NEWLINE_INTO_FRINGE (it))
15060 append_space (it, 0); 15075 append_space (it, 0);
15076 #endif /* HAVE_WINDOW_SYSTEM */
15061 15077
15062 /* Extend the face to the end of the line. */ 15078 /* Extend the face to the end of the line. */
15063 extend_face_to_end_of_line (it); 15079 extend_face_to_end_of_line (it);
15064 15080
15065 /* Make sure we have the position. */ 15081 /* Make sure we have the position. */
15096 { 15112 {
15097 row->used[TEXT_AREA] = i; 15113 row->used[TEXT_AREA] = i;
15098 produce_special_glyphs (it, IT_TRUNCATION); 15114 produce_special_glyphs (it, IT_TRUNCATION);
15099 } 15115 }
15100 } 15116 }
15117 #ifdef HAVE_WINDOW_SYSTEM
15101 else 15118 else
15102 { 15119 {
15103 /* Don't truncate if we can overflow newline into fringe. */ 15120 /* Don't truncate if we can overflow newline into fringe. */
15104 if (IT_OVERFLOW_NEWLINE_INTO_FRINGE (it)) 15121 if (IT_OVERFLOW_NEWLINE_INTO_FRINGE (it))
15105 { 15122 {
15109 row->exact_window_width_line_p = 1; 15126 row->exact_window_width_line_p = 1;
15110 goto at_end_of_line; 15127 goto at_end_of_line;
15111 } 15128 }
15112 } 15129 }
15113 } 15130 }
15131 #endif /* HAVE_WINDOW_SYSTEM */
15114 15132
15115 row->truncated_on_right_p = 1; 15133 row->truncated_on_right_p = 1;
15116 it->continuation_lines_width = 0; 15134 it->continuation_lines_width = 0;
15117 reseat_at_next_visible_line_start (it, 0); 15135 reseat_at_next_visible_line_start (it, 0);
15118 row->ends_at_zv_p = FETCH_BYTE (IT_BYTEPOS (*it) - 1) != '\n'; 15136 row->ends_at_zv_p = FETCH_BYTE (IT_BYTEPOS (*it) - 1) != '\n';
21995 DEFVAR_LISP ("show-trailing-whitespace", &Vshow_trailing_whitespace, 22013 DEFVAR_LISP ("show-trailing-whitespace", &Vshow_trailing_whitespace,
21996 doc: /* *Non-nil means highlight trailing whitespace. 22014 doc: /* *Non-nil means highlight trailing whitespace.
21997 The face used for trailing whitespace is `trailing-whitespace'. */); 22015 The face used for trailing whitespace is `trailing-whitespace'. */);
21998 Vshow_trailing_whitespace = Qnil; 22016 Vshow_trailing_whitespace = Qnil;
21999 22017
22018 #ifdef HAVE_WINDOW_SYSTEM
22000 DEFVAR_LISP ("overflow-newline-into-fringe", &Voverflow_newline_into_fringe, 22019 DEFVAR_LISP ("overflow-newline-into-fringe", &Voverflow_newline_into_fringe,
22001 doc: /* *Non-nil means that newline may flow into the right fringe. 22020 doc: /* *Non-nil means that newline may flow into the right fringe.
22002 This means that display lines which are exactly as wide as the window 22021 This means that display lines which are exactly as wide as the window
22003 (not counting the final newline) will only occupy one screen line, by 22022 (not counting the final newline) will only occupy one screen line, by
22004 showing (or hiding) the final newline in the right fringe; when point 22023 showing (or hiding) the final newline in the right fringe; when point
22005 is at the final newline, the cursor is shown in the right fringe. 22024 is at the final newline, the cursor is shown in the right fringe.
22006 If nil, also continue lines which are exactly as wide as the window. */); 22025 If nil, also continue lines which are exactly as wide as the window. */);
22007 Voverflow_newline_into_fringe = Qt; 22026 Voverflow_newline_into_fringe = Qt;
22027 #endif
22008 22028
22009 DEFVAR_LISP ("void-text-area-pointer", &Vvoid_text_area_pointer, 22029 DEFVAR_LISP ("void-text-area-pointer", &Vvoid_text_area_pointer,
22010 doc: /* *The pointer shape to show in void text areas. 22030 doc: /* *The pointer shape to show in void text areas.
22011 Nil means to show the text pointer. Other options are `arrow', `text', 22031 Nil means to show the text pointer. Other options are `arrow', `text',
22012 `hand', `vdrag', `hdrag', `modeline', and `hourglass'. */); 22032 `hand', `vdrag', `hdrag', `modeline', and `hourglass'. */);