~ubuntu-branches/ubuntu/natty/ncurses/natty

« back to all changes in this revision

Viewing changes to test/testcurs.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-05-17 09:00:42 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070517090042-86fgxrr6j5jzagot
Tags: 5.6-0ubuntu1
* New upstream version.
  - Remove patches applied upstream: ncurses.upstream, signed-chars.
  - Update patches: debian-backspace.
* Build-depend on g++-multilib instead of lib{32,64}c*-dev-*.

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 *  wrs(5/28/93) -- modified to be consistent (perform identically) with either
8
8
 *                  PDCurses or under Unix System V, R4
9
9
 *
10
 
 * $Id: testcurs.c,v 1.34 2005/04/16 16:19:12 tom Exp $
 
10
 * $Id: testcurs.c,v 1.37 2005/12/31 20:23:09 tom Exp $
11
11
 */
12
12
 
13
13
#include <test.priv.h>
342
342
    mvwaddstr(win, 1, 1, "Press keys (or mouse buttons) to show their names");
343
343
    mvwaddstr(win, 2, 1, "Press spacebar to finish");
344
344
    wrefresh(win);
 
345
 
345
346
    keypad(win, TRUE);
346
347
    raw();
347
348
    noecho();
 
349
 
 
350
#if HAVE_TYPEAHEAD
348
351
    typeahead(-1);
 
352
#endif
 
353
 
349
354
#if defined(PDCURSES)
350
355
    mouse_set(ALL_MOUSE_EVENTS);
351
356
#endif
 
357
 
352
358
    for (;;) {
353
359
        wmove(win, 3, 5);
354
360
        c = wgetch(win);
440
446
    chtype ch;
441
447
    int by, bx;
442
448
 
 
449
#if !HAVE_TIGETSTR
 
450
#if HAVE_TGETENT
 
451
    char tc_buffer[4096];
 
452
    char tc_parsed[4096];
 
453
    char *area_pointer = tc_parsed;
 
454
    tgetent(tc_buffer, getenv("TERM"));
 
455
#else
 
456
#define tgetstr(a,b) 0
 
457
#endif
 
458
#endif /* !HAVE_TIGETSTR */
 
459
 
443
460
    nl();
444
461
    wclear(win);
445
462
    mvwaddstr(win, 1, 1,
530
547
    winsch(win, ch);
531
548
    Continue(win);
532
549
 
 
550
#if HAVE_WINSSTR
533
551
    mvwinsstr(win, 6, 2, "A1B2C3D4E5");
534
552
    Continue(win);
 
553
#endif
535
554
 
536
555
    wmove(win, 5, 1);
537
556
    winsertln(win);
554
573
    *Buffer = 0;
555
574
    scanw("%s", Buffer);
556
575
 
557
 
    if (tigetstr("cvvis") != 0) {
 
576
    if (TIGETSTR("cvvis", "vs") != 0) {
558
577
        wclear(win);
559
578
        curs_set(2);
560
579
        mvwaddstr(win, 1, 1, "The cursor should appear as a block (visible)");
561
580
        Continue(win);
562
581
    }
563
582
 
564
 
    if (tigetstr("civis") != 0) {
 
583
    if (TIGETSTR("civis", "vi") != 0) {
565
584
        wclear(win);
566
585
        curs_set(0);
567
586
        mvwaddstr(win, 1, 1,
569
588
        Continue(win);
570
589
    }
571
590
 
572
 
    if (tigetstr("cnorm") != 0) {
 
591
    if (TIGETSTR("cnorm", "ve") != 0) {
573
592
        wclear(win);
574
593
        curs_set(1);
575
594
        mvwaddstr(win, 1, 1, "The cursor should be an underline (normal)");
586
605
#endif
587
606
 
588
607
    werase(win);
 
608
 
 
609
#if HAVE_TERMNAME
589
610
    mvwaddstr(win, 1, 1, "Information About Your Terminal");
590
611
    mvwaddstr(win, 3, 1, termname());
591
612
    mvwaddstr(win, 4, 1, longname());
593
614
        mvwaddstr(win, 5, 1, "This terminal supports blinking.");
594
615
    else
595
616
        mvwaddstr(win, 5, 1, "This terminal does NOT support blinking.");
 
617
#endif
596
618
 
597
619
    mvwaddnstr(win, 7, 5, "Have a nice day!ok", 16);
598
620
    wrefresh(win);