您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ tty_putcode函数代码示例

51自学网 2021-06-03 09:00:34
  C++
这篇教程C++ tty_putcode函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中tty_putcode函数的典型用法代码示例。如果您正苦于以下问题:C++ tty_putcode函数的具体用法?C++ tty_putcode怎么用?C++ tty_putcode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了tty_putcode函数的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: tty_cmd_clearendofscreen

voidtty_cmd_clearendofscreen(    struct tty *tty, struct window_pane *wp, unused va_list ap){	struct screen	*s = wp->screen;	u_int		 i, j;	tty_reset(tty);	tty_region(tty, 0, screen_size_y(s) - 1, wp->yoff);	tty_cursor(tty, s->old_cx, s->old_cy, wp->xoff, wp->yoff);	if (wp->xoff == 0 && screen_size_x(s) >= tty->sx &&	    tty_term_has(tty->term, TTYC_EL)) {		tty_putcode(tty, TTYC_EL);		if (s->old_cy != screen_size_y(s) - 1) {			tty_cursor(tty, 0, s->old_cy + 1, wp->xoff, wp->yoff);			for (i = s->old_cy + 1; i < screen_size_y(s); i++) {				tty_putcode(tty, TTYC_EL);				if (i == screen_size_y(s) - 1)					continue;				tty_emulate_repeat(tty, TTYC_CUD, TTYC_CUD1, 1);				tty->cy++;			}		}	} else {		for (i = s->old_cx; i < screen_size_x(s); i++)			tty_putc(tty, ' ');		for (j = s->old_cy; j < screen_size_y(s); j++) {			tty_cursor(tty, 0, j, wp->xoff, wp->yoff);			for (i = 0; i < screen_size_x(s); i++)				tty_putc(tty, ' ');		}	}}
开发者ID:ThomasAdam,项目名称:tmux-ARCHIVED,代码行数:34,


示例2: tty_cmd_insertcharacter

voidtty_cmd_insertcharacter(struct tty *tty, struct window_pane *wp, va_list ap){	struct screen	*s = wp->screen;	u_int		 ua;	if (wp->xoff != 0 || screen_size_x(s) < tty->sx) {		tty_draw_line(tty, wp->screen, s->old_cy, wp->xoff, wp->yoff);		return;	}	ua = va_arg(ap, u_int);	tty_reset(tty); 	tty_cursor(tty, s->old_cx, s->old_cy, wp->xoff, wp->yoff);	if (tty_term_has(tty->term, TTYC_ICH) ||	    tty_term_has(tty->term, TTYC_ICH1))		tty_emulate_repeat(tty, TTYC_ICH, TTYC_ICH1, ua);	else {		tty_putcode(tty, TTYC_SMIR);		while (ua-- > 0)			tty_putc(tty, ' ');		tty_putcode(tty, TTYC_RMIR);	}}
开发者ID:ThomasAdam,项目名称:tmux-ARCHIVED,代码行数:26,


示例3: tty_update_mode

voidtty_update_mode(struct tty *tty, int mode){    int	changed;    if (tty->flags & TTY_NOCURSOR)        mode &= ~MODE_CURSOR;    changed = mode ^ tty->mode;    if (changed & MODE_CURSOR) {        if (mode & MODE_CURSOR)            tty_putcode(tty, TTYC_CNORM);        else            tty_putcode(tty, TTYC_CIVIS);    }    if (changed & MODE_MOUSE) {        if (mode & MODE_MOUSE)            tty_puts(tty, "/033[?1000h");        else            tty_puts(tty, "/033[?1000l");    }    if (changed & MODE_KKEYPAD) {        if (mode & MODE_KKEYPAD)            tty_putcode(tty, TTYC_SMKX);        else            tty_putcode(tty, TTYC_RMKX);    }    tty->mode = mode;}
开发者ID:jnbek,项目名称:tmux,代码行数:29,


示例4: tty_attributes

