Beispiel #1
0
/*
 * print a string in the window
 */
void wdg_scroll_print(wdg_t *wo, int color, char *fmt, ...)
{
   WDG_WO_EXT(struct wdg_scroll, ww);
   size_t c = wdg_get_ncols(wo);
   size_t l = wdg_get_nlines(wo);
   size_t x = wdg_get_begin_x(wo);
   size_t y = wdg_get_begin_y(wo);
   va_list ap;
   
   WDG_DEBUG_MSG("wdg_scroll_print");

   /* move to the bottom of the pad */
   wdg_set_scroll(wo, ww->y_max - l + 1);

   wbkgdset(ww->sub, COLOR_PAIR(color));

   /* print the message */
   va_start(ap, fmt);
   vw_printw(ww->sub, fmt, ap);
   va_end(ap);
   
   wbkgdset(ww->sub, COLOR_PAIR(wo->window_color));
   
   WDG_PAD_REFRESH(ww, c, l, x, y);
}
Beispiel #2
0
void tui_error_va(const char *prompt, const char *err, va_list vararg)
{
	WINDOW *win = newwin(4, 70, (LINES - 4) / 2, (COLS - 70) / 2);
	PANEL *panel = new_panel(win);

	wattrset(win, ERR_BORDER_ATTR);
	tx_colorwin(win);
	tx_box(win, ACS_VLINE, ACS_HLINE);
	wattrset(win, ERR_PROMPT_ATTR);
	mvwprintw(win, 2, 2, "%s", prompt);

	wattrset(win, ERR_TEXT_ATTR);
	wmove(win, 1, 2);

	vw_printw(win, err, vararg);

	update_panels();
	doupdate();

	int response;

	do {
		response = wgetch(win);
		if (response == 12)
			tx_refresh_screen();
	} while (response == 12);

	del_panel(panel);
	delwin(win);
	update_panels();
	doupdate();
}
Beispiel #3
0
void ncprint(int r, int c, char *fmt, ...) {
  va_list arg;
  va_start(arg, fmt);
  move(subwinr+r, subwinc+c);
  vw_printw(stdscr, fmt, arg);
  va_end(arg);
}
Beispiel #4
0
/*#DOC*/
int view_printf(View v, const char *fmt, ...)
{
	va_list        ap;
	int            ret;
	va_start(ap, fmt);
	ret = vw_printw(view_win(v), fmt, ap);
	va_end(ap);
	return ret;
}
Beispiel #5
0
void nfprintf(FILE *file, char *format, ...) {
va_list args;

va_start(args, format);
if (flag_monitor || flag_monitor_continous)
    vw_printw(mainwin, format, args);
else
    vfprintf(file, format, args);
va_end(args);
}
Beispiel #6
0
/* printf-style print function which calls printw, but only if the cursor is
 * not on the last line. */
static void print(const char *fmt, ...)
{
	va_list args;

	if(current_row() < lines()-1) {
		va_start(args, fmt);
		vw_printw(stdscr, fmt, args);
		va_end(args);
	}
}
Beispiel #7
0
void nprintf(char *format, ...)
{
va_list args;

va_start(args, format);
if (flag_monitor || flag_monitor_continuous)
    vw_printw(mainwin, format, args);
else
    vprintf(format, args);
va_end(args);
}
Beispiel #8
0
/*VARARGS2*/
void
Signal(const char *fmt, struct ship *ship, ...)
{
    va_list ap;
    char format[BUFSIZ];

    if (!done_curses)
        return;
    va_start(ap, ship);
    if (*fmt == '\a')
        putchar(*fmt++);
    if (ship == NULL)
        vw_printw(scroll_w, fmt, ap);
    else {
        fmtship(format, sizeof(format), fmt, ship);
        vw_printw(scroll_w, format, ap);
    }
    va_end(ap);
    Scroll();
}
Beispiel #9
0
/*
 * wprintw --
 *	Printf on the given window.
 */
int
wprintw(WINDOW *win, const char *fmt,...)
{
	va_list ap;
	int     ret;

	va_start(ap, fmt);
	ret = vw_printw(win, fmt, ap);
	va_end(ap);
	return (ret);
}
Beispiel #10
0
/* print curses or normal depending on batch mode setting */
void my_printf(const char *fmt, ...) {
    va_list ap;
    va_start( ap, fmt );
    if(opt_batch == GM_ENABLED) {
        vprintf(fmt, ap);
    } else {
        vw_printw(w, fmt, ap);
    }
    va_end( ap );
    return;
}
Beispiel #11
0
/*
 * printw --
 *	Printf on the standard screen.
 */
