• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ screen_write_initctx函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: screen_write_clearendofscreen

/* Clear to end of screen from cursor. */
void
screen_write_clearendofscreen(struct screen_write_ctx *ctx, u_int bg)
{
	struct screen	*s = ctx->s;
	struct tty_ctx	 ttyctx;
	u_int		 sx = screen_size_x(s), sy = screen_size_y(s);

	screen_write_initctx(ctx, &ttyctx);
	ttyctx.bg = bg;

	/* Scroll into history if it is enabled and clearing entire screen. */
	if (s->cx == 0 && s->cy == 0 && s->grid->flags & GRID_HISTORY) {
		screen_dirty_clear(s, 0, 0, sx - 1, sy  - 1);
		grid_view_clear_history(s->grid, bg);
	} else {
		if (s->cx <= sx - 1) {
			screen_dirty_clear(s, s->cx, s->cy, sx - 1, s->cy);
			grid_view_clear(s->grid, s->cx, s->cy, sx - s->cx, 1,
			    bg);
		}
		screen_dirty_clear(s, 0, s->cy + 1, sx - 1, sy - 1);
		grid_view_clear(s->grid, 0, s->cy + 1, sx, sy - (s->cy + 1),
		    bg);
	}

	tty_write(tty_cmd_clearendofscreen, &ttyctx);
}
开发者ID:CraZySacX,项目名称:tmux,代码行数:28,代码来源:screen-write.c


示例2: screen_write_linefeed

/* Line feed. */
void
screen_write_linefeed(struct screen_write_ctx *ctx, int wrapped)
{
	struct screen		*s = ctx->s;
	struct grid_line	*gl;
	struct tty_ctx	 	 ttyctx;
	u_int			 sx = screen_size_x(s), sy = screen_size_y(s);

	screen_write_initctx(ctx, &ttyctx);

	gl = &s->grid->linedata[s->grid->hsize + s->cy];
	if (wrapped)
		gl->flags |= GRID_LINE_WRAPPED;
	else
		gl->flags &= ~GRID_LINE_WRAPPED;

	if (s->cy == s->rlower) {
		screen_dirty_clear(s, 0, s->rupper, sx - 1, s->rupper);
		screen_write_flush(ctx);
		grid_view_scroll_region_up(s->grid, s->rupper, s->rlower);
	} else if (s->cy < sy - 1)
		s->cy++;

	ttyctx.num = wrapped;
	tty_write(tty_cmd_linefeed, &ttyctx);
}
开发者ID:CraZySacX,项目名称:tmux,代码行数:27,代码来源:screen-write.c


示例3: screen_write_alignmenttest

/* VT100 alignment test. */
void
screen_write_alignmenttest(struct screen_write_ctx *ctx)
{
	struct screen		*s = ctx->s;
	struct tty_ctx	 	 ttyctx;
	struct grid_cell       	 gc;
	u_int			 xx, yy;
	u_int		 	 sx = screen_size_x(s), sy = screen_size_y(s);

	screen_write_initctx(ctx, &ttyctx);

	screen_dirty_clear(s, 0, 0, sx - 1, sy  - 1);

	memcpy(&gc, &grid_default_cell, sizeof gc);
	utf8_set(&gc.data, 'E');

	for (yy = 0; yy < screen_size_y(s); yy++) {
		for (xx = 0; xx < screen_size_x(s); xx++)
			grid_view_set_cell(s->grid, xx, yy, &gc);
	}

	s->cx = 0;
	s->cy = 0;

	s->rupper = 0;
	s->rlower = screen_size_y(s) - 1;

	tty_write(tty_cmd_alignmenttest, &ttyctx);
}
开发者ID:CraZySacX,项目名称:tmux,代码行数:30,代码来源:screen-write.c


示例4: screen_write_alignmenttest

/* VT100 alignment test. */
void
screen_write_alignmenttest(struct screen_write_ctx *ctx)
{
	struct screen		*s = ctx->s;
	struct tty_ctx	 	 ttyctx;
	struct grid_cell       	 gc;
	u_int			 xx, yy;

	screen_write_initctx(ctx, &ttyctx, 0);

	memcpy(&gc, &grid_default_cell, sizeof gc);
	grid_cell_one(&gc, 'E');

	for (yy = 0; yy < screen_size_y(s); yy++) {
		for (xx = 0; xx < screen_size_x(s); xx++)
			grid_view_set_cell(s->grid, xx, yy, &gc);
	}

	s->cx = 0;
	s->cy = 0;

	s->rupper = 0;

	s->rlower = screen_size_y(s) - 1;

	tty_write(tty_cmd_alignmenttest, &ttyctx);
}
开发者ID:SylvestreG,项目名称:bitrig,代码行数:28,代码来源:screen-write.c


