2 * Test lower-right-hand corner access
4 * originally by Eric S. Raymond <esr@thyrsus.com>, written for animation
7 * This can't be part of the ncurses test-program, because ncurses rips off the
8 * bottom line to do labels.
10 * $Id: lrtest.c,v 1.19 2002/07/13 16:55:50 tom Exp $
13 #include <test.priv.h>
16 int y
, x
, mode
, dir
, inc
;
21 * Make a couple of markers go 'round the border to demonstrate that we can
22 * really write to all positions properly.
27 mvaddch(m
->y
, m
->x
, m
->value
);
28 if (m
->mode
== 0) { /* along the x-direction */
32 m
->inc
= -m
->dir
* m
->inc
;
35 } else if (m
->x
< 0) {
37 m
->inc
= -m
->dir
* m
->inc
;
41 } else { /* along the y-direction */
45 m
->inc
= m
->dir
* m
->inc
;
48 } else if (m
->y
< 0) {
50 m
->inc
= m
->dir
* m
->inc
;
60 char *argv
[]GCC_UNUSED
)
64 {0, 0, 0, -1, 1, '+' | A_BOLD
},
66 {0, 0, 1, -1, 3, 'Y'},
67 {0, 8, 0, -1, 1, '+' | A_BOLD
},
68 {0, 9, 0, -1, 1, '+' | A_BOLD
},
69 {1, 0, 1, 1, 1, '*' | A_REVERSE
},
70 {2, 0, 1, 1, 1, '*' | A_REVERSE
}
73 setlocale(LC_ALL
, "");
78 nodelay(stdscr
, TRUE
);
85 move(LINES
/ 2 - 1, 4);
89 || (enter_am_mode
&& exit_am_mode
))) {
90 addstr("Your terminal lacks the capabilities needed to address the\n");
92 addstr("lower-right-hand corner of the screen.\n");
94 addstr("This is a test of access to the lower right corner.\n");
96 addstr("If the top of the box is missing, the test failed.\n");
97 move(LINES
/ 2 + 1, 4);
98 addstr("Please report this (with a copy of your terminfo entry).\n");
99 move(LINES
/ 2 + 2, 4);
100 addstr("to the ncurses maintainers, at bug-ncurses@gnu.org.\n");
108 for (n
= 0; n
< SIZEOF(marks
); n
++) {
112 if ((ch
= getch()) > 0) {
116 nodelay(stdscr
, FALSE
);
118 nodelay(stdscr
, TRUE
);
123 trace(TRACE_CALLS
|TRACE_ICALLS
|TRACE_UPDATE
);
126 else if (ch
== KEY_RESIZE
) {
127 for (n
= 0; n
< SIZEOF(marks
); n
++) {
128 if (marks
[n
].mode
== 0) { /* moving along x-direction */
130 marks
[n
].y
= LINES
- 1;
133 marks
[n
].x
= COLS
- 1;
149 ExitProgram(EXIT_SUCCESS
);
152 /* lrtest.c ends here */