Changeset 7ce3cb2 in mainline for uspace/srv/console
- Timestamp:
- 2009-04-02T22:04:29Z (17 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b888d5f
- Parents:
- 58d5a7e7
- Location:
- uspace/srv/console
- Files:
-
- 3 edited
-
console.c (modified) (4 diffs)
-
screenbuffer.c (modified) (1 diff)
-
screenbuffer.h (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/console/console.c
r58d5a7e7 r7ce3cb2 104 104 static char cwrite_buf[CWRITE_BUF_SIZE]; 105 105 106 static void fb_putchar( charc, int row, int col);106 static void fb_putchar(wchar_t c, int row, int col); 107 107 108 108 … … 252 252 253 253 /** Print a character to the active VC with buffering. */ 254 static void fb_putchar( charc, int row, int col)254 static void fb_putchar(wchar_t c, int row, int col) 255 255 { 256 256 async_msg_3(fb_info.phone, FB_PUTCHAR, c, row, col); … … 258 258 259 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 262 bool flush_cursor = false; 263 263 screenbuffer_t *scr = &(connections[console].screenbuffer); 264 264 265 switch ( key) {265 switch (ch) { 266 266 case '\n': 267 267 fb_pending_flush(); … … 288 288 cell_mark_changed(scr->position_y, scr->position_x); 289 289 290 screenbuffer_putchar(scr, key);290 screenbuffer_putchar(scr, ch); 291 291 scr->position_x++; 292 292 } -
uspace/srv/console/screenbuffer.c
r58d5a7e7 r7ce3cb2 44 44 * @param c stored character 45 45 */ 46 void screenbuffer_putchar(screenbuffer_t *scr, char c)46 void screenbuffer_putchar(screenbuffer_t *scr, wchar_t ch) 47 47 { 48 48 keyfield_t *field; 49 49 50 50 field = get_field_at(scr, scr->position_x, scr->position_y); 51 51 52 field->character = c ;52 field->character = ch; 53 53 field->attrs = scr->attrs; 54 54 } -
uspace/srv/console/screenbuffer.h
r58d5a7e7 r7ce3cb2 37 37 38 38 #include <stdint.h> 39 #include <sys/types.h> 39 40 40 41 #define DEFAULT_FOREGROUND 0x0 /**< default console foreground color */ … … 71 72 /** One field on screen. It contain one character and its attributes. */ 72 73 typedef struct { 73 char character;/**< Character itself */74 wchar_t character; /**< Character itself */ 74 75 attrs_t attrs; /**< Character`s attributes */ 75 76 } keyfield_t; … … 92 93 * @return keyfield structure with character and its attributes on x,y 93 94 */ 94 static inline keyfield_t *get_field_at(screenbuffer_t *scr, unsigned int x, unsigned int y) 95 static inline keyfield_t *get_field_at(screenbuffer_t *scr, unsigned int x, unsigned int y) 95 96 { 96 97 return scr->buffer + x + ((y + scr->top_line) % scr->size_y) * scr->size_x; … … 117 118 118 119 119 void screenbuffer_putchar(screenbuffer_t *scr, charc);120 void screenbuffer_putchar(screenbuffer_t *scr, wchar_t c); 120 121 screenbuffer_t *screenbuffer_init(screenbuffer_t *scr, int size_x, int size_y); 121 122
Note:
See TracChangeset
for help on using the changeset viewer.