示例5: screen_write_clearcharacter

/* Clear nx characters. */
void
screen_write_clearcharacter(struct screen_write_ctx *ctx, u_int nx)
{
	struct screen	*s = ctx->s;
	struct tty_ctx	 ttyctx;

	if (nx == 0)
		nx = 1;

	if (nx > screen_size_x(s) - s->cx)
		nx = screen_size_x(s) - s->cx;
	if (nx == 0)
		return;

	screen_write_initctx(ctx, &ttyctx);

	if (s->cx <= screen_size_x(s) - 1) {
		screen_dirty_clear(s, s->cx, s->cy, s->cx + nx - 1, s->cy);
		grid_view_clear(s->grid, s->cx, s->cy, nx, 1, 8);
	} else
		return;

	ttyctx.num = nx;
	tty_write(tty_cmd_clearcharacter, &ttyctx);
}
开发者ID:CraZySacX,项目名称:tmux,代码行数:26,代码来源:screen-write.c


示例6: screen_write_deleteline

/* Delete ny lines. */
void
screen_write_deleteline(struct screen_write_ctx *ctx, u_int ny, u_int bg)
{
	struct screen	*s = ctx->s;
	struct tty_ctx	 ttyctx;

	if (ny == 0)
		ny = 1;

	if (s->cy < s->rupper || s->cy > s->rlower) {
		if (ny > screen_size_y(s) - s->cy)
			ny = screen_size_y(s) - s->cy;
		if (ny == 0)
			return;

		screen_write_flush(ctx);
		screen_write_initctx(ctx, &ttyctx);

		grid_view_delete_lines(s->grid, s->cy, ny, bg);

		ttyctx.num = ny;
		ttyctx.bg = bg;
		tty_write(tty_cmd_deleteline, &ttyctx);
		return;
	}

	if (ny > s->rlower + 1 - s->cy)
		ny = s->rlower + 1 - s->cy;
	if (ny == 0)
		return;

	screen_write_flush(ctx);
	screen_write_initctx(ctx, &ttyctx);

	if (s->cy < s->rupper || s->cy > s->rlower)
		grid_view_delete_lines(s->grid, s->cy, ny, bg);
	else {
		grid_view_delete_lines_region(s->grid, s->rlower, s->cy, ny,
		    bg);
	}

	ttyctx.num = ny;
	ttyctx.bg = bg;
	tty_write(tty_cmd_deleteline, &ttyctx);
}
开发者ID:CraZySacX,项目名称:tmux,代码行数:46,代码来源:screen-write.c


示例7: screen_write_sixel

void
screen_write_sixel(struct screen_write_ctx *ctx, u_char *str, u_int len)
{
	struct tty_ctx		 ttyctx;

	screen_write_initctx(ctx, &ttyctx, 0);
	ttyctx.ptr = str;
	ttyctx.num = len;

	tty_write(tty_cmd_write_sixel, &ttyctx);
}
开发者ID:ChrisSteinbach,项目名称:tmux-sixel,代码行数:11,代码来源:screen-write.c


示例8: screen_write_setselection

void
screen_write_setselection(struct screen_write_ctx *ctx, u_char *str, u_int len)
{
	struct tty_ctx	ttyctx;

	screen_write_initctx(ctx, &ttyctx);
	ttyctx.ptr = str;
	ttyctx.num = len;

	tty_write(tty_cmd_setselection, &ttyctx);
}
开发者ID:CraZySacX,项目名称:tmux,代码行数:11,代码来源:screen-write.c


示例9: screen_write_rawstring

void
screen_write_rawstring(struct screen_write_ctx *ctx, u_char *str, u_int len)
{
	struct tty_ctx	ttyctx;

	screen_write_initctx(ctx, &ttyctx);
	ttyctx.ptr = str;
	ttyctx.num = len;

	tty_write(tty_cmd_rawstring, &ttyctx);
}
开发者ID:CraZySacX,项目名称:tmux,代码行数:11,代码来源:screen-write.c


示例10: screen_write_clearline

/* Clear line at cursor. */
void
screen_write_clearline(struct screen_write_ctx *ctx)
{
	struct screen	*s = ctx->s;
	struct tty_ctx	 ttyctx;

	screen_write_initctx(ctx, &ttyctx, 0);

	grid_view_clear(s->grid, 0, s->cy, screen_size_x(s), 1);

	tty_write(tty_cmd_clearline, &ttyctx);
}
开发者ID:HonestQiao,项目名称:tmux,代码行数:13,代码来源:screen-write.c


示例11: screen_write_insertline

