projects
/
ncurses.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ncurses 5.7 - patch 20101113
[ncurses.git]
/
test
/
newdemo.c
diff --git
a/test/newdemo.c
b/test/newdemo.c
index 8187982be2932d5b601bed9769ce3e546eacc465..72e1d093c48344150192a64a1838f0842973469f 100644
(file)
--- a/
test/newdemo.c
+++ b/
test/newdemo.c
@@
-2,7
+2,7
@@
* newdemo.c - A demo program using PDCurses. The program illustrate
* the use of colours for text output.
*
* newdemo.c - A demo program using PDCurses. The program illustrate
* the use of colours for text output.
*
- * $Id: newdemo.c,v 1.3
2 2009/08/29 18:47:26
tom Exp $
+ * $Id: newdemo.c,v 1.3
4 2010/11/13 23:33:42
tom Exp $
*/
#include <test.priv.h>
*/
#include <test.priv.h>
@@
-66,7
+66,7
@@
WaitForUser(WINDOW *win)
nodelay(win, TRUE);
t = time((time_t *) 0);
while (1) {
nodelay(win, TRUE);
t = time((time_t *) 0);
while (1) {
- if ((int) (key = wgetch(win)) != ERR) {
+ if ((int) (key =
(chtype)
wgetch(win)) != ERR) {
if (key == 'q' || key == 'Q')
return 1;
else
if (key == 'q' || key == 'Q')
return 1;
else
@@
-83,8
+83,8
@@
set_colors(WINDOW *win, int pair, int foreground, int background)
if (has_colors()) {
if (pair > COLOR_PAIRS)
pair = COLOR_PAIRS;
if (has_colors()) {
if (pair > COLOR_PAIRS)
pair = COLOR_PAIRS;
- init_pair(
pair, foreground,
background);
- (void) wattrset(win, COLOR_PAIR(pair));
+ init_pair(
(short) pair, (short) foreground, (short)
background);
+ (void) wattrset(win,
(attr_t)
COLOR_PAIR(pair));
}
}
}
}
@@
-94,7
+94,7
@@
use_colors(WINDOW *win, int pair, chtype attrs)
if (has_colors()) {
if (pair > COLOR_PAIRS)
pair = COLOR_PAIRS;
if (has_colors()) {
if (pair > COLOR_PAIRS)
pair = COLOR_PAIRS;
- attrs |= COLOR_PAIR(pair);
+ attrs |=
(chtype)
COLOR_PAIR(pair);
}
(void) wattrset(win, attrs);
return attrs;
}
(void) wattrset(win, attrs);
return attrs;
@@
-122,17
+122,17
@@
SubWinTest(WINDOW *win)
set_colors(swin1, 8, COLOR_RED, COLOR_BLUE);
werase(swin1);
set_colors(swin1, 8, COLOR_RED, COLOR_BLUE);
werase(swin1);
-
mvwadds
tr(swin1, 0, 3, "Sub-window 1");
+
MvWAddS
tr(swin1, 0, 3, "Sub-window 1");
wrefresh(swin1);
set_colors(swin2, 9, COLOR_CYAN, COLOR_MAGENTA);
werase(swin2);
wrefresh(swin1);
set_colors(swin2, 9, COLOR_CYAN, COLOR_MAGENTA);
werase(swin2);
-
mvwadds
tr(swin2, 0, 3, "Sub-window 2");
+
MvWAddS
tr(swin2, 0, 3, "Sub-window 2");
wrefresh(swin2);
set_colors(swin3, 10, COLOR_YELLOW, COLOR_GREEN);
werase(swin3);
wrefresh(swin2);
set_colors(swin3, 10, COLOR_YELLOW, COLOR_GREEN);
werase(swin3);
-
mvwadds
tr(swin3, 0, 3, "Sub-window 3");
+
MvWAddS
tr(swin3, 0, 3, "Sub-window 3");
wrefresh(swin3);
delwin(swin1);
wrefresh(swin3);
delwin(swin1);
@@
-192,13
+192,13
@@
BouncingBalls(WINDOW *win)
y3 = bounce(y3, &yd3, h);
set_colors(win, 11, COLOR_RED, COLOR_BLUE);
y3 = bounce(y3, &yd3, h);
set_colors(win, 11, COLOR_RED, COLOR_BLUE);
-
mvwaddc
h(win, y1, x1, 'O');
+
MvWAddC
h(win, y1, x1, 'O');
set_colors(win, 12, COLOR_BLUE, COLOR_RED);
set_colors(win, 12, COLOR_BLUE, COLOR_RED);
-
mvwaddc
h(win, y2, x2, '*');
+
MvWAddC
h(win, y2, x2, '*');
set_colors(win, 13, COLOR_YELLOW, COLOR_WHITE);
set_colors(win, 13, COLOR_YELLOW, COLOR_WHITE);
-
mvwaddc
h(win, y3, x3, '@');
+
MvWAddC
h(win, y3, x3, '@');
wmove(win, 0, 0);
wrefresh(win);
wmove(win, 0, 0);
wrefresh(win);
@@
-251,7
+251,7
@@
main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
for (i = 0; i < 5000; ++i) {
x = rand() % (width - 2) + 1;
y = rand() % (height - 2) + 1;
for (i = 0; i < 5000; ++i) {
x = rand() % (width - 2) + 1;
y = rand() % (height - 2) + 1;
-
mvwaddc
h(win, y, x, c);
+
MvWAddC
h(win, y, x, c);
wrefresh(win);
nodelay(win, TRUE);
if (wgetch(win) != ERR)
wrefresh(win);
nodelay(win, TRUE);
if (wgetch(win) != ERR)
@@
-276,7
+276,7
@@
main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
use_colors(win, 4, A_BOLD);
i = 0;
while (*AusMap[i]) {
use_colors(win, 4, A_BOLD);
i = 0;
while (*AusMap[i]) {
-
mvwadds
tr(win, i + 1, 8, AusMap[i]);
+
MvWAddS
tr(win, i + 1, 8, AusMap[i]);
wrefresh(win);
delay_output(50);
++i;
wrefresh(win);
delay_output(50);
++i;
@@
-284,7
+284,7
@@
main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
set_colors(win, 5, COLOR_BLUE, COLOR_WHITE);
use_colors(win, 5, A_BLINK);
set_colors(win, 5, COLOR_BLUE, COLOR_WHITE);
use_colors(win, 5, A_BLINK);
-
mvwadds
tr(win, height - 2, 6, " PDCurses 2.1 for DOS, OS/2 and Unix");
+
MvWAddS
tr(win, height - 2, 6, " PDCurses 2.1 for DOS, OS/2 and Unix");
wrefresh(win);
/* Draw running messages */
wrefresh(win);
/* Draw running messages */
@@
-300,9
+300,9
@@
main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
}
if (i < w)
}
if (i < w)
- mvwaddnstr(win, height / 2, w - i, buffer, i);
+
(void)
mvwaddnstr(win, height / 2, w - i, buffer, i);
else
else
- mvwaddnstr(win, height / 2, 1, buffer, w);
+
(void)
mvwaddnstr(win, height / 2, 1, buffer, w);
wrefresh(win);
nodelay(win, TRUE);
wrefresh(win);
nodelay(win, TRUE);
@@
-321,19
+321,19
@@
main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
set_colors(win, 7, COLOR_RED, COLOR_GREEN);
memset(save, ' ', sizeof(save));
for (i = 2; i < width - 4; ++i) {
set_colors(win, 7, COLOR_RED, COLOR_GREEN);
memset(save, ' ', sizeof(save));
for (i = 2; i < width - 4; ++i) {
- k = mvwinch(win, 4, i);
+ k =
(int)
mvwinch(win, 4, i);
if (k == ERR)
break;
if (k == ERR)
break;
- save[j++] = c = k;
+ save[j++] = c =
(chtype)
k;
c &= A_CHARTEXT;
c &= A_CHARTEXT;
-
mvwaddc
h(win, 4, i, c);
+
MvWAddC
h(win, 4, i, c);
}
wrefresh(win);
/* Put a message up wait for a key */
i = height - 2;
use_colors(win, 5, A_NORMAL);
}
wrefresh(win);
/* Put a message up wait for a key */
i = height - 2;
use_colors(win, 5, A_NORMAL);
-
mvwadds
tr(win, i, 5, " Type a key to continue or 'Q' to quit ");
+
MvWAddS
tr(win, i, 5, " Type a key to continue or 'Q' to quit ");
wrefresh(win);
if (WaitForUser(win) == 1)
wrefresh(win);
if (WaitForUser(win) == 1)
@@
-341,14
+341,14
@@
main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
j = 0; /* Restore the old line */
for (i = 2; i < width - 4; ++i)
j = 0; /* Restore the old line */
for (i = 2; i < width - 4; ++i)
-
mvwaddc
h(win, 4, i, save[j++]);
+
MvWAddC
h(win, 4, i, save[j++]);
wrefresh(win);
BouncingBalls(win);
/* Put a message up wait for a key */
i = height - 2;
use_colors(win, 5, A_NORMAL);
wrefresh(win);
BouncingBalls(win);
/* Put a message up wait for a key */
i = height - 2;
use_colors(win, 5, A_NORMAL);
-
mvwadds
tr(win, i, 5, " Type a key to continue or 'Q' to quit ");
+
MvWAddS
tr(win, i, 5, " Type a key to continue or 'Q' to quit ");
wrefresh(win);
if (WaitForUser(win) == 1)
break;
wrefresh(win);
if (WaitForUser(win) == 1)
break;