int
printw(const char *fmt,...)
{
	va_list ap;
	int     ret;

	va_start(ap, fmt);
	ret = vw_printw(stdscr, fmt, ap);
	va_end(ap);
	return (ret);
}
Beispiel #12
0
/* print a message at the prompt line */
static void
prompt(int n, const char *f, ...)
{
    va_list va;

    (void) move(PROMPTLINE + n, 0);
    (void) clrtoeol();
    va_start(va, f);
    (void) vw_printw(stdscr, f, va);
    va_end(va);
    (void) refresh();
}
Beispiel #13
0
/* Report an error to the debug console */
void Show_Error(char *fmt, ...) {
    va_list args;
    va_start(args, fmt);
    
    wmove(statline, 0, 0);
    wbkgd(statline, error_attr);
    wprintw(statline, "[VNES Debugger] ");
    vw_printw(statline, fmt, args);
    wrefresh(statline);
    
    va_end(args);
    getch();
}
Beispiel #14
0
extern void
tty_printf(const char *fmt, ...)
{
    va_list args;

    va_start(args, fmt);
#ifdef HAVE_SLANG
    SLsmg_vprintf(str_unconst(fmt), args);
#else
    vw_printw(stdscr, fmt, args);
#endif
    va_end(args);
}
Beispiel #15
0
/*
 * mvprintw, mvwprintw --
 *	Implement the mvprintw commands.  Due to the variable number of
 *	arguments, they cannot be macros.  Sigh....
 */
int
mvprintw(int y, int x, const char *fmt,...)
{
	va_list ap;
	int     ret;

	if (move(y, x) != OK)
		return (ERR);
	va_start(ap, fmt);
	ret = vw_printw(stdscr, fmt, ap);
	va_end(ap);
	return (ret);
}
Beispiel #16
0
int
mvwprintw(WINDOW * win, int y, int x, const char *fmt,...)
{
	va_list ap;
	int     ret;

	if (wmove(win, y, x) != OK)
		return (ERR);

	va_start(ap, fmt);
	ret = vw_printw(win, fmt, ap);
	va_end(ap);
	return (ret);
}
Beispiel #17
0
void Log_Line(const char *format, ...) {
//#if 0    
    va_list args;
    va_start(args, format);
    
    vw_printw(logwin, format, args);
    wprintw(logwin, "\n");
    vfprintf(logfp, format, args);
    fprintf(logfp, "\n");
    wrefresh(logwin);
    getch();
    va_end(args);
//#endif
}
Beispiel #18
0
/*
 * print a string in the window
 */
void wdg_window_print(wdg_t *wo, size_t x, size_t y, char *fmt, ...)
{
   WDG_WO_EXT(struct wdg_window, ww);
   va_list ap;
   
   /* move the pointer */
   wmove(ww->sub, y, x);
   
   /* print the message */
   va_start(ap, fmt);
   vw_printw(ww->sub, fmt, ap);
   va_end(ap);

   wnoutrefresh(ww->sub);
}
Beispiel #19
0
int
wprintw(WINDOW *w, const char *fmt, ...)
{
	int code;
	va_list ap;

#ifdef M_CURSES_TRACE
	__m_trace("wprintw(%p, %p = \"%s\", ...)", w, fmt, fmt);
#endif

	va_start(ap, fmt);
	code = vw_printw(w, fmt, ap);
	va_end(ap);

	return __m_return_code("wprintw", code);
}
Beispiel #20
0
int
printw(const char *fmt, ...)
{
	int code;
	va_list ap;

#ifdef M_CURSES_TRACE
	__m_trace("printw(%p = \"%s\", ...)", fmt, fmt);
#endif

	va_start(ap, fmt);
	code = vw_printw(stdscr, fmt, ap);
	va_end(ap);

	return __m_return_code("printw", code);
}
Beispiel #21
0
int
mvwprintw(WINDOW *w, int y, int x, const char *fmt, ...)
{
	int code;
	va_list ap;

#ifdef M_CURSES_TRACE
	__m_trace("mvwprintw(%p, %d, %d, %p = \"%s\", ...)", w, y, x, fmt, fmt);
#endif

	va_start(ap, fmt);
	if ((code = wmove(w, y, x)) == OK)
		code = vw_printw(w, fmt, ap);
	va_end(ap);

	return __m_return_code("mvwprintw", code);
}
Beispiel #22
0
void uiPrintv(const char* str, va_list list) {
    vw_printw(window, str, list);
}