Changeset 9f1362d4 in mainline for uspace/srv/hid/fb/fb.c


Ignore:
Timestamp:
2010-04-19T19:58:18Z (15 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
369a5f8
Parents:
caad59a
Message:

console output improvements

  • define new generic styles (STYLE_INVERTED for inverted print and STYLE_SELECTION for selections), use them primarily instead of specifying colors or RGBs
  • use console_set_style(fphone(stdout), STYLE_NORMAL) as the correct mean for reseting console settings (instead of specifying conrete hardcoded colors)
  • rename console_goto() to console_set_pos() (consistency with console_get_pos())
  • use semantically correct unsigned types for console sizes and cursor positions (instead of signed types)
  • use unsigned types for sizes and positions in libclui
  • top: nicer screen redrawing (do not use console_clear() which causes flickering, but repaint the screen properly — not entirely finished yet)
  • initialize mouse pointer coordinates (so the mouse cursor does not behave erratic after boot, unfortunatelly this does not solve ticket #223)
File:
1 edited

Legend:

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

    rcaad59a r9f1362d4  
    7272#define DEFAULT_FGCOLOR  0x000000
    7373
    74 #define GLYPH_UNAVAIL    '?'
    75 
    76 #define MAX_ANIM_LEN     8
    77 #define MAX_ANIMATIONS   4
    78 #define MAX_PIXMAPS      256  /**< Maximum number of saved pixmaps */
    79 #define MAX_VIEWPORTS    128  /**< Viewport is a rectangular area on the screen */
     74#define GLYPH_UNAVAIL  '?'
     75
     76#define MAX_ANIM_LEN    8
     77#define MAX_ANIMATIONS  4
     78#define MAX_PIXMAPS     256  /**< Maximum number of saved pixmaps */
     79#define MAX_VIEWPORTS   128  /**< Viewport is a rectangular area on the screen */
    8080
    8181/** Function to render a pixel from a RGB value. */
     
    956956        bb_cell_t *bbp;
    957957        attrs_t *a;
    958         attr_rgb_t rgb;
    959958       
    960959        for (j = 0; j < h; j++) {
     
    966965                       
    967966                        a = &data[j * w + i].attrs;
     967                       
     968                        attr_rgb_t rgb;
     969                        rgb.fg_color = 0;
     970                        rgb.bg_color = 0;
    968971                        rgb_from_attr(&rgb, a);
    969972                       
     
    15111514                rgb->bg_color = color_table[COLOR_WHITE];
    15121515                break;
     1516        case STYLE_INVERTED:
     1517                rgb->fg_color = color_table[COLOR_WHITE];
     1518                rgb->bg_color = color_table[COLOR_BLACK];
     1519                break;
     1520        case STYLE_SELECTED:
     1521                rgb->fg_color = color_table[COLOR_WHITE];
     1522                rgb->bg_color = color_table[COLOR_RED];
     1523                break;
    15131524        default:
    15141525                return EINVAL;
    15151526        }
    1516 
     1527       
    15171528        return EOK;
    15181529}
Note: See TracChangeset for help on using the changeset viewer.