Esempio n. 1
0
/******************************************************************
 *		next_line
 *
 * WriteConsoleOutput helper: handles passing to next line (+scrolling if necessary)
 *
 */
static int	next_line(HANDLE hCon, CONSOLE_SCREEN_BUFFER_INFO* csbi)
{
    SMALL_RECT	src;
    CHAR_INFO	ci;
    COORD	dst;

    csbi->dwCursorPosition.X = 0;
    csbi->dwCursorPosition.Y++;

    if (csbi->dwCursorPosition.Y < csbi->dwSize.Y) return 1;

    src.Top    = 1;
    src.Bottom = csbi->dwSize.Y - 1;
    src.Left   = 0;
    src.Right  = csbi->dwSize.X - 1;

    dst.X      = 0;
    dst.Y      = 0;

    ci.Attributes = csbi->wAttributes;
    ci.Char.UnicodeChar = ' ';

    csbi->dwCursorPosition.Y--;
    if (!ScrollConsoleScreenBufferW(hCon, &src, NULL, dst, &ci))
	return 0;
    return 1;
}
Esempio n. 2
0
void
insline (void)
{
    COORD coord;
    SMALL_RECT rect;
    CHAR_INFO fillchar;

    __fill_text_info();
    coord.X = __CONIO_LEFT;
    coord.Y = __CONIO_TOP + __text_info.cury;
    rect.Left = __CONIO_LEFT;
    rect.Top = __CONIO_TOP + __text_info.cury - 1;
    rect.Right = __CONIO_LEFT + __text_info.screenwidth - 1;
    rect.Bottom = __CONIO_TOP + __text_info.screenheight - 2;
    fillchar.Attributes = __FOREGROUND + (__BACKGROUND << 4);
#ifdef UNICODE
    fillchar.Char.UnicodeChar = L' ';
    ScrollConsoleScreenBufferW (GetStdHandle (STD_OUTPUT_HANDLE),
      &rect, NULL, coord, &fillchar);
#else
    fillchar.Char.AsciiChar = ' ';
    ScrollConsoleScreenBufferA (GetStdHandle (STD_OUTPUT_HANDLE),
      &rect, NULL, coord, &fillchar);
#endif

    gotoxy (__text_info.curx, __text_info.cury);
}
Esempio n. 3
0
/******************************************************************************
 * ScrollConsoleScreenBufferA [KERNEL32.@]
 *
 */
BOOL WINAPI ScrollConsoleScreenBufferA(HANDLE hConsoleOutput, LPSMALL_RECT lpScrollRect,
				       LPSMALL_RECT lpClipRect, COORD dwDestOrigin,
				       LPCHAR_INFO lpFill)
{
    CHAR_INFO	ciw;

    ciw.Attributes = lpFill->Attributes;
    MultiByteToWideChar(CP_ACP, 0, &lpFill->Char.AsciiChar, 1, &ciw.Char.UnicodeChar, 1);

    return ScrollConsoleScreenBufferW(hConsoleOutput, lpScrollRect, lpClipRect,
				      dwDestOrigin, &ciw);
}
Esempio n. 4
0
static void scroll(int left, int right, int top, int bottom, int xoffset, int yoffset)
{
	CHAR_INFO fill_char;
	fill_char.Attributes = DEFAULT_ATTRIBUTE;
	fill_char.Char.UnicodeChar = L' ';
	SMALL_RECT rect;
	rect.Left = left;
	rect.Right = right;
	rect.Top = console->top + top;
	rect.Bottom = console->top + bottom;
	COORD origin;
	origin.X = left + xoffset;
	origin.Y = console->top + top + yoffset;
	ScrollConsoleScreenBufferW(console->out, &rect, &rect, origin, &fill_char);
}
Esempio n. 5
0
void insline(void)
{
	COORD c;
	SMALL_RECT r;
	CHAR_INFO fc;
	init_ti();
	c.X = ti.winleft - 1;
	c.Y = ti.wintop - 1 + ti.cury;
	r.Left = ti.winleft - 1;
	r.Top = ti.wintop - 1 + ti.cury - 1;
	r.Right = ti.winright - 1;
	r.Bottom = ti.winbottom - 2;
	fc.Attributes = ti.attribute;
	fc.Char.UnicodeChar = L' ';
	ScrollConsoleScreenBufferW(GetStdHandle(STD_OUTPUT_HANDLE), &r, NULL, c, &fc);
	gotoxy(ti.curx, ti.cury);
}