Ignore:
Timestamp:
2010-04-19T19:58:18Z (14 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/console/screenbuffer.h

    rcaad59a r9f1362d4  
    3838#include <stdint.h>
    3939#include <sys/types.h>
     40#include <ipc/ipc.h>
    4041#include <bool.h>
    4142
    42 #define DEFAULT_FOREGROUND  0x0       /**< default console foreground color */
     43#define DEFAULT_FOREGROUND  0x000000  /**< default console foreground color */
    4344#define DEFAULT_BACKGROUND  0xf0f0f0  /**< default console background color */
    4445
     
    8283        keyfield_t *buffer;      /**< Screen content - characters and
    8384                                      their attributes (used as a circular buffer) */
    84         size_t size_x;           /**< Number of columns  */
    85         size_t size_y;           /**< Number of rows */
     85        ipcarg_t size_x;         /**< Number of columns  */
     86        ipcarg_t size_y;         /**< Number of rows */
    8687       
    8788        /** Coordinates of last printed character for determining cursor position */
    88         size_t position_x;
    89         size_t position_y;
     89        ipcarg_t position_x;
     90        ipcarg_t position_y;
    9091       
    9192        attrs_t attrs;           /**< Current attributes. */
     
    107108 *
    108109 */
    109 static inline keyfield_t *get_field_at(screenbuffer_t *scr, size_t x, size_t y)
     110static inline keyfield_t *get_field_at(screenbuffer_t *scr, ipcarg_t x, ipcarg_t y)
    110111{
    111112        return scr->buffer + x + ((y + scr->top_line) % scr->size_y) * scr->size_x;
     
    140141}
    141142
     143extern void screenbuffer_putchar(screenbuffer_t *, wchar_t);
     144extern screenbuffer_t *screenbuffer_init(screenbuffer_t *, ipcarg_t, ipcarg_t);
    142145
    143 void screenbuffer_putchar(screenbuffer_t *scr, wchar_t c);
    144 screenbuffer_t *screenbuffer_init(screenbuffer_t *scr, size_t size_x, size_t size_y);
    145 
    146 void screenbuffer_clear(screenbuffer_t *scr);
    147 void screenbuffer_clear_line(screenbuffer_t *scr, size_t line);
    148 void screenbuffer_copy_buffer(screenbuffer_t *scr, keyfield_t *dest);
    149 void screenbuffer_goto(screenbuffer_t *scr, size_t x, size_t y);
    150 void screenbuffer_set_style(screenbuffer_t *scr, uint8_t style);
    151 void screenbuffer_set_color(screenbuffer_t *scr, uint8_t fg_color,
    152     uint8_t bg_color, uint8_t attr);
    153 void screenbuffer_set_rgb_color(screenbuffer_t *scr, uint32_t fg_color,
    154     uint32_t bg_color);
     146extern void screenbuffer_clear(screenbuffer_t *);
     147extern void screenbuffer_clear_line(screenbuffer_t *, ipcarg_t);
     148extern void screenbuffer_copy_buffer(screenbuffer_t *, keyfield_t *);
     149extern void screenbuffer_goto(screenbuffer_t *, ipcarg_t, ipcarg_t);
     150extern void screenbuffer_set_style(screenbuffer_t *, uint8_t);
     151extern void screenbuffer_set_color(screenbuffer_t *, uint8_t, uint8_t, uint8_t);
     152extern void screenbuffer_set_rgb_color(screenbuffer_t *, uint32_t, uint32_t);
    155153
    156154#endif
Note: See TracChangeset for help on using the changeset viewer.