/* Insert ny lines. */
void
screen_write_insertline(struct screen_write_ctx *ctx, u_int ny)
{
	struct screen	*s = ctx->s;
	struct tty_ctx	 ttyctx;

	if (ny == 0)
		ny = 1;

	if (s->cy < s->rupper || s->cy > s->rlower) {
		if (ny > screen_size_y(s) - s->cy)
			ny = screen_size_y(s) - s->cy;
		if (ny == 0)
			return;

		screen_write_initctx(ctx, &ttyctx, 0);

		grid_view_insert_lines(s->grid, s->cy, ny);

		ttyctx.num = ny;
		tty_write(tty_cmd_insertline, &ttyctx);
		return;
	}

	if (ny > s->rlower + 1 - s->cy)
		ny = s->rlower + 1 - s->cy;
	if (ny == 0)
		return;

	screen_write_initctx(ctx, &ttyctx, 0);

	if (s->cy < s->rupper || s->cy > s->rlower)
		grid_view_insert_lines(s->grid, s->cy, ny);
	else
		grid_view_insert_lines_region(s->grid, s->rlower, s->cy, ny);

	ttyctx.num = ny;
	tty_write(tty_cmd_insertline, &ttyctx);
}
开发者ID:HonestQiao,项目名称:tmux,代码行数:40,代码来源:screen-write.c


示例12: screen_write_reverseindex

/* Reverse index (up with scroll).  */
void
screen_write_reverseindex(struct screen_write_ctx *ctx)
{
	struct screen	*s = ctx->s;
	struct tty_ctx	 ttyctx;

	screen_write_initctx(ctx, &ttyctx, 0);

	if (s->cy == s->rupper)
		grid_view_scroll_region_down(s->grid, s->rupper, s->rlower);
	else if (s->cy > 0)
		s->cy--;

	tty_write(tty_cmd_reverseindex, &ttyctx);
}
开发者ID:HonestQiao,项目名称:tmux,代码行数:16,代码来源:screen-write.c


示例13: screen_write_clearendofline

/* Clear to end of line from cursor. */
void
screen_write_clearendofline(struct screen_write_ctx *ctx)
{
	struct screen	*s = ctx->s;
	struct tty_ctx	 ttyctx;
	u_int		 sx;

	screen_write_initctx(ctx, &ttyctx, 0);

	sx = screen_size_x(s);

	if (s->cx <= sx - 1)
		grid_view_clear(s->grid, s->cx, s->cy, sx - s->cx, 1);

	tty_write(tty_cmd_clearendofline, &ttyctx);
}
开发者ID:HonestQiao,项目名称:tmux,代码行数:17,代码来源:screen-write.c


示例14: screen_write_clearstartofline

/* Clear to start of line from cursor. */
void
screen_write_clearstartofline(struct screen_write_ctx *ctx)
{
	struct screen	*s = ctx->s;
	struct tty_ctx	 ttyctx;
	u_int		 sx;

	screen_write_initctx(ctx, &ttyctx);

	sx = screen_size_x(s);

	if (s->cx > sx - 1)
		grid_view_clear(s->grid, 0, s->cy, sx, 1);
	else
		grid_view_clear(s->grid, 0, s->cy, s->cx + 1, 1);

	tty_write(tty_cmd_clearstartofline, &ttyctx);
}
开发者ID:7heo,项目名称:tmux,代码行数:19,代码来源:screen-write.c


示例15: screen_write_clearscreen

/* Clear entire screen. */
void
screen_write_clearscreen(struct screen_write_ctx *ctx)
{
	struct screen	*s = ctx->s;
	struct tty_ctx	 ttyctx;

	screen_write_initctx(ctx, &ttyctx, 0);

	/* Scroll into history if it is enabled. */
	if (s->grid->flags & GRID_HISTORY)
		grid_view_clear_history(s->grid);
	else {
		grid_view_clear(
		    s->grid, 0, 0, screen_size_x(s), screen_size_y(s));
	}

	tty_write(tty_cmd_clearscreen, &ttyctx);
}
开发者ID:HonestQiao,项目名称:tmux,代码行数:19,代码来源:screen-write.c


示例16: screen_write_clearendofline

/* Clear to end of line from cursor. */
void
screen_write_clearendofline(struct screen_write_ctx *ctx)
{
	struct screen		*s = ctx->s;
	struct grid_line	*gl;
	struct tty_ctx		 ttyctx;
	u_int			 sx = screen_size_x(s);

	screen_write_initctx(ctx, &ttyctx);

	gl = &s->grid->linedata[s->grid->hsize + s->cy];
	if (s->cx <= sx - 1 && s->cx < gl->cellsize) {
		screen_dirty_clear(s, s->cx, s->cy, sx - 1, s->cy);
		grid_view_clear(s->grid, s->cx, s->cy, sx - s->cx, 1);
	} else
		return;

	tty_write(tty_cmd_clearendofline, &ttyctx);
}
开发者ID:ershov,项目名称:tmux,代码行数:20,代码来源:screen-write.c


