Subversion Repositories HelenOS

Rev

Rev 4173 | Rev 4226 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4173 Rev 4211
Line 101... Line 101...
101
#define CWRITE_BUF_SIZE 256
101
#define CWRITE_BUF_SIZE 256
102
 
102
 
103
/** Buffer for receiving data via the CONSOLE_WRITE call from the client. */
103
/** Buffer for receiving data via the CONSOLE_WRITE call from the client. */
104
static char cwrite_buf[CWRITE_BUF_SIZE];
104
static char cwrite_buf[CWRITE_BUF_SIZE];
105
 
105
 
106
static void fb_putchar(char c, int row, int col);
106
static void fb_putchar(wchar_t c, int row, int col);
107
 
107
 
108
 
108
 
109
/** Find unused virtual console.
109
/** Find unused virtual console.
110
 *
110
 *
111
 */
111
 */
Line 249... Line 249...
249
    ++fb_pending.n;
249
    ++fb_pending.n;
250
}
250
}
251
 
251
 
252
 
252
 
253
/** Print a character to the active VC with buffering. */
253
/** Print a character to the active VC with buffering. */
254
static void fb_putchar(char c, int row, int col)
254
static void fb_putchar(wchar_t c, int row, int col)
255
{
255
{
256
    async_msg_3(fb_info.phone, FB_PUTCHAR, c, row, col);
256
    async_msg_3(fb_info.phone, FB_PUTCHAR, c, row, col);
257
}
257
}
258
 
258
 
259
/** Process a character from the client (TTY emulation). */
259
/** Process a character from the client (TTY emulation). */
260
static void write_char(int console, char key)
260
static void write_char(int console, wchar_t ch)
261
{
261
{
262
    bool flush_cursor = false;
262
    bool flush_cursor = false;
263
    screenbuffer_t *scr = &(connections[console].screenbuffer);
263
    screenbuffer_t *scr = &(connections[console].screenbuffer);
264
 
264
 
265
    switch (key) {
265
    switch (ch) {
266
    case '\n':
266
    case '\n':
267
        fb_pending_flush();
267
        fb_pending_flush();
268
        flush_cursor = true;
268
        flush_cursor = true;
269
        scr->position_y++;
269
        scr->position_y++;
270
        scr->position_x = 0;
270
        scr->position_x = 0;
Line 285... Line 285...
285
        break;
285
        break;
286
    default:   
286
    default:   
287
        if (console == active_console)
287
        if (console == active_console)
288
            cell_mark_changed(scr->position_y, scr->position_x);
288
            cell_mark_changed(scr->position_y, scr->position_x);
289
 
289
 
290
        screenbuffer_putchar(scr, key);
290
        screenbuffer_putchar(scr, ch);
291
        scr->position_x++;
291
        scr->position_x++;
292
    }
292
    }
293
 
293
 
294
    if (scr->position_x >= scr->size_x) {
294
    if (scr->position_x >= scr->size_x) {
295
        flush_cursor = true;
295
        flush_cursor = true;