/trunk/uspace/srv/console/console.c |
---|
103,7 → 103,7 |
/** Buffer for receiving data via the CONSOLE_WRITE call from the client. */ |
static char cwrite_buf[CWRITE_BUF_SIZE]; |
static void fb_putchar(char c, int row, int col); |
static void fb_putchar(wchar_t c, int row, int col); |
/** Find unused virtual console. |
251,18 → 251,18 |
/** Print a character to the active VC with buffering. */ |
static void fb_putchar(char c, int row, int col) |
static void fb_putchar(wchar_t c, int row, int col) |
{ |
async_msg_3(fb_info.phone, FB_PUTCHAR, c, row, col); |
} |
/** Process a character from the client (TTY emulation). */ |
static void write_char(int console, char key) |
static void write_char(int console, wchar_t ch) |
{ |
bool flush_cursor = false; |
screenbuffer_t *scr = &(connections[console].screenbuffer); |
switch (key) { |
switch (ch) { |
case '\n': |
fb_pending_flush(); |
flush_cursor = true; |
287,7 → 287,7 |
if (console == active_console) |
cell_mark_changed(scr->position_y, scr->position_x); |
screenbuffer_putchar(scr, key); |
screenbuffer_putchar(scr, ch); |
scr->position_x++; |
} |
/trunk/uspace/srv/console/screenbuffer.c |
---|
43,13 → 43,13 |
* @param scr screenbuffer |
* @param c stored character |
*/ |
void screenbuffer_putchar(screenbuffer_t *scr, char c) |
void screenbuffer_putchar(screenbuffer_t *scr, wchar_t ch) |
{ |
keyfield_t *field; |
field = get_field_at(scr, scr->position_x, scr->position_y); |
field->character = c; |
field->character = ch; |
field->attrs = scr->attrs; |
} |
/trunk/uspace/srv/console/screenbuffer.h |
---|
36,6 → 36,7 |
#define __SCREENBUFFER_H__ |
#include <stdint.h> |
#include <sys/types.h> |
#define DEFAULT_FOREGROUND 0x0 /**< default console foreground color */ |
#define DEFAULT_BACKGROUND 0xf0f0f0 /**< default console background color */ |
70,7 → 71,7 |
/** One field on screen. It contain one character and its attributes. */ |
typedef struct { |
char character; /**< Character itself */ |
wchar_t character; /**< Character itself */ |
attrs_t attrs; /**< Character`s attributes */ |
} keyfield_t; |
91,7 → 92,7 |
* @param y position on screen |
* @return keyfield structure with character and its attributes on x,y |
*/ |
static inline keyfield_t *get_field_at(screenbuffer_t *scr, unsigned int x, unsigned int y) |
static inline keyfield_t *get_field_at(screenbuffer_t *scr, unsigned int x, unsigned int y) |
{ |
return scr->buffer + x + ((y + scr->top_line) % scr->size_y) * scr->size_x; |
} |
116,7 → 117,7 |
} |
void screenbuffer_putchar(screenbuffer_t *scr, char c); |
void screenbuffer_putchar(screenbuffer_t *scr, wchar_t c); |
screenbuffer_t *screenbuffer_init(screenbuffer_t *scr, int size_x, int size_y); |
void screenbuffer_clear(screenbuffer_t *scr); |