示例17: screen_write_clearscreen

/* Clear entire screen. */
void
screen_write_clearscreen(struct screen_write_ctx *ctx)
{
	struct screen	*s = ctx->s;
	struct tty_ctx	 ttyctx;
	u_int		 sx = screen_size_x(s), sy = screen_size_y(s);

	screen_write_initctx(ctx, &ttyctx);

	screen_dirty_clear(s, 0, 0, sx - 1, sy  - 1);

	/* Scroll into history if it is enabled. */
	if (s->grid->flags & GRID_HISTORY)
		grid_view_clear_history(s->grid);
	else
		grid_view_clear(s->grid, 0, 0, sx, sy);

	tty_write(tty_cmd_clearscreen, &ttyctx);
}
开发者ID:ershov,项目名称:tmux,代码行数:20,代码来源:screen-write.c


示例18: screen_write_flush

/* Flush outstanding cell writes. */
static void
screen_write_flush(struct screen_write_ctx *ctx)
{
	struct screen	*s = ctx->s;
	struct tty_ctx	 ttyctx;
	u_int		 x, y, offset, cx, cy, dirty;
	struct grid_cell gc;

	if (ctx->dirty == 0)
		return;
	dirty = 0;
	log_debug("%s: dirty %u", __func__, ctx->dirty);

	cx = s->cx;
	cy = s->cy;

	offset = 0;
	for (y = 0; y < screen_size_y(s); y++) {
		for (x = 0; x < screen_size_x(s); x++) {
			offset++;
			if (!bit_test(s->dirty, offset - 1))
				continue;
			bit_clear(s->dirty, offset - 1);

			screen_write_cursormove(ctx, x, y);
			grid_view_get_cell(s->grid, x, y, &gc);

			screen_write_initctx(ctx, &ttyctx);
			ttyctx.cell = &gc;
			tty_write(tty_cmd_cell, &ttyctx);
			ctx->written++;

			if (++dirty == ctx->dirty)
				break;
		}
		if (dirty == ctx->dirty)
			break;
	}
	ctx->dirty = 0;

	s->cx = cx;
	s->cy = cy;
}
开发者ID:CraZySacX,项目名称:tmux,代码行数:44,代码来源:screen-write.c


示例19: screen_write_clearendofline

/* Clear to end of line from cursor. */
void
screen_write_clearendofline(struct screen_write_ctx *ctx, u_int bg)
{
	struct screen		*s = ctx->s;
	struct grid_line	*gl;
	struct tty_ctx		 ttyctx;
	u_int			 sx = screen_size_x(s);

	screen_write_initctx(ctx, &ttyctx);
	ttyctx.bg = bg;

	gl = &s->grid->linedata[s->grid->hsize + s->cy];
	if (s->cx > sx - 1 || (s->cx >= gl->cellsize && bg == 8))
		return;

	screen_dirty_clear(s, s->cx, s->cy, sx - 1, s->cy);
	grid_view_clear(s->grid, s->cx, s->cy, sx - s->cx, 1, bg);

	tty_write(tty_cmd_clearendofline, &ttyctx);
}
开发者ID:CraZySacX,项目名称:tmux,代码行数:21,代码来源:screen-write.c


示例20: screen_write_clearstartofline

/* Clear to start of line from cursor. */
void
screen_write_clearstartofline(struct screen_write_ctx *ctx, u_int bg)
{
	struct screen	*s = ctx->s;
	struct tty_ctx	 ttyctx;
	u_int		 sx = screen_size_x(s);

	screen_write_initctx(ctx, &ttyctx);
	ttyctx.bg = bg;

	if (s->cx > sx - 1) {
		screen_dirty_clear(s, 0, s->cy, sx - 1, s->cy);
		grid_view_clear(s->grid, 0, s->cy, sx, 1, bg);
	} else {
		screen_dirty_clear(s, 0, s->cy, s->cx, s->cy);
		grid_view_clear(s->grid, 0, s->cy, s->cx + 1, 1, bg);
	}

	tty_write(tty_cmd_clearstartofline, &ttyctx);
}
开发者ID:CraZySacX,项目名称:tmux,代码行数:21,代码来源:screen-write.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ scriptDebugServer函数代码示例发布时间:2022-05-30
下一篇:
C++ screen_write_cursormove函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap