-}
-\f
-/* Handle standout mode for terminals in which TN_standout_width >= 0.
- On these terminals, standout is controlled by markers that
- live inside the terminal's memory. TN_standout_width is the width
- that the marker occupies in memory. Standout runs from the marker
- to the end of the line on some terminals, or to the next
- turn-off-standout marker (TS_end_standout_mode) string
- on other terminals. */
-
-/* Write a standout marker or end-standout marker at the front of the line
- at vertical position vpos. */
-
-void
-write_standout_marker (flag, vpos)
- int flag, vpos;
-{
- if (flag || (TS_end_standout_mode && !TF_teleray && !se_is_so
- && !(TF_xs && TN_standout_width == 0)))
- {
- cmgoto (vpos, 0);
- cmplus (TN_standout_width);
- OUTPUT (flag ? TS_standout_mode : TS_end_standout_mode);
- chars_wasted[curY] = TN_standout_width | 0100;
- }
-}
-\f
-/* External interface to control of standout mode.
- Call this when about to modify line at position VPOS
- and not change whether it is highlighted. */
-
-void
-reassert_line_highlight (highlight, vpos)
- int highlight;
- int vpos;
-{
- struct frame *f = updating_frame ? updating_frame : XFRAME (selected_frame);
- if (! FRAME_TERMCAP_P (f))
- {
- (*reassert_line_highlight_hook) (highlight, vpos);
- return;
- }
- if (TN_standout_width < 0)
- /* Handle terminals where standout takes affect at output time */
- standout_requested = highlight;
- else if (chars_wasted && chars_wasted[vpos] == 0)
- /* For terminals with standout markers, write one on this line
- if there isn't one already. */
- write_standout_marker (highlight, vpos);
-}
-
-/* Call this when about to modify line at position VPOS
- and change whether it is highlighted. */
-
-void
-change_line_highlight (new_highlight, vpos, y, first_unused_hpos)
- int new_highlight, vpos, y, first_unused_hpos;
-{
- standout_requested = new_highlight;
- if (! FRAME_TERMCAP_P (updating_frame))
- {
- (*change_line_highlight_hook) (new_highlight, vpos, y, first_unused_hpos);
- return;
- }
-
- cursor_to (vpos, 0);
-
- if (TN_standout_width < 0)
- background_highlight ();
- /* If line starts with a marker, delete the marker */
- else if (TS_clr_line && chars_wasted[curY])
- {
- turn_off_insert ();
- /* On Teleray, make sure to erase the SO marker. */
- if (TF_teleray)
- {
- cmgoto (curY - 1, FRAME_WIDTH (XFRAME (selected_frame)) - 4);
- OUTPUT ("\033S");
- curY++; /* ESC S moves to next line where the TS_standout_mode was */
- curX = 0;
- }
- else
- cmgoto (curY, 0); /* reposition to kill standout marker */
- }
- clear_end_of_line_raw (first_unused_hpos);
- reassert_line_highlight (new_highlight, curY);