Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 1574 → Rev 1575

//uspace/trunk/console/screenbuffer.h
52,6 → 52,7
unsigned int position_x, position_y; /**< Coordinates of last printed character for determining cursor position */
style_t style; /**< Current style */
unsigned int top_line; /**< Points to buffer[][] line that will be printed at screen as the first line */
unsigned char is_cursor_visible; /**< Cursor state - default is visible */
} screenbuffer_t;
 
/** Returns keyfield for position on screen. Screenbuffer->buffer is cyclic buffer so we must couted in index of the topmost line.
//uspace/trunk/console/console.c
247,9 → 247,8
interbuffer[i + j*conn->screenbuffer.size_x] = *get_field_at(&(conn->screenbuffer),i, j);
/* This call can preempt, but we are already at the end */
sync_send_2(fb_info.phone, FB_DRAW_TEXT_DATA, 0, 0, NULL, NULL);
curs_visibility(1);
curs_visibility(conn->screenbuffer.is_cursor_visible);
} else {
curs_visibility(0);
clrscr();
for (i = 0; i < conn->screenbuffer.size_x; i++)
259,7 → 258,7
prtchr(c, j, i);
}
curs_visibility(1);
curs_visibility(conn->screenbuffer.is_cursor_visible);
}
}
 
381,6 → 380,12
set_style_col(arg1, arg2);
break;
case CONSOLE_CURSOR_VISIBILITY:
arg1 = IPC_GET_ARG1(call);
connections[consnum].screenbuffer.is_cursor_visible = arg1;
if (consnum == active_console)
curs_visibility(arg1);
break;
case CONSOLE_GETCHAR:
if (keybuffer_empty(&(connections[consnum].keybuffer))) {
/* buffer is empty -> store request */
393,7 → 398,7
}
continue;
};
keybuffer_pop(&(connections[consnum].keybuffer), (char *)&arg1);
keybuffer_pop(&(connections[consnum].keybuffer), (int *)&arg1);
break;
}
464,8 → 469,8
 
async_new_connection(phonehash, 0, NULL, keyboard_events);
sync_send_2(fb_info.phone, FB_CURSOR_GOTO, 0, 0, NULL, NULL);
nsend_call(fb_info.phone, FB_CURSOR_VISIBILITY, 1);
curs_goto(0,0);
curs_visibility(connections[active_console].screenbuffer.is_cursor_visible);
 
/* Register at NS */
if (ipc_connect_to_me(PHONE_NS, SERVICE_CONSOLE, 0, &phonehash) != 0) {
//uspace/trunk/console/console.h
40,6 → 40,7
#define CONSOLE_GETSIZE 1030
#define CONSOLE_FLUSH 1031
#define CONSOLE_SET_STYLE 1032
#define CONSOLE_CURSOR_VISIBILITY 1033
 
#endif
 
//uspace/trunk/console/screenbuffer.c
60,6 → 60,7
scr->size_y = size_y;
scr->style.fg_color = DEFAULT_FOREGROUND;
scr->style.bg_color = DEFAULT_BACKGROUND;
scr->is_cursor_visible = 1;
screenbuffer_clear(scr);
//uspace/trunk/tetris/screen.c
113,6 → 113,7
scr_init(void)
{
con_phone = get_fd_phone(1);
send_call(con_phone, CONSOLE_CURSOR_VISIBILITY, 0);
resume_normal();
scr_clear();
}