Deleted Added
full compact
teken_subr.h (186687) teken_subr.h (186729)
1/*-
2 * Copyright (c) 2008-2009 Ed Schouten <ed@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
1/*-
2 * Copyright (c) 2008-2009 Ed Schouten <ed@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $FreeBSD: head/sys/dev/syscons/teken/teken_subr.h 186687 2009-01-01 23:22:01Z ed $
26 * $FreeBSD: head/sys/dev/syscons/teken/teken_subr.h 186729 2009-01-03 22:51:54Z ed $
27 */
28
29static void teken_subr_cursor_up(teken_t *, unsigned int);
30static void teken_subr_erase_line(teken_t *, unsigned int);
31static void teken_subr_regular_character(teken_t *, teken_char_t);
32static void teken_subr_reset_to_initial_state(teken_t *);
33
34static inline int

--- 210 unchanged lines hidden (view full) ---

245 break;
246
247 t->t_cursor.tp_col--;
248
249 /* Tab marker set. */
250 if (teken_tab_isset(t, t->t_cursor.tp_col))
251 ntabs--;
252 } while (ntabs > 0);
27 */
28
29static void teken_subr_cursor_up(teken_t *, unsigned int);
30static void teken_subr_erase_line(teken_t *, unsigned int);
31static void teken_subr_regular_character(teken_t *, teken_char_t);
32static void teken_subr_reset_to_initial_state(teken_t *);
33
34static inline int

--- 210 unchanged lines hidden (view full) ---

245 break;
246
247 t->t_cursor.tp_col--;
248
249 /* Tab marker set. */
250 if (teken_tab_isset(t, t->t_cursor.tp_col))
251 ntabs--;
252 } while (ntabs > 0);
253
254 teken_funcs_cursor(t);
253}
254
255static void
256teken_subr_cursor_down(teken_t *t, unsigned int nrows)
257{
258
259 if (t->t_cursor.tp_row + nrows >= t->t_scrollreg.ts_end)
260 t->t_cursor.tp_row = t->t_scrollreg.ts_end - 1;

--- 25 unchanged lines hidden (view full) ---

286 break;
287
288 t->t_cursor.tp_col++;
289
290 /* Tab marker set. */
291 if (teken_tab_isset(t, t->t_cursor.tp_col))
292 ntabs--;
293 } while (ntabs > 0);
255}
256
257static void
258teken_subr_cursor_down(teken_t *t, unsigned int nrows)
259{
260
261 if (t->t_cursor.tp_row + nrows >= t->t_scrollreg.ts_end)
262 t->t_cursor.tp_row = t->t_scrollreg.ts_end - 1;

--- 25 unchanged lines hidden (view full) ---

288 break;
289
290 t->t_cursor.tp_col++;
291
292 /* Tab marker set. */
293 if (teken_tab_isset(t, t->t_cursor.tp_col))
294 ntabs--;
295 } while (ntabs > 0);
296
297 teken_funcs_cursor(t);
294}
295
296static void
297teken_subr_cursor_next_line(teken_t *t, unsigned int ncols)
298{
299
300 t->t_cursor.tp_col = 0;
301 teken_subr_cursor_down(t, ncols);

--- 220 unchanged lines hidden (view full) ---

522
523 t->t_stateflags &= ~TS_WRAPPED;
524 teken_funcs_cursor(t);
525}
526
527static void
528teken_subr_horizontal_tab(teken_t *t)
529{
298}
299
300static void
301teken_subr_cursor_next_line(teken_t *t, unsigned int ncols)
302{
303
304 t->t_cursor.tp_col = 0;
305 teken_subr_cursor_down(t, ncols);

--- 220 unchanged lines hidden (view full) ---

526
527 t->t_stateflags &= ~TS_WRAPPED;
528 teken_funcs_cursor(t);
529}
530
531static void
532teken_subr_horizontal_tab(teken_t *t)
533{
534#ifdef TEKEN_CONS25
535
536 teken_subr_cursor_forward_tabulation(t, 1);
537#else /* !TEKEN_CONS25 */
530 teken_rect_t tr;
531
532 tr.tr_begin = t->t_cursor;
533 teken_subr_cursor_forward_tabulation(t, 1);
534 tr.tr_end.tp_row = tr.tr_begin.tp_row + 1;
535 tr.tr_end.tp_col = t->t_cursor.tp_col;
536
537 /* Blank region that we skipped. */
538 if (tr.tr_end.tp_col > tr.tr_begin.tp_col)
539 teken_funcs_fill(t, &tr, BLANK, &t->t_curattr);
538 teken_rect_t tr;
539
540 tr.tr_begin = t->t_cursor;
541 teken_subr_cursor_forward_tabulation(t, 1);
542 tr.tr_end.tp_row = tr.tr_begin.tp_row + 1;
543 tr.tr_end.tp_col = t->t_cursor.tp_col;
544
545 /* Blank region that we skipped. */
546 if (tr.tr_end.tp_col > tr.tr_begin.tp_col)
547 teken_funcs_fill(t, &tr, BLANK, &t->t_curattr);
548#endif /* TEKEN_CONS25 */
540}
541
542static void
543teken_subr_horizontal_tab_set(teken_t *t)
544{
545
546 teken_tab_set(t, t->t_cursor.tp_col);
547}

