Exemplo n.º 1
0
int mvwins_wch(WINDOW *win, int y, int x, const cchar_t *wch)
{
    PDC_LOG(("mvwins_wch() - called\n"));

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

    return wins_wch(win, wch);
}
Exemplo n.º 2
0
int mvins_wch(int y, int x, const cchar_t *wch)
{
    PDC_LOG(("mvins_wch() - called\n"));

    if (move(y, x) == ERR)
        return ERR;

    return wins_wch(stdscr, wch);
}
Exemplo n.º 3
0
int
winsch(WINDOW *w, chtype ch)
{
	int	code;
	cchar_t	cc;

	(void) __m_chtype_cc(ch, &cc);
	code = wins_wch(w, &cc);

	return (code);
}
Exemplo n.º 4
0
static int
WInsCh(WINDOW *win, chtype ch)
{
    int code;
    cchar_t tmp_cchar;

    if (ConvertCh(ch, &tmp_cchar)) {
	code = wins_wch(win, &tmp_cchar);
    } else {
	code = winsch(win, ch);
    }
    return code;
}
Exemplo n.º 5
0
wins_nwstr(WINDOW *win, const wchar_t * wstr, int n)
{
    int code = ERR;
    NCURSES_SIZE_T oy;
    NCURSES_SIZE_T ox;
    const wchar_t *cp;

    T((T_CALLED("wins_nwstr(%p,%s,%d)"), win, _nc_viswbufn(wstr,n), n));

    if (win != 0
	&& wstr != 0
	&& wcwidth(*wstr) > 0) {
	code = OK;
	if (n < 1)
	    n = wcslen(wstr);
	oy = win->_cury;
	ox = win->_curx;
	for (cp = wstr; *cp && ((cp - wstr) < n); cp++) {
	    NCURSES_CH_T wch;
	    SetChar2(wch, *cp);
	    if (*cp == '\n' || *cp == '\r' || *cp == '\t' || *cp == '\b') {
		_nc_waddch_nosync(win, wch);
	    } else if (is7bits(*cp) && iscntrl(*cp)) {
		winsch(win, ' ' + (chtype) (*cp));
		winsch(win, (chtype) '^');
		win->_curx += 2;
	    } else if (wins_wch(win, &wch) == ERR
		       || win->_curx > win->_maxx) {
		break;
	    }
	}

	win->_curx = ox;
	win->_cury = oy;
	_nc_synchook(win);
	code = OK;
    }
    returnCode(code);
}
Exemplo n.º 6
0
/*
  input:addch(ch)
  put a wide character
*/
int		lui_addch_input(lua_State *L)
{
  INPUT		*i;
  wchar_t	*wstr;
  size_t	len;
  cchar_t	ch;

  luasoul_checkclass(L, 1, INPUT_CLASS, i); /* get input */
  luasoul_checklwcstr(L, 2, wstr, len);	    /* get wstring */

  /* FIXME: correct attributs to setcchar() ? */
  if (setcchar(&ch, wstr, WA_NORMAL, 0, NULL) == OK
      && wins_wch(i->pad, &ch) == OK)
    {
      /* man setcchar()
	 ...contain at most one spacing character, which must be the first */
      len = (size_t) wcwidth(*wstr);
      if (len != (size_t) -1 && len) /* don't move for 0 width */
	set_current_position(i, get_current_position(i) + len);
    }

  return 0;
}
Exemplo n.º 7
0
int ins_wch(const cchar_t *wch)
{
    PDC_LOG(("ins_wch() - called\n"));

    return wins_wch(stdscr, wch);
}
Exemplo n.º 8
0
NCURSES_EXPORT(int) (mvwins_wch) (WINDOW * a1, int a2, int a3, const cchar_t * z)
{
	T((T_CALLED("mvwins_wch(%p,%d,%d,%p)"), (const void *)a1, a2, a3, (const void *)z)); returnCode((wmove(a1,a2,a3) == (-1) ? (-1) : wins_wch(a1,z)));
}
Exemplo n.º 9
0
NCURSES_EXPORT(int) (mvins_wch) (int a1, int a2, const cchar_t * z)
{
	T((T_CALLED("mvins_wch(%d,%d,%p)"), a1, a2, (const void *)z)); returnCode((wmove(stdscr,a1,a2) == (-1) ? (-1) : wins_wch(stdscr,z)));
}
Exemplo n.º 10
0
NCURSES_EXPORT(int) (ins_wch) (const cchar_t * z)
{
	T((T_CALLED("ins_wch(%p)"), (const void *)z)); returnCode(wins_wch(stdscr,z));
}