/****************************************************************************
- * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
Author: Eric S. Raymond <esr@snark.thyrsus.com> 1993
Thomas E. Dickey (beginning revision 1.27 in 1996).
-$Id: ncurses.c,v 1.336 2009/01/25 00:39:14 tom Exp $
+$Id: ncurses.c,v 1.345 2009/08/29 20:24:57 tom Exp $
***************************************************************************/
echo();
getyx(win, y0, x0);
- wattrset(win, A_REVERSE);
+ (void) wattrset(win, A_REVERSE);
x = (int) strlen(buffer);
while (!done) {
*target = 0;
}
+#if USE_LIBPANEL
static void
make_fullwidth_digit(cchar_t *target, int digit)
{
source[1] = 0;
setcchar(target, source, A_NORMAL, 0, 0);
}
+#endif
static int
wGet_wchar(WINDOW *win, wint_t *result)
echo();
getyx(win, y0, x0);
- wattrset(win, A_REVERSE);
+ (void) wattrset(win, A_REVERSE);
x = (int) wcslen(buffer);
while (!done) {
addstr("Shelling out...");
def_prog_mode();
endwin();
+#ifdef __MINGW32__
+ system("cmd.exe");
+#else
system("sh");
+#endif
if (message)
addstr("returned from shellout.\n");
refresh();
int flg = ((strstr(help[n], "toggle") != 0)
&& (flags[UChar(*help[n])] != FALSE));
if (flg)
- standout();
+ (void) standout();
mvprintw(row, col, "%s", help[n]);
if (col == 0)
clrtoeol();
if (flg)
- standend();
+ (void) standend();
}
wrefresh(stdscr);
wmove(win, y, x);
{
unsigned need = (level + 1) * 2;
- assert(level < COLS);
+ assert(level < (unsigned) COLS);
if (winstack == 0) {
len_winstack = 20;
wgetch_test(0, stdscr, delay);
forget_boxes();
finish_getch_test();
+ slk_clear();
}
#if USE_WIDEC_SUPPORT
wget_wch_test(0, stdscr, delay);
forget_boxes();
finish_getch_test();
+ slk_clear();
}
#endif
addch(ch | attr);
}
} else {
- attrset(attr);
+ (void) attrset(attr);
addstr(attr_test_string);
attroff(attr);
}
hello = numbered;
}
printw("%-*.*s", width, width, hello);
- attrset(A_NORMAL);
+ (void) attrset(A_NORMAL);
if ((i % per_row) == 0 && InxToFG(i) == min_colors) {
show_color_name(row, 0, InxToBG(i), opt_wide);
(i == current ? '>' : ' '),
(i < (int) SIZEOF(the_color_names)
? the_color_names[i] : numeric));
- attrset(COLOR_PAIR(i));
+ (void) attrset(COLOR_PAIR(i));
addstr(" ");
- attrset(A_NORMAL);
+ (void) attrset(A_NORMAL);
color_content((short) i, &red, &green, &blue);
addstr(" R = ");
attron(A_STANDOUT);
printw("%04d", red);
if (current == i && field == 0)
- attrset(A_NORMAL);
+ (void) attrset(A_NORMAL);
addstr(", G = ");
if (current == i && field == 1)
attron(A_STANDOUT);
printw("%04d", green);
if (current == i && field == 1)
- attrset(A_NORMAL);
+ (void) attrset(A_NORMAL);
addstr(", B = ");
if (current == i && field == 2)
attron(A_STANDOUT);
printw("%04d", blue);
if (current == i && field == 2)
- attrset(A_NORMAL);
- attrset(A_NORMAL);
+ (void) attrset(A_NORMAL);
+ (void) attrset(A_NORMAL);
printw(" ( %3d %3d %3d )",
scaled_rgb(red),
scaled_rgb(green),
*at_code = 0;
break;
case 'V':
- if (*at_code == 1)
+ if (*at_code == 0)
*at_code = SIZEOF(attrs_to_cycle) - 1;
else
*at_code -= 1;
static cchar_t *
merge_wide_attr(cchar_t *dst, const cchar_t *src, attr_t attr, short pair)
{
- int count = getcchar(src, NULL, NULL, NULL, 0);
- wchar_t *wch = 0;
- attr_t ignore_attr;
- short ignore_pair;
+ int count;
*dst = *src;
- if (count > 0) {
- if ((wch = typeMalloc(wchar_t, (unsigned) count + 1)) != 0) {
- if (getcchar(src, wch, &ignore_attr, &ignore_pair, 0) != ERR) {
- attr |= (ignore_attr & A_ALTCHARSET);
- setcchar(dst, wch, attr, pair, 0);
- }
- free(wch);
+ do {
+ TEST_CCHAR(src, count, {
+ attr |= (test_attrs & A_ALTCHARSET);
+ setcchar(dst, test_wch, attr, pair, NULL);
}
- }
+ , {
+ ;
+ });
+ } while (0);
return dst;
}
* the display.
*/
if (wcwidth(code) == 0)
- addch(space | A_REVERSE);
+ addch(space | (A_REVERSE ^ attr) | COLOR_PAIR(pair));
/*
* This could use add_wch(), but is done for comparison with the
* normal 'f' test (and to make a test-case for echo_wchar()).
wbkgd(subWin, COLOR_PAIR(2) | ' ');
}
#endif
- wattrset(subWin, A_BOLD);
+ (void) wattrset(subWin, A_BOLD);
box(subWin, ACS_VLINE, ACS_HLINE);
mvwaddstr(subWin, 2, 1, "This is a subwindow");
wrefresh(win);
switch (flavor) {
case 0:
- wattrset(win, A_NORMAL);
+ (void) wattrset(win, A_NORMAL);
break;
case 1:
- wattrset(win, A_BOLD);
+ (void) wattrset(win, A_BOLD);
break;
case 2:
init_pair(cpair, COLOR_BLUE, COLOR_WHITE);
- wattrset(win, COLOR_PAIR(cpair) | A_NORMAL);
+ (void) wattrset(win, COLOR_PAIR(cpair) | A_NORMAL);
break;
case 3:
init_pair(cpair, COLOR_WHITE, COLOR_BLUE);
- wattrset(win, COLOR_PAIR(cpair) | A_BOLD);
+ (void) wattrset(win, COLOR_PAIR(cpair) | A_BOLD);
break;
}
}
break;
}
overlap_helpitem(state, item, msg);
- wattrset(stdscr, A_NORMAL);
+ (void) wattrset(stdscr, A_NORMAL);
wbkgdset(stdscr, ' ' | A_NORMAL);
}
move(LINES - 1, 0);
{
overlap_test_1_attr(a, flavor, col);
fillwin(a, fill);
- wattrset(a, A_NORMAL);
+ (void) wattrset(a, A_NORMAL);
}
static void
min_colors = -1;
}
#if NCURSES_VERSION_PATCH >= 20000708
- else if (assumed_colors)
+ if (assumed_colors)
assume_default_colors(default_fg, default_bg);
#endif
#endif