--- 155 unchanged lines hidden (view full) ---

703{
704 int width;
705
706 /* XXX: Don't process zero-width characters yet. */
707 width = teken_wcwidth(c);
708 if (width <= 0)
709 return;
710
549}
550
551static void
552teken_subr_horizontal_tab_set(teken_t *t)
553{
554
555 teken_tab_set(t, t->t_cursor.tp_col);
556}

--- 155 unchanged lines hidden (view full) ---

712{
713 int width;
714
715 /* XXX: Don't process zero-width characters yet. */
716 width = teken_wcwidth(c);
717 if (width <= 0)
718 return;
719
720#ifdef TEKEN_CONS25
721 teken_subr_do_putchar(t, &t->t_cursor, c, width);
722 t->t_cursor.tp_col += width;
723
724 if (t->t_cursor.tp_col >= t->t_winsize.tp_col) {
725 if (t->t_cursor.tp_row == t->t_scrollreg.ts_end - 1) {
726 /* Perform scrolling. */
727 teken_subr_do_scroll(t, 1);
728 } else {
729 /* No scrolling needed. */
730 if (t->t_cursor.tp_row < t->t_winsize.tp_row - 1)
731 t->t_cursor.tp_row++;
732 }
733 t->t_cursor.tp_col = 0;
734 }
735#else /* !TEKEN_CONS25 */
711 if (t->t_cursor.tp_col == t->t_winsize.tp_col - 1 &&
712 (t->t_stateflags & (TS_WRAPPED|TS_AUTOWRAP)) ==
713 (TS_WRAPPED|TS_AUTOWRAP)) {
714 teken_pos_t tp;
715
716 /* Perform line wrapping. */
717
718 if (t->t_cursor.tp_row == t->t_scrollreg.ts_end - 1) {

--- 28 unchanged lines hidden (view full) ---

747
748 if (t->t_cursor.tp_col >= t->t_winsize.tp_col) {
749 t->t_stateflags |= TS_WRAPPED;
750 t->t_cursor.tp_col = t->t_winsize.tp_col - 1;
751 } else {
752 t->t_stateflags &= ~TS_WRAPPED;
753 }
754 }
736 if (t->t_cursor.tp_col == t->t_winsize.tp_col - 1 &&
737 (t->t_stateflags & (TS_WRAPPED|TS_AUTOWRAP)) ==
738 (TS_WRAPPED|TS_AUTOWRAP)) {
739 teken_pos_t tp;
740
741 /* Perform line wrapping. */
742
743 if (t->t_cursor.tp_row == t->t_scrollreg.ts_end - 1) {

--- 28 unchanged lines hidden (view full) ---

772
773 if (t->t_cursor.tp_col >= t->t_winsize.tp_col) {
774 t->t_stateflags |= TS_WRAPPED;
775 t->t_cursor.tp_col = t->t_winsize.tp_col - 1;
776 } else {
777 t->t_stateflags &= ~TS_WRAPPED;
778 }
779 }
780#endif /* TEKEN_CONS25 */
755
756 teken_funcs_cursor(t);
757}
758
759static void
760teken_subr_reset_dec_mode(teken_t *t, unsigned int cmd)
761{
762

--- 344 unchanged lines hidden ---
781
782 teken_funcs_cursor(t);
783}
784
785static void
786teken_subr_reset_dec_mode(teken_t *t, unsigned int cmd)
787{
788

--- 344 unchanged lines hidden ---