voidtty_attributes(struct tty *tty, const struct grid_cell *gc){	struct grid_cell	*tc = &tty->cell;	u_char			 changed;	u_int			 fg, bg;	/* If any bits are being cleared, reset everything. */	if (tc->attr & ~gc->attr)		tty_reset(tty);	/* Filter out attribute bits already set. */	changed = gc->attr & ~tc->attr;	tc->attr = gc->attr;	/* Set the attributes. */	fg = gc->fg;	bg = gc->bg;	if (changed & GRID_ATTR_BRIGHT)		tty_putcode(tty, TTYC_BOLD);	if (changed & GRID_ATTR_DIM)		tty_putcode(tty, TTYC_DIM);	if (changed & GRID_ATTR_ITALICS)		tty_putcode(tty, TTYC_SMSO);	if (changed & GRID_ATTR_UNDERSCORE)		tty_putcode(tty, TTYC_SMUL);	if (changed & GRID_ATTR_BLINK)		tty_putcode(tty, TTYC_BLINK);	if (changed & GRID_ATTR_REVERSE) {		if (tty_term_has(tty->term, TTYC_REV))			tty_putcode(tty, TTYC_REV);		else if (tty_term_has(tty->term, TTYC_SMSO))			tty_putcode(tty, TTYC_SMSO);	}	if (changed & GRID_ATTR_HIDDEN)		tty_putcode(tty, TTYC_INVIS);	if (changed & GRID_ATTR_CHARSET)		tty_putcode(tty, TTYC_SMACS);	/* Set foreground colour. */	if (fg != tc->fg ||	    (gc->flags & GRID_FLAG_FG256) != (tc->flags & GRID_FLAG_FG256)) {		tty_attributes_fg(tty, gc);		tc->fg = fg;		tc->flags &= ~GRID_FLAG_FG256;		tc->flags |= gc->flags & GRID_FLAG_FG256;	}	/* Set background colour. */	if (bg != tc->bg ||	    (gc->flags & GRID_FLAG_BG256) != (tc->flags & GRID_FLAG_BG256)) {		tty_attributes_bg(tty, gc);		tc->bg = bg;		tc->flags &= ~GRID_FLAG_BG256;		tc->flags |= gc->flags & GRID_FLAG_BG256;	}}
开发者ID:ThomasAdam,项目名称:tmux-ARCHIVED,代码行数:57,


示例5: tty_cmd_clearscreen

voidtty_cmd_clearscreen(struct tty *tty, const struct tty_ctx *ctx){	struct window_pane	*wp = ctx->wp;	struct screen		*s = wp->screen;	u_int		 	 i, j;	tty_reset(tty);	tty_region_pane(tty, ctx, 0, screen_size_y(s) - 1);	tty_cursor_pane(tty, ctx, 0, 0);	if (tty_pane_full_width(tty, ctx) && tty_term_has(tty->term, TTYC_EL)) {		for (i = 0; i < screen_size_y(s); i++) {			tty_putcode(tty, TTYC_EL);			if (i != screen_size_y(s) - 1) {				tty_emulate_repeat(tty, TTYC_CUD, TTYC_CUD1, 1);				tty->cy++;			}		}	} else {		for (j = 0; j < screen_size_y(s); j++) {			tty_cursor_pane(tty, ctx, 0, j);			tty_repeat_space(tty, screen_size_x(s));		}	}}
开发者ID:UNGLinux,项目名称:Obase,代码行数:27,


示例6: tty_attributes_fg

voidtty_attributes_fg(struct tty *tty, const struct grid_cell *gc){	u_char	fg;	fg = gc->fg;	if (gc->flags & GRID_FLAG_FG256) {		if (tty_try_256(tty, fg, "38") == 0)			return;		if (tty_try_88(tty, fg, "38") == 0)			return;		fg = colour_256to16(fg);		if (fg & 8) {			fg &= 7;			tty_putcode(tty, TTYC_BOLD);			tty->cell.attr |= GRID_ATTR_BRIGHT;		} else if (tty->cell.attr & GRID_ATTR_BRIGHT)			tty_reset(tty);	}	if (fg == 8 &&	    !(tty->term->flags & TERM_HASDEFAULTS) &&	    !(tty->term_flags & TERM_HASDEFAULTS))		fg = 7;	if (fg == 8)		tty_puts(tty, "/033[39m");	else		tty_putcode1(tty, TTYC_SETAF, fg);}
开发者ID:ThomasAdam,项目名称:tmux-ARCHIVED,代码行数:29,


示例7: tty_start_tty

