Changeset 7ce3cb2 in mainline for uspace/srv/fb


Ignore:
Timestamp:
2009-04-02T22:04:29Z (17 years ago)
Author:
Jiri Svoboda <jirik.svoboda@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b888d5f
Parents:
58d5a7e7
Message:

Define wchar_t in userspace. Use it in fb and console.

Location:
uspace/srv/fb
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fb/fb.c

    r58d5a7e7 r7ce3cb2  
    9898/** Backbuffer character cell. */
    9999typedef struct {
    100         uint8_t glyph;
     100        uint32_t glyph;
    101101        uint32_t fg_color;
    102102        uint32_t bg_color;
     
    195195
    196196static void draw_glyph_aligned(unsigned int x, unsigned int y, bool cursor,
    197     uint8_t *glyphs, uint8_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);
    198198static void draw_glyph_fallback(unsigned int x, unsigned int y, bool cursor,
    199     uint8_t *glyphs, uint8_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);
    200200
    201201static void draw_vp_glyph(viewport_t *vport, bool cursor, unsigned int col,
     
    660660 */
    661661static void draw_glyph_aligned(unsigned int x, unsigned int y, bool cursor,
    662     uint8_t *glyphs, uint8_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)
    663663{
    664664        unsigned int i, yd;
     
    667667        unsigned long mask;
    668668        unsigned int ww, d_add;
     669
     670        /* Check glyph range. */
     671        if (glyph >= FONT_GLYPHS)
     672                return;
    669673
    670674        /*
     
    679683        }
    680684
    681 
    682685        /* Pointer to the current position in the mask. */
    683686        maskp = (unsigned long *) &glyphs[GLYPH_POS(glyph, 0, cursor)];
     
    721724 */
    722725void draw_glyph_fallback(unsigned int x, unsigned int y, bool cursor,
    723     uint8_t *glyphs, uint8_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)
    724727{
    725728        unsigned int i, j, yd;
     
    728731        unsigned int d_add;
    729732        uint8_t b;
     733
     734        /* Check glyph range. */
     735        if (glyph >= FONT_GLYPHS)
     736                return;
    730737
    731738        /* Pre-render 1x the foreground and background color pixels. */
     
    780787        unsigned int y = vport->y + ROW2Y(row);
    781788
    782         uint8_t glyph;
     789        uint32_t glyph;
    783790        uint32_t fg_color;
    784791        uint32_t bg_color;
     
    837844 *
    838845 */
    839 static void draw_char(viewport_t *vport, uint8_t c, unsigned int col, unsigned int row)
     846static void draw_char(viewport_t *vport, wchar_t c, unsigned int col, unsigned int row)
    840847{
    841848        bb_cell_t *bbp;
     
    847854
    848855        bbp = &vport->backbuf[BB_POS(vport, col, row)];
    849         bbp->glyph = c;
     856        bbp->glyph = (uint32_t) c;
    850857        bbp->fg_color = vport->attr.fg_color;
    851858        bbp->bg_color = vport->attr.bg_color;
     
    890897
    891898                        bbp = &vport->backbuf[BB_POS(vport, col, row)];
    892                         uint8_t glyph = bbp->glyph;
     899                        uint32_t glyph = bbp->glyph;
    893900
    894901                        a = &data[j * w + i].attrs;
     
    15111518                unsigned int i;
    15121519                int scroll;
    1513                 uint8_t glyph;
     1520                uint32_t glyph;
    15141521                unsigned int row, col;
    15151522               
  • uspace/srv/fb/serial_console.c

    r58d5a7e7 r7ce3cb2  
    103103}
    104104
     105void serial_putchar(wchar_t ch)
     106{
     107        (*putc_function)(ch);
     108}
     109
    105110void serial_goto(const unsigned int row, const unsigned int col)
    106111{
     
    257262                        if (!attrs_same(*a0, *a1))
    258263                                serial_set_attrs(a1);
    259                         (*putc_function)(field->character);
     264                        serial_putchar(field->character);
    260265                        a0 = a1;
    261266                }
     
    277282        size_t intersize = 0;
    278283
    279         char c;
     284        wchar_t c;
    280285        int col, row, w, h;
    281286        int fgcolor;
     
    344349                        lastcol = col + 1;
    345350                        lastrow = row;
    346                         (*putc_function)(c);
     351                        serial_putchar(c);
    347352                        retval = 0;
    348353                        break;
Note: See TracChangeset for help on using the changeset viewer.