Changeset 7ce3cb2 in mainline
- Timestamp:
- 2009-04-02T22:04:29Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b888d5f
- Parents:
- 58d5a7e7
- Location:
- uspace
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/libc/include/sys/types.h
r58d5a7e7 r7ce3cb2 43 43 typedef int mode_t; 44 44 45 typedef int32_t wchar_t; 46 45 47 typedef volatile uint8_t ioport8_t; 46 48 typedef volatile uint16_t ioport16_t; -
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 -
uspace/srv/fb/fb.c
r58d5a7e7 r7ce3cb2 98 98 /** Backbuffer character cell. */ 99 99 typedef struct { 100 uint 8_t glyph;100 uint32_t glyph; 101 101 uint32_t fg_color; 102 102 uint32_t bg_color; … … 195 195 196 196 static void draw_glyph_aligned(unsigned int x, unsigned int y, bool cursor, 197 uint8_t *glyphs, uint 8_t glyph, uint32_t fg_color, uint32_t bg_color);197 uint8_t *glyphs, uint32_t glyph, uint32_t fg_color, uint32_t bg_color); 198 198 static void draw_glyph_fallback(unsigned int x, unsigned int y, bool cursor, 199 uint8_t *glyphs, uint 8_t glyph, uint32_t fg_color, uint32_t bg_color);199 uint8_t *glyphs, uint32_t glyph, uint32_t fg_color, uint32_t bg_color); 200 200 201 201 static void draw_vp_glyph(viewport_t *vport, bool cursor, unsigned int col, … … 660 660 */ 661 661 static void draw_glyph_aligned(unsigned int x, unsigned int y, bool cursor, 662 uint8_t *glyphs, uint 8_t glyph, uint32_t fg_color, uint32_t bg_color)662 uint8_t *glyphs, uint32_t glyph, uint32_t fg_color, uint32_t bg_color) 663 663 { 664 664 unsigned int i, yd; … … 667 667 unsigned long mask; 668 668 unsigned int ww, d_add; 669 670 /* Check glyph range. */ 671 if (glyph >= FONT_GLYPHS) 672 return; 669 673 670 674 /* … … 679 683 } 680 684 681 682 685 /* Pointer to the current position in the mask. */ 683 686 maskp = (unsigned long *) &glyphs[GLYPH_POS(glyph, 0, cursor)]; … … 721 724 */ 722 725 void draw_glyph_fallback(unsigned int x, unsigned int y, bool cursor, 723 uint8_t *glyphs, uint 8_t glyph, uint32_t fg_color, uint32_t bg_color)726 uint8_t *glyphs, uint32_t glyph, uint32_t fg_color, uint32_t bg_color) 724 727 { 725 728 unsigned int i, j, yd; … … 728 731 unsigned int d_add; 729 732 uint8_t b; 733 734 /* Check glyph range. */ 735 if (glyph >= FONT_GLYPHS) 736 return; 730 737 731 738 /* Pre-render 1x the foreground and background color pixels. */ … … 780 787 unsigned int y = vport->y + ROW2Y(row); 781 788 782 uint 8_t glyph;789 uint32_t glyph; 783 790 uint32_t fg_color; 784 791 uint32_t bg_color; … … 837 844 * 838 845 */ 839 static void draw_char(viewport_t *vport, uint8_t c, unsigned int col, unsigned int row)846 static void draw_char(viewport_t *vport, wchar_t c, unsigned int col, unsigned int row) 840 847 { 841 848 bb_cell_t *bbp; … … 847 854 848 855 bbp = &vport->backbuf[BB_POS(vport, col, row)]; 849 bbp->glyph = c;856 bbp->glyph = (uint32_t) c; 850 857 bbp->fg_color = vport->attr.fg_color; 851 858 bbp->bg_color = vport->attr.bg_color; … … 890 897 891 898 bbp = &vport->backbuf[BB_POS(vport, col, row)]; 892 uint 8_t glyph = bbp->glyph;899 uint32_t glyph = bbp->glyph; 893 900 894 901 a = &data[j * w + i].attrs; … … 1511 1518 unsigned int i; 1512 1519 int scroll; 1513 uint 8_t glyph;1520 uint32_t glyph; 1514 1521 unsigned int row, col; 1515 1522 -
uspace/srv/fb/serial_console.c
r58d5a7e7 r7ce3cb2 103 103 } 104 104 105 void serial_putchar(wchar_t ch) 106 { 107 (*putc_function)(ch); 108 } 109 105 110 void serial_goto(const unsigned int row, const unsigned int col) 106 111 { … … 257 262 if (!attrs_same(*a0, *a1)) 258 263 serial_set_attrs(a1); 259 (*putc_function)(field->character);264 serial_putchar(field->character); 260 265 a0 = a1; 261 266 } … … 277 282 size_t intersize = 0; 278 283 279 charc;284 wchar_t c; 280 285 int col, row, w, h; 281 286 int fgcolor; … … 344 349 lastcol = col + 1; 345 350 lastrow = row; 346 (*putc_function)(c);351 serial_putchar(c); 347 352 retval = 0; 348 353 break;
Note:
See TracChangeset
for help on using the changeset viewer.