voidtty_start_tty(struct tty *tty){	struct termios	 tio;#ifdef TIOCFLUSH	int		 what;#endif#if 0	tty_detect_utf8(tty);#endif	if (tcgetattr(tty->fd, &tty->tio) != 0)		fatal("tcgetattr failed");	memcpy(&tio, &tty->tio, sizeof tio);	tio.c_iflag &= ~(IXON|IXOFF|ICRNL|INLCR|IGNCR|IMAXBEL|ISTRIP);	tio.c_iflag |= IGNBRK;	tio.c_oflag &= ~(OPOST|ONLCR|OCRNL|ONLRET);	tio.c_lflag &= ~(IEXTEN|ICANON|ECHO|ECHOE|ECHONL|ECHOCTL|	    ECHOPRT|ECHOKE|ECHOCTL|ISIG);	tio.c_cc[VMIN] = 1;        tio.c_cc[VTIME] = 0;	if (tcsetattr(tty->fd, TCSANOW, &tio) != 0)		fatal("tcsetattr failed");#ifdef TIOCFLUSH	what = 0;	if (ioctl(tty->fd, TIOCFLUSH, &what) != 0)		fatal("ioctl(TIOCFLUSH)");#endif	tty_putcode(tty, TTYC_IS1);	tty_putcode(tty, TTYC_IS2);	tty_putcode(tty, TTYC_IS3);	tty_putcode(tty, TTYC_SMCUP);	tty_putcode(tty, TTYC_SMKX);	tty_putcode(tty, TTYC_ENACS);	tty_putcode(tty, TTYC_CLEAR);	tty_putcode(tty, TTYC_CNORM);	if (tty_term_has(tty->term, TTYC_KMOUS))		tty_puts(tty, "/033[?1000l");	memcpy(&tty->cell, &grid_default_cell, sizeof tty->cell);	tty->cx = UINT_MAX;	tty->cy = UINT_MAX;	tty->rlower = UINT_MAX;	tty->rupper = UINT_MAX;	tty->mode = MODE_CURSOR;}
开发者ID:ThomasAdam,项目名称:tmux-ARCHIVED,代码行数:54,


示例8: tty_start_tty

voidtty_start_tty(struct tty *tty){	tty_init_termios(tty->fd, &tty->tio, tty->event);	tty_putcode(tty, TTYC_SMCUP);	tty_putcode(tty, TTYC_SGR0);	memcpy(&tty->cell, &grid_default_cell, sizeof tty->cell);	tty_putcode(tty, TTYC_RMKX);	if (tty_use_acs(tty))		tty_putcode(tty, TTYC_ENACS);	tty_putcode(tty, TTYC_CLEAR);	tty_putcode(tty, TTYC_CNORM);	if (tty_term_has(tty->term, TTYC_KMOUS))		tty_puts(tty, "/033[?1000l");	if (tty_term_has(tty->term, TTYC_XT))		tty_puts(tty, "/033[>c");	tty->cx = UINT_MAX;	tty->cy = UINT_MAX;	tty->rlower = UINT_MAX;	tty->rupper = UINT_MAX;	tty->mode = MODE_CURSOR;	tty->flags |= TTY_STARTED;	tty_force_cursor_colour(tty, "");}
开发者ID:UNGLinux,项目名称:Obase,代码行数:34,


示例9: tty_cmd_clearstartofline

voidtty_cmd_clearstartofline(struct tty *tty, const struct tty_ctx *ctx){	tty_reset(tty);	if (ctx->xoff == 0 && tty_term_has(tty->term, TTYC_EL1)) {		tty_cursor_pane(tty, ctx, ctx->ocx, ctx->ocy);		tty_putcode(tty, TTYC_EL1);	} else {		tty_cursor_pane(tty, ctx, 0, ctx->ocy);		tty_repeat_space(tty, ctx->ocx + 1);	}}
开发者ID:UNGLinux,项目名称:Obase,代码行数:13,


示例10: tty_cmd_clearendofline

voidtty_cmd_clearendofline(struct tty *tty, const struct tty_ctx *ctx){	struct window_pane	*wp = ctx->wp;	struct screen		*s = wp->screen;	tty_reset(tty);	tty_cursor_pane(tty, ctx, ctx->ocx, ctx->ocy);	if (tty_pane_full_width(tty, ctx) && tty_term_has(tty->term, TTYC_EL))		tty_putcode(tty, TTYC_EL);	else		tty_repeat_space(tty, screen_size_x(s) - ctx->ocx);}
开发者ID:UNGLinux,项目名称:Obase,代码行数:15,


示例11: tty_cmd_clearstartofline

voidtty_cmd_clearstartofline(struct tty *tty, const struct tty_ctx *ctx){	u_int	 i;	tty_reset(tty);	if (ctx->xoff == 0 && tty_term_has(tty->term, TTYC_EL1)) {		tty_cursor_pane(tty, ctx, ctx->ocx, ctx->ocy);		tty_putcode(tty, TTYC_EL1);	} else {		tty_cursor_pane(tty, ctx, 0, ctx->ocy);		for (i = 0; i < ctx->ocx + 1; i++)			tty_putc(tty, ' ');	}}
开发者ID:bholt,项目名称:tmux,代码行数:16,


示例12: tty_cmd_clearline

voidtty_cmd_clearline(struct tty *tty, struct window_pane *wp, unused va_list ap){	struct screen	*s = wp->screen;	u_int		 i;	tty_reset(tty); 	tty_cursor(tty, 0, s->old_cy, wp->xoff, wp->yoff);	if (wp->xoff == 0 && screen_size_x(s) >= tty->sx &&	    tty_term_has(tty->term, TTYC_EL)) {		tty_putcode(tty, TTYC_EL);	} else {		for (i = 0; i < screen_size_x(s); i++)			tty_putc(tty, ' ');	}}
开发者ID:ThomasAdam,项目名称:tmux-ARCHIVED,代码行数:17,


示例13: tty_start_tty

voidtty_start_tty(struct tty *tty){    struct termios	 tio;    int		 mode;    if (tty->fd == -1)        return;    if ((mode = fcntl(tty->fd, F_GETFL)) == -1)        fatal("fcntl failed");    if (fcntl(tty->fd, F_SETFL, mode|O_NONBLOCK) == -1)        fatal("fcntl failed");    bufferevent_enable(tty->event, EV_READ|EV_WRITE);    if (tcgetattr(tty->fd, &tty->tio) != 0)        fatal("tcgetattr failed");    memcpy(&tio, &tty->tio, sizeof tio);    tio.c_iflag &= ~(IXON|IXOFF|ICRNL|INLCR|IGNCR|IMAXBEL|ISTRIP);    tio.c_iflag |= IGNBRK;    tio.c_oflag &= ~(OPOST|ONLCR|OCRNL|ONLRET);    tio.c_lflag &= ~(IEXTEN|ICANON|ECHO|ECHOE|ECHONL|ECHOCTL|                     ECHOPRT|ECHOKE|ECHOCTL|ISIG);    tio.c_cc[VMIN] = 1;    tio.c_cc[VTIME] = 0;    if (tcsetattr(tty->fd, TCSANOW, &tio) != 0)        fatal("tcsetattr failed");    tcflush(tty->fd, TCIOFLUSH);    tty_putcode(tty, TTYC_SMCUP);    tty_putcode(tty, TTYC_SGR0);    memcpy(&tty->cell, &grid_default_cell, sizeof tty->cell);    tty_putcode(tty, TTYC_RMKX);    tty_putcode(tty, TTYC_ENACS);    tty_putcode(tty, TTYC_CLEAR);    tty_putcode(tty, TTYC_CNORM);    if (tty_term_has(tty->term, TTYC_KMOUS))        tty_puts(tty, "/033[?1000l");    tty->cx = UINT_MAX;    tty->cy = UINT_MAX;    tty->rlower = UINT_MAX;    tty->rupper = UINT_MAX;    tty->mode = MODE_CURSOR;    tty->flags |= TTY_STARTED;}
开发者ID:jnbek,项目名称:tmux,代码行数:53,


示例14: tty_cmd_reverseindex

voidtty_cmd_reverseindex(struct tty *tty, struct window_pane *wp, unused va_list ap){	struct screen	*s = wp->screen; 	if (wp->xoff != 0 || screen_size_x(s) < tty->sx ||	    !tty_term_has(tty->term, TTYC_CSR)) {		tty_redraw_region(tty, wp);		return;	}	tty_reset(tty); 	tty_region(tty, s->old_rupper, s->old_rlower, wp->yoff);	if (s->old_cy == s->old_rupper) {		tty_cursor(tty, s->old_cx, s->old_rupper, wp->xoff, wp->yoff);		tty_putcode(tty, TTYC_RI);	}}
开发者ID:ThomasAdam,项目名称:tmux-ARCHIVED,代码行数:20,


示例15: tty_set_version

voidtty_set_version(struct tty *tty, u_int version){	if (tty->xterm_version != 0)		return;	tty->xterm_version = version;	if (tty->xterm_version > 270) {		tty_puts(tty, "/033[65;1/"p");		tty_putcode(tty, TTYC_RMACS);		memcpy(&tty->cell, &grid_default_cell, sizeof tty->cell);		tty->cx = UINT_MAX;		tty->cy = UINT_MAX;		tty->rupper = UINT_MAX;		tty->rlower = UINT_MAX;	}}
开发者ID:UNGLinux,项目名称:Obase,代码行数:20,


示例16: tty_cmd_reverseindex

voidtty_cmd_reverseindex(struct tty *tty, const struct tty_ctx *ctx){	if (ctx->ocy != ctx->orupper)		return;	if (!tty_pane_full_width(tty, ctx) ||	    !tty_term_has(tty->term, TTYC_CSR) ||	    !tty_term_has(tty->term, TTYC_RI)) {		tty_redraw_region(tty, ctx);		return;	}	tty_reset(tty);	tty_region_pane(tty, ctx, ctx->orupper, ctx->orlower);	tty_cursor_pane(tty, ctx, ctx->ocx, ctx->orupper);	tty_putcode(tty, TTYC_RI);}
开发者ID:UNGLinux,项目名称:Obase,代码行数:20,


示例17: tty_draw_line

voidtty_draw_line(struct tty *tty, struct screen *s, u_int py, u_int ox, u_int oy){	const struct grid_cell	*gc;	const struct grid_utf8	*gu;	u_int			 i, sx;	sx = screen_size_x(s);	if (sx > s->grid->size[s->grid->hsize + py])		sx = s->grid->size[s->grid->hsize + py];	if (sx > tty->sx)		sx = tty->sx;	tty_cursor(tty, 0, py, ox, oy);	for (i = 0; i < sx; i++) {		gc = grid_view_peek_cell(s->grid, i, py);		gu = NULL;		if (gc->flags & GRID_FLAG_UTF8)			gu = grid_view_peek_utf8(s->grid, i, py);		if (screen_check_selection(s, i, py)) {			s->sel.cell.data = gc->data;			tty_cell(tty, &s->sel.cell, gu);		} else			tty_cell(tty, gc, gu);	}	if (sx >= tty->sx)		return;	tty_reset(tty);	tty_cursor(tty, sx, py, ox, oy);	if (screen_size_x(s) >= tty->sx && tty_term_has(tty->term, TTYC_EL))		tty_putcode(tty, TTYC_EL);	else {		for (i = sx; i < screen_size_x(s); i++)			tty_putc(tty, ' ');	}}
开发者ID:ThomasAdam,项目名称:tmux-ARCHIVED,代码行数:40,


示例18: tty_start_tty

voidtty_start_tty(struct tty *tty){	tty_init_termios(tty->fd, &tty->tio, tty->event);	tty_putcode(tty, TTYC_SMCUP);	tty_putcode(tty, TTYC_SGR0);	memcpy(&tty->cell, &grid_default_cell, sizeof tty->cell);	tty_putcode(tty, TTYC_RMKX);	if (tty_use_acs(tty))		tty_putcode(tty, TTYC_ENACS);	tty_putcode(tty, TTYC_CLEAR);	tty_putcode(tty, TTYC_CNORM);	if (tty_term_has(tty->term, TTYC_KMOUS))		tty_puts(tty, "/033[?1000l/033[?1002l/033[?1006l/033[?1005l");	if (tty_term_has(tty->term, TTYC_XT)) {		if (options_get_number(&global_options, "focus-events")) {			tty->flags |= TTY_FOCUS;			tty_puts(tty, "/033[?1004h");		}		tty_puts(tty, "/033[c");	}	tty->cx = UINT_MAX;	tty->cy = UINT_MAX;	tty->rlower = UINT_MAX;	tty->rupper = UINT_MAX;	tty->mode = MODE_CURSOR;	tty->flags |= TTY_STARTED;	tty_force_cursor_colour(tty, "");	tty->mouse_drag_flag = 0;	tty->mouse_drag_update = NULL;	tty->mouse_drag_release = NULL;}
开发者ID:Ferada,项目名称:tmux,代码行数:43,



注:本文中的tty_putcode函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ tty_puts函数代码示例
C++ tty_printf函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。