示例#1
0
文件: tsm_screen.c 项目: carld/libtsm
SHL_EXPORT
void tsm_screen_move_to(struct tsm_screen *con, unsigned int x,
			    unsigned int y)
{
	unsigned int last;

	if (!con)
		return;

	screen_inc_age(con);

	if (con->flags & TSM_SCREEN_REL_ORIGIN)
		last = con->margin_bottom;
	else
		last = con->size_y - 1;

	x = to_abs_x(con, x);
	if (x >= con->size_x)
		x = con->size_x - 1;

	y = to_abs_y(con, y);
	if (y > last)
		y = last;

	move_cursor(con, x, y);
}
示例#2
0
文件: console.c 项目: mdlh/kmscon
void kmscon_console_move_to(struct kmscon_console *con, unsigned int x,
							unsigned int y)
{
	unsigned int last;

	if (!con)
		return;

	last = con->cells->scroll_y + con->cells->mtop_y;
	con->cursor_x = to_abs_x(con, x);
	if (con->cursor_x >= con->cells->size_x)
		con->cursor_x = con->cells->size_x - 1;

	con->cursor_y = to_abs_y(con, y);
	if (con->cursor_y >= last) {
		if (con->rel_addr)
			con->cursor_y = last - 1;
		else if (con->cursor_y >= con->cells->size_y)
			con->cursor_y = con->cells->size_y - 1;
	}
}
示例#3
0
void tsm_screen_move_to(struct tsm_screen *con, unsigned int x,
			    unsigned int y)
{
	unsigned int last;

	if (!con)
		return;

	if (con->flags & TSM_SCREEN_REL_ORIGIN)
		last = con->margin_bottom;
	else
		last = con->size_y - 1;

	con->cursor_x = to_abs_x(con, x);
	if (con->cursor_x >= con->size_x)
		con->cursor_x = con->size_x - 1;

	con->cursor_y = to_abs_y(con, y);
	if (con->cursor_y > last)
		con->cursor_y = last;
}