コード例 #1
0
ファイル: vt520.c プロジェクト: hharte/vttest
/*
 * VT500 & up
 *
 * Test if terminal can control whether the screen is cleared when changing
 * DECCOLM.
 */
static int
tst_DECNCSM(MENU_ARGS)
{
  int last = max_lines - 4;
  char temp[80];

  decaln();
  deccolm(FALSE);
  vt_move(last, 1);
  ruler(last, min_cols);
  vt_clear(0);
  sprintf(temp, "Screen should be cleared (%d-columns)", min_cols);
  println(temp);
  holdit();

  decaln();
  deccolm(TRUE);
  vt_move(last, 1);
  ruler(last, max_cols);
  vt_clear(0);
  sprintf(temp, "Screen should be cleared (%d-columns)", max_cols);
  println(temp);
  holdit();

  decncsm(TRUE);

  decaln();
  deccolm(FALSE);
  vt_move(last, 1);
  ruler(last, min_cols);
  vt_clear(0);
  sprintf(temp, "Screen should be filled (%d-columns)", min_cols);
  println(temp);
  holdit();

  decaln();
  deccolm(TRUE);
  vt_move(last, 1);
  ruler(last, max_cols);
  vt_clear(0);
  sprintf(temp, "Screen should be filled (%d of %d-columns)", min_cols, max_cols);
  println(temp);
  holdit();

  decncsm(FALSE);
  deccolm(FALSE);
  vt_move(last, 1);
  ruler(last, min_cols);
  vt_clear(0);
  sprintf(temp, "Screen should be cleared (%d-columns)", min_cols);
  println(temp);

  return MENU_HOLD;
}
コード例 #2
0
ファイル: vt220.c プロジェクト: RyanHope/wTerm
int
tst_vt220(MENU_ARGS)
{
  /* *INDENT-OFF* */
  static MENU my_menu[] = {
      { "Exit",                                              0 },
      { "Test reporting functions",                          tst_vt220_reports },
      { "Test screen-display functions",                     tst_vt220_screen },
      { "Test 8-bit controls (S7C1T/S8C1T)",                 tst_S8C1T },
      { "Test Printer (MC)",                                 tst_printing },
      { "Test Soft Character Sets (DECDLD)",                 tst_softchars },
      { "Test Soft Terminal Reset (DECSTR)",                 tst_DECSTR },
      { "Test User-Defined Keys (DECUDK)",                   tst_DECUDK },
      { "",                                                  0 }
    };
  /* *INDENT-ON* */

    do {
        vt_clear(2);
        title(0);
        printf("VT220 Tests");
        title(2);
        println("Choose test type:");
    } while (menu(my_menu));
    return MENU_NOHOLD;
}
コード例 #3
0
ファイル: sixel.c プロジェクト: hharte/vttest
static int
tst_display(MENU_ARGS)
{
  int d, c = -1;

  vt_move(1, 1);
  display_head(stdout);
  println("");
  println("Press any key to display its soft-character.  Repeat a key to quit.");

  set_tty_raw(TRUE);
  set_tty_echo(FALSE);

  do {
    d = c;
    c = inchar();
    vt_move(6, 1);
    vt_clear(0);
    if (display_char(stdout, c)) {
      println("");
      printf("Render: %cN%c", ESC, c);  /* use SS2 to invoke G2 into GL */
    }
  } while (c != d);

  restore_ttymodes();
  return MENU_NOHOLD;
}
コード例 #4
0
ファイル: main.c プロジェクト: hharte/vttest
void
bye(void)
{
  /* Force my personal prejudices upon the poor luser   */
  if (LOG_ENABLED)
    fprintf(log_fp, "Cleanup & exit\n");

  default_level();  /* Enter ANSI mode (if in VT52 mode)    */
  decckm(FALSE);  /* cursor keys normal   */
  deccolm(FALSE);   /* 80 col mode          */
  decscnm(FALSE);   /* Normal screen        */
  decom(FALSE); /* Absolute origin mode */
  decawm(TRUE); /* Wrap around on       */
  decarm(TRUE); /* Auto repeat on       */
  decstbm(0, 0);  /* No scroll region     */
  sgr("0");     /* Normal character attributes  */

  /* Say goodbye */

  vt_clear(2);
  vt_move(12, 30);
  printf("That's all, folks!\n");
  printf("\n\n\n");
  inflush();
  close_tty();
  exit(EXIT_SUCCESS);
}
コード例 #5
0
ファイル: vt520.c プロジェクト: Brybry/wTerm
static int
tst_VT520_DECRQSS(MENU_ARGS)
{
  /* *INDENT-OFF* */
  static MENU my_menu[] = {
      { "Exit",                                              0 },
      { "Test VT420 features (DECRQSS)",                     tst_vt420_DECRQSS },
      { "Test Hardware-oriented features",                   tst_VT520_hardware_DECRQSS },
      { "Alternate Text Color (DECATR)",                     rpt_DECATR },
      { "Assign Color (DECAC)",                              rpt_DECAC },
      { "Select Auto Repeat Rate (DECARR)",                  rpt_DECARR },
      { "Select Color Lookup Table (DECSTGLT)",              rpt_DECSTGLT },
      { "Select Zero Symbol (DECSZS)",                       rpt_DECSZS },
      { "Set Cursor Style (DECSCUSR)",                       rpt_DECSCUSR },
      { "Set Key Click Volume (DECSKCV)",                    rpt_DECSKCV },
      { "Set Lock Key Style (DECSLCK)",                      rpt_DECSLCK },
      { "Set Margin Bell Volume (DECSMBV)",                  rpt_DECSMBV },
      { "Set Warning Bell Volume (DECSWBV)",                 rpt_DECSWBV },
      { "Terminal Mode Emulation (DECTME)",                  rpt_DECTME },
      { "",                                                  0 }
    };
  /* *INDENT-ON* */

  do {
    vt_clear(2);
    __(title(0), printf("VT520 Status-Strings Reports"));
    __(title(2), println("Choose test type:"));
  } while (menu(my_menu));
  return MENU_NOHOLD;
}
コード例 #6
0
ファイル: color.c プロジェクト: Brybry/wTerm
/*
 * For terminals that support ANSI/ISO colors, work through a graduated
 * set of tests that first display colors (if the terminal does indeed
 * support them), then exercise the associated reset, clear operations.
 */
int
tst_colors(MENU_ARGS)
{
  static char txt_override_color[80];
  /* *INDENT-OFF* */
  static MENU colormenu[] = {
    { "Exit",                                                0 },
    { txt_override_color,                                    toggle_color_mode, },
    { "Display color test-pattern",                          show_test_pattern, },
    { "Test SGR-0 color reset",                              test_SGR_0, },
    { "Test BCE-style clear line/display (ED, EL)",          simple_bce_test, },
    { "Test BCE-style clear line/display (ECH, Indexing)",   fancy_bce_test, },
    { "Test of VT102-style features with BCE (Insert/Delete Char/Line)", test_color_insdel, },
    { "Test of screen features with BCE",                    test_color_screen, },
    { "Test of screen features with ISO 6429 SGR 22-27 codes", test_iso_6429_sgr, },
    { "", 0 }
  };
  /* *INDENT-ON* */

  do {
    vt_clear(2);
    sprintf(txt_override_color, "%sable color-switching",
            do_colors ? "Dis" : "En");
    __(title(0), println("ISO 6429 colors"));
    __(title(2), println("Choose test type:"));
  } while (menu(colormenu));
  return MENU_NOHOLD;
}
コード例 #7
0
ファイル: sixel.c プロジェクト: hharte/vttest
int
tst_softchars(MENU_ARGS)
{
  /* *INDENT-OFF* */
  static MENU my_menu[] = {
      { "Exit",                                              0 },
      { "Download the soft characters (DECDLD)",             tst_DECDLD },
      { "Examine the soft characters",                       tst_display },
      { "Clear the soft characters",                         tst_cleanup },
      { "",                                                  0 }
    };
  /* *INDENT-ON* */

  vt_move(1, 1);
  if (font_string == 0 || *font_string == 0) {
    printf("You did not specify a font-file with the -f option\n");
    return MENU_HOLD;
  }
  do {
    vt_clear(2);
    __(title(0), printf("Soft Character Sets"));
    __(title(2), println("Choose test type:"));
  } while (menu(my_menu));
  return MENU_NOHOLD;
}
コード例 #8
0
ファイル: vt220.c プロジェクト: RyanHope/wTerm
/*
 * VT200 and up
 *
 * Test to ensure that 'ech' (erase character) is honored, with no parameter,
 * explicit parameter, and longer than the screen width (to ensure that the
 * terminal doesn't try to wrap-around the erasure).
 */
static int
tst_ECH(MENU_ARGS)
{
    int i;
    int last = max_lines - 4;

    decaln();
    for (i = 1; i <= max_lines; i++) {
        cup(i, min_cols - i - 2);
        do_csi("X");  /* make sure default-parameter works */
        cup(i, min_cols - i - 1);
        printf("*");
        ech(min_cols);
        printf("*");  /* this should be adjacent, in the upper-right corner */
    }

    vt_move(last, 1);
    vt_clear(0);

    vt_move(last, min_cols - (last + 10));
    println("diagonal: ^^ (clear)");
    println("ECH test: there should be E's with a gap before diagonal of **'s");
    println("The lower-right diagonal region should be cleared.  Nothing else.");
    return MENU_HOLD;
}
コード例 #9
0
ファイル: vt520.c プロジェクト: Brybry/wTerm
/*
 * This list is separated from the main one, to keep the menu size fitting on
 * a 24x80 screen.
 */
static int
tst_VT520_hardware_DECRQSS(MENU_ARGS)
{
  /* *INDENT-OFF* */
  static MENU my_menu[] = {
      { "Exit",                                              0 },
      { "Test VT420 features (DECRQSS)",                     tst_vt420_DECRQSS },
      { "CRT Saver Timing (DECCRTST)",                       rpt_DECCRTST },
      { "Down Line Load Allocation (DECDLDA)",               rpt_DECDLDA },
      { "Energy Save Timing (DECSEST)",                      rpt_DECSEST },
      { "Select Communication Port (DECSCP)",                rpt_DECSCP },
      { "Select Communication Speed (DECSCS)",               rpt_DECSCS },
      { "Select Digital Printed Data Type (DECSDPT)",        rpt_DECSDPT },
      { "Select Disconnect Delay Time (DECSDDT)",            rpt_DECSDDT },
      { "Select Flow Control Type (DECSFC)",                 rpt_DECSFC },
      { "Select Printer Type (DECSPRTT)",                    rpt_DECSPRTT },
      { "Select ProPrinter Character Set (DECSPPCS)",        rpt_DECSPPCS },
      { "Select Set-Up Language (DECSSL)",                   rpt_DECSSL },
      { "Session Page Memory Allocation (DECSPMA)",          rpt_DECSPMA },
      { "Set Port Parameter (DECSPP)",                       rpt_DECSPP },
      { "Set Scroll Speed (DECSSCLS)",                       rpt_DECSSCLS },
      { "Set Transmit Rate Limit (DECSTRL)",                 rpt_DECSTRL },
      { "",                                                  0 }
    };
  /* *INDENT-ON* */

  do {
    vt_clear(2);
    __(title(0), printf("VT520 Status-Strings Reports (Hardware-oriented)"));
    __(title(2), println("Choose test type:"));
  } while (menu(my_menu));
  return MENU_NOHOLD;
}
コード例 #10
0
ファイル: httrack.c プロジェクト: AnadoluPanteri/httrack
static int __cdecl htsshow_start(t_hts_callbackarg *carg, httrackp* opt) {
	use_show = 0;
	if (opt->verbosedisplay == 2) {
		use_show = 1;
		vt_clear();
	}
	return 1;
}
コード例 #11
0
ファイル: main.c プロジェクト: MightyPork/avr-projects
void main()
{
	uart_init(9600);
	vt_init();

	sonar_t so;
	sonar_t so2;

	sonar_init(&so, A0, A1);
	sonar_init(&so2, A2, A3);

	sei();

	// end
	int16_t res;
	while(1) {
		vt_clear();
		vt_home();
		uart_puts_pgm(PSTR("SONAR\r\n==================="));

		// first
		vt_goto(99, 99); // move cursor away
		sonar_start(&so);
		while(sonar_busy());
		res = sonar_result();

		// print value
		vt_goto(0, 2);
		uart_puts_pgm(PSTR("A: "));

		if (res < 0) {
			uart_puts_pgm(PSTR("No Obstacle"));
		} else {
			uart_puti(res, 1);
			uart_puts_pgm(PSTR(" cm"));
		}

		// second
		vt_goto(99, 99); // move cursor away
		sonar_start(&so2);
		while(sonar_busy());
		res = sonar_result();

		// print value
		vt_goto(0, 3);
		uart_puts_pgm(PSTR("B: "));

		if (res < 0) {
			uart_puts_pgm(PSTR("No Obstacle"));
		} else {
			uart_puti(res, 1);
			uart_puts_pgm(PSTR(" cm"));
		}

		vt_goto(99, 99); // move cursor away
		_delay_ms(200);
	}
}
コード例 #12
0
ファイル: vt520.c プロジェクト: Brybry/wTerm
static int
rpt_DECSCUSR(MENU_ARGS)
{
  size_t n;

  vt_move(1, 1);
  for (n = 0; n < TABLESIZE(tbl_decscusr); ++n) {
    if (n != 0)
      holdit();
    vt_clear(2);
    decscusr(tbl_decscusr[n].code);
    (void) any_decrqss(tbl_decscusr[n].text, " q");
  }
  return MENU_HOLD;
}
コード例 #13
0
ファイル: setup.c プロジェクト: akat1/impala
/*
 * This changes the CSI code to/from an escape sequence.
 */
static int
toggle_8bit_out(MENU_ARGS)
{
  int old = output_8bits;

  fflush(stdout);
  output_8bits = !output_8bits;
  if (!check_8bit_toggle()) {
    output_8bits = old;
    vt_clear(2);
    vt_move(1,1);
    println("Sorry, this terminal does not support 8-bit output controls");
    return MENU_HOLD;
  }
  return MENU_NOHOLD;
}
コード例 #14
0
ファイル: vt520.c プロジェクト: hharte/vttest
static int
rpt_DECSCUSR(MENU_ARGS)
{
  size_t n;

  vt_move(1, 1);
  for (n = 0; n < TABLESIZE(tbl_decscusr); ++n) {
    char expected[10];
    if (n != 0)
      holdit();
    vt_clear(2);
    decscusr(tbl_decscusr[n].code);
    sprintf(expected, "%d", tbl_decscusr[n].code ? tbl_decscusr[n].code : 1);
    (void) any_decrqss2(tbl_decscusr[n].text, " q", expected);
  }
  return MENU_HOLD;
}
コード例 #15
0
ファイル: vt520.c プロジェクト: Brybry/wTerm
static int
tst_vt520_screen(MENU_ARGS)
{
  /* *INDENT-OFF* */
  static MENU my_menu[] = {
      { "Exit",                                              0 },
      { "Test Set Cursor Style (DECSCUSR)",                  tst_DECSCUSR },
      { "",                                                  0 }
    };
  /* *INDENT-ON* */

  do {
    vt_clear(2);
    __(title(0), printf("VT520 Screen-Display Tests"));
    __(title(2), println("Choose test type:"));
  } while (menu(my_menu));
  return MENU_NOHOLD;
}
コード例 #16
0
ファイル: vt220.c プロジェクト: RyanHope/wTerm
int
tst_vt220_reports(MENU_ARGS)
{
  /* *INDENT-OFF* */
  static MENU my_menu[] = {
      { "Exit",                                              0 },
      { "Test Device Status Report (DSR)",                   tst_vt220_device_status },
      { "",                                                  0 }
    };
  /* *INDENT-ON* */

    do {
        vt_clear(2);
        __(title(0), printf("VT220 Reports"));
        __(title(2), println("Choose test type:"));
    } while (menu(my_menu));
    return MENU_NOHOLD;
}
コード例 #17
0
ファイル: main.c プロジェクト: hharte/vttest
int
tst_bugs(MENU_ARGS)
{
  int i;
  /* *INDENT-OFF* */
  static MENU menutable[] = {
    { "Exit to main menu",                                   0 },
    { "Bug A: Smooth scroll to jump scroll",                 bug_a },
    { "Bug B: Scrolling region",                             bug_b },
    { "Bug C: Wide to narrow screen",                        bug_c },
    { "Bug D: Narrow to wide screen",                        bug_d },
    { "Bug E: Cursor move from double- to single-wide line", bug_e },
    { "Bug F: Column mode escape sequence",                  bug_f },
    { "Wrap around with cursor addressing",                  bug_w },
    { "Erase right half of double width lines",              bug_l },
    { "Funny scroll regions",                                bug_s },
    /* Add more here */
    { "",                                                    0 }
  };
  /* *INDENT-ON* */

  static const char *hmsg[] =
  {
    "Test of known bugs in the DEC VT100 series. The numbering of some of",
    "the bugs (A-F) refers to the article 'VT100 MAGIC' by Sami Tabih in",
    "the 'Proceedings of the DEC Users Society' at St. Louis, Missouri, May",
    "1983. To understand some of the tests, you have to look at the source",
    "code or the article. Of course, a good VT100-compatible terminal",
    "should not have these bugs (or have some means of disabling them)! If",
    "a bug appears, you might want to RESET the terminal before continuing",
    "the test. There is a test of the RESET function in the main menu.",
    ""};

  do {
    vt_clear(2);
    vt_move(1, 1);
    for (i = 0; *hmsg[i]; i++)
      println(hmsg[i]);
    println("");
    println("          Choose bug test number:");
  } while (menu2(menutable, i + 1));
  return MENU_NOHOLD;
}
コード例 #18
0
ファイル: xterm.c プロジェクト: akat1/impala
/*
 * Xterm implements an alternate screen, which is used to save the command-line
 * screen to restore it after running a full-screen application.
 *
 * The original scheme used separate save/restore-cursor and clear-screen
 * operations in conjunction with a toggle to/from the alternate screen
 * (private setmode 47).  Since not all users want the feature, xterm also
 * implements the titeInhibit resource to make it populate the $TERMCAP
 * variable without the ti/te (smcup/rmcup) strings which hold those sequences.
 * The limitation of titeInhibit is that it cannot work for terminfo, because
 * that information is read from a file rather than the environment.  I
 * implemented a corresponding set of strings for private setmode 1047 and 1048
 * to model the termcap behavior in terminfo.
 *
 * The behavior of the save/restore cursor operations still proved
 * unsatisfactory since users would (even in the original private setmode 47)
 * occasionally run shell programs from within their full-screen application
 * which would do a save-cursor to a different location, causing the final
 * restore-cursor to place the cursor in an unexpected location.  The private
 * setmode 1049 works around this by using a separate memory location to store
 * its version of the cursor location.
 */
static int
tst_altscrn(MENU_ARGS)
{
    static MENU my_menu[] = {
        { "Exit",                                                0 },
        { "Switch to/from alternate screen (xterm)",             test_altscrn_47 },
        { "Improved alternate screen (XFree86 xterm mode 1047)", test_altscrn_1047 },
        { "Better alternate screen (XFree86 xterm mode 1049)",   test_altscrn_1049 },
        { "",                                                    0 }
    };

    do {
        vt_clear(2);
        title(0);
        println("XTERM Alternate-Screen features");
        title(2);
        println("Choose test type:");
    } while (menu(my_menu));
    return MENU_NOHOLD;
}
コード例 #19
0
ファイル: reset.c プロジェクト: Brybry/wTerm
int
tst_rst(MENU_ARGS)
{
  static MENU my_menu[] = {
      { "Exit",                                              0 },
      { "Reset to Initial State (RIS)",                      tst_RIS },
      { "Invoke Terminal Test (DECTST)",                     tst_DECTST },
      { "Soft Terminal Reset (DECSTR)",                      tst_DECSTR },
      { "",                                                  0 }
    };

  did_reset = FALSE;

  do {
    vt_clear(2);
    title(0); printf("%s", the_title);
    title(2); println("Choose test type:");
  } while (menu(my_menu));
  return MENU_NOHOLD;
}
コード例 #20
0
ファイル: vt520.c プロジェクト: hharte/vttest
static int
tst_vt520_cursor(MENU_ARGS)
{
  /* *INDENT-OFF* */
  static MENU my_menu[] = {
      { "Exit",                                              0 },
      { "Test VT420 features",                               tst_vt420_cursor },
      { origin_mode_mesg,                                    toggle_DECOM },
      { lrmm_mesg,                                           toggle_LRMM },
      { tb_marg_mesg,                                        toggle_STBM },
      { lr_marg_mesg,                                        toggle_SLRM },
      { txt_override_color,                                  toggle_color_mode, },
      { "Test Character-Position-Absolute (HPA)",            tst_HPA },
      { "Test Cursor-Back-Tab (CBT)",                        tst_CBT },
      { "Test Cursor-Character-Absolute (CHA)",              tst_CHA },
      { "Test Cursor-Horizontal-Index (CHT)",                tst_CHT },
      { "Test Horizontal-Position-Relative (HPR)",           tst_HPR },
      { "Test Line-Position-Absolute (VPA)",                 tst_VPA },
      { "Test Next-Line (CNL)",                              tst_CNL },
      { "Test Previous-Line (CPL)",                          tst_CPL },
      { "Test Vertical-Position-Relative (VPR)",             tst_VPR },
      { "",                                                  0 }
    };
  /* *INDENT-ON* */

  setup_vt420_cursor(PASS_ARGS);

  do {
    vt_clear(2);
    __(title(0), printf("VT520 Cursor-Movement"));
    __(title(2), println("Choose test type:"));
    menus_vt420_cursor();
  } while (menu(my_menu));

  finish_vt420_cursor(PASS_ARGS);

  return MENU_NOHOLD;
}
コード例 #21
0
ファイル: xterm.c プロジェクト: akat1/impala
/*
 * xterm (and derived programs such as hpterm, dtterm, rxvt) are the most
 * widely used vt100 near-compatible terminal emulators (other than modem
 * programs).  dtterm emulates a vt220, as does XFree86 xterm.  DECterm
 * emulates a vt320.
 */
int
tst_xterm(MENU_ARGS)
{
    static MENU my_menu[] = {
        { "Exit",                                                0 },
        { "Set window title",                                    test_window_name },
        { "Mouse features",                                      tst_mouse },
        { "Tektronix 4014 features",                             tst_tek4014 },
        { "Alternate-Screen features (xterm)",                   tst_altscrn },
        { "Window modify-operations (dtterm)",                   test_modify_ops },
        { "Window report-operations (dtterm)",                   test_report_ops },
        { "",                                                    0 }
    };

    do {
        vt_clear(2);
        title(0);
        println("XTERM special features");
        title(2);
        println("Choose test type:");
    } while (menu(my_menu));
    return MENU_NOHOLD;
}
コード例 #22
0
ファイル: vt220.c プロジェクト: RyanHope/wTerm
int
tst_vt220_screen(MENU_ARGS)
{
  /* *INDENT-OFF* */
  static MENU my_menu[] = {
      { "Exit",                                              0 },
      { "Test Send/Receive mode (SRM)",                      tst_SRM },
      { "Test Visible/Invisible Cursor (DECTCEM)",           tst_DECTCEM },
      { "Test Erase Char (ECH)",                             tst_ECH },
      { "Test Protected-Areas (DECSCA)",                     tst_DECSCA },
      { "",                                                  0 }
    };
  /* *INDENT-ON* */

    do {
        vt_clear(2);
        title(0);
        printf("VT220 Screen-Display Tests");
        title(2);
        println("Choose test type:");
    } while (menu(my_menu));
    return MENU_NOHOLD;
}
コード例 #23
0
ファイル: vt520.c プロジェクト: Brybry/wTerm
static int
tst_VT520_report_presentation(MENU_ARGS)
{
  /* *INDENT-OFF* */
  static MENU my_menu[] = {
      { "Exit",                                              0 },
      { "Test VT420 features",                               tst_vt420_report_presentation },
      { "Request Mode (DECRQM)/Report Mode (DECRPM)",        tst_DECRPM },
      { "Status-String Report (DECRQSS)",                    tst_VT520_DECRQSS },
      { "",                                                  0 }
    };
  /* *INDENT-ON* */

  int old_DECRPM = set_DECRPM(5);

  do {
    vt_clear(2);
    __(title(0), printf("VT520 Presentation State Reports"));
    __(title(2), println("Choose test type:"));
  } while (menu(my_menu));
  set_DECRPM(old_DECRPM);
  return MENU_NOHOLD;
}
コード例 #24
0
ファイル: vt520.c プロジェクト: Brybry/wTerm
/*
 * These apply only to VT500's & above.
 */
int
tst_vt520(MENU_ARGS)
{
  /* *INDENT-OFF* */
  static MENU my_menu[] = {
      { "Exit",                                              0 },
      { "Test VT420 features",                               tst_vt420 },
      { "Test cursor-movement",                              not_impl },
      { "Test editing sequences",                            not_impl },
      { "Test keyboard-control",                             not_impl },
      { "Test reporting functions",                          tst_vt520_reports },
      { "Test screen-display functions",                     tst_vt520_screen },
      { "",                                                  0 }
    };
  /* *INDENT-ON* */

  do {
    vt_clear(2);
    __(title(0), printf("VT520 Tests"));
    __(title(2), println("Choose test type:"));
  } while (menu(my_menu));
  return MENU_NOHOLD;
}
コード例 #25
0
ファイル: vt220.c プロジェクト: RyanHope/wTerm
int
tst_vt220_device_status(MENU_ARGS)
{
  /* *INDENT-OFF* */
  static MENU my_menu[] = {
      { "Exit",                                              0 },
      { "Test Keyboard Status",                              tst_DSR_keyboard },
      { "Test Operating Status",                             tst_DSR_operating_status },
      { "Test Printer Status",                               tst_DSR_printer },
      { "Test UDK Status",                                   tst_DSR_userkeys },
      { "",                                                  0 }
    };
  /* *INDENT-ON* */

    do {
        vt_clear(2);
        title(0);
        printf("VT220 Device Status Reports");
        title(2);
        println("Choose test type:");
    } while (menu(my_menu));
    return MENU_NOHOLD;
}
コード例 #26
0
ファイル: vt320.c プロジェクト: hharte/vttest
int
tst_vt320_device_status(MENU_ARGS)
{
  /* *INDENT-OFF* */
  static MENU my_menu[] = {
      { "Exit",                                              0 },
      { "Test VT220 features",                               tst_vt220_device_status },
      { "Test Keyboard Status",                              tst_DSR_keyboard },
      { "Test Printer Status",                               tst_DSR_printer },
      { "Test UDK Status",                                   tst_DSR_userkeys },
      { "Test Locator Status",                               tst_DSR_locator },
      { "Test Extended Cursor-Position (DECXCPR)",           tst_DSR_cursor },
      { "",                                                  0 }
    };
  /* *INDENT-ON* */

  do {
    vt_clear(2);
    __(title(0), printf("VT320 Device Status Reports (DSR)"));
    __(title(2), println("Choose test type:"));
  } while (menu(my_menu));
  return MENU_NOHOLD;
}
コード例 #27
0
ファイル: setup.c プロジェクト: akat1/impala
int
tst_setup(MENU_ARGS)
{
  static char txt_output[80] = "send 7/8";
  static char txt_input8[80] = "receive 7/8";
  static char txt_DECSCL[80] = "DECSCL";
  static char txt_logging[80] = "logging";
  static char txt_padded[80] = "padding";

  static MENU my_menu[] = {
    { "Exit",                                                0 },
    { "Setup terminal to original test-configuration",       setup_terminal },
    { txt_output,                                            toggle_8bit_out },
    { txt_input8,                                            toggle_8bit_in },
    { txt_DECSCL,                                            toggle_DECSCL },
    { txt_logging,                                           toggle_Logging },
    { txt_padded,                                            toggle_Padding },
    { "",                                                    0 }
  };

  if (cur_level < 0)
    find_levels();

  do {
    sprintf(txt_output, "Send %d-bit controls", output_8bits ? 8 : 7);
    sprintf(txt_input8, "Receive %d-bit controls", input_8bits ? 8 : 7);
    sprintf(txt_DECSCL, "Operating level %d (VT%d)",
        cur_level, cur_level ? cur_level * 100 : 52);
    sprintf(txt_logging, "Logging %s", LOG_ENABLED ? "enabled" : "disabled");
    sprintf(txt_padded, "Padding %s", use_padding ? "enabled" : "disabled");

    vt_clear(2);
    title(0); println("Modify test-parameters");
    title(2); println("Select a number to modify it:");
  } while (menu(my_menu));
  return MENU_NOHOLD;
}
コード例 #28
0
ファイル: reset.c プロジェクト: Brybry/wTerm
static int
tst_DECTST(MENU_ARGS)
{
  vt_move(1,1);
  println(the_title);
  println("");

  if (did_reset)
    println("The terminal is now RESET.  Next, the built-in confidence test");
  else
    printf("The built-in confidence test ");
  printf("will be invoked. ");
  holdit();

  vt_clear(2);
  dectst(1);
  zleep(5000);          /* Wait 5.0 seconds */
  vt_move(10,1);
  println("If the built-in confidence test found any errors, a code");
  printf("%s", "is visible above. ");

  did_reset = FALSE;
  return MENU_HOLD;
}
コード例 #29
0
ファイル: vt220.c プロジェクト: RyanHope/wTerm
static int
tst_DECUDK(MENU_ARGS)
{
    int key;
  /* *INDENT-OFF* */
  static struct {
    int code;
    const char *name;
  } keytable[] = {
    /* xterm programs these: */
    { 11, "F1" },
    { 12, "F2" },
    { 13, "F3" },
    { 14, "F4" },
    { 15, "F5" },
    /* vt420 programs these: */
    { 17, "F6" },
    { 18, "F7" },
    { 19, "F8" },
    { 20, "F9" },
    { 21, "F10" },
    { 23, "F11" },
    { 24, "F12" },
    { 25, "F13" },
    { 26, "F14" },
    { 28, "F15" },
    { 29, "F16" },
    { 31, "F17" },
    { 32, "F18" },
    { 33, "F19" },
    { 34, "F20" } };
  /* *INDENT-ON* */

    for (key = 0; key < TABLESIZE(keytable); key++) {
        char temp[80];
        const char *s;
        temp[0] = '\0';
        for (s = keytable[key].name; *s; s++)
            sprintf(temp + strlen(temp), "%02x", *s & 0xff);
        do_dcs("1;1|%d/%s", keytable[key].code, temp);
    }

    vt_move(1, 1);
    println(the_title);
    println("Press 'q' to quit.  Function keys should echo their labels.");
    println("(On a DEC terminal you must press SHIFT as well).");

    set_tty_raw(TRUE);
    set_tty_echo(FALSE);

    for (;;) {
        char *report = instr();
        if (*report == 'q')
            break;
        vt_move(5, 10);
        vt_clear(0);
        chrprint(report);
    }

    do_dcs("0");  /* clear all keys */

    restore_ttymodes();
    vt_move(max_lines - 1, 1);
    return MENU_HOLD;
}
コード例 #30
0
ファイル: vt220.c プロジェクト: RyanHope/wTerm
/*
 * Test DEC's selective-erase (set-protected area) by drawing a box of
 * *'s that will remain, and a big X of *'s that gets cleared..
 */
static int
tst_DECSCA(MENU_ARGS)
{
    int i, j, pass;
    int tmar = 5;
    int bmar = max_lines - 8;
    int lmar = 20;
    int rmar = min_cols - lmar;

    for (pass = 0; pass < 2; pass++) {
        if (pass == 0)
            decsca(1);
        for (i = tmar; i <= bmar; i++) {
            cup(i, lmar);
            for (j = lmar; j <= rmar; j++) {
                printf("*");
            }
        }
        if (pass == 0) {
            decsca(0);

            for (j = 0; j <= 2; j++) {
                for (i = 1; i < tmar; i++) {
                    cup(i, lmar - tmar + (i + j));
                    printf("*");
                    cup(i, rmar + tmar - (i + j));
                    printf("*");
                }
                for (i = bmar + 1; i < max_lines; i++) {
                    cup(i, lmar + bmar - i + j);
                    printf("*");
                    cup(i, rmar - bmar + i - j);
                    printf("*");
                }
                cup(max_lines / 2, min_cols / 2);
                decsed(j);
            }

            for (i = rmar + 1; i <= min_cols; i++) {
                cup(tmar, i);
                printf("*");
                cup(max_lines / 2, i);
                printf("*");
            }
            cup(max_lines / 2, min_cols / 2);
            decsel(0);  /* after the cursor */

            for (i = 1; i < lmar; i++) {
                cup(tmar, i);
                printf("*");
                cup(max_lines / 2, i);
                printf("*");
            }
            cup(max_lines / 2, min_cols / 2);
            decsel(1);  /* before the cursor */

            cup(tmar, min_cols / 2);
            decsel(2);  /* the whole line */

            vt_move(max_lines - 3, 1);
            vt_clear(0);
            println("If your terminal supports DEC protected areas (DECSCA, DECSED, DECSEL),");
            println("there will be an solid box made of *'s in the middle of the screen.");
            holdit();
        }
    }
    return MENU_NOHOLD;
}