Changeset 424cd43 in mainline for uspace/srv/console/screenbuffer.h


Ignore:
Timestamp:
2009-06-03T18:39:12Z (16 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8dc12ac
Parents:
b0a91acb
Message:

console server rewrite: use VFS_READ/VFS_WRITE for generic I/O, register separate virtual consoles using device mapper

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/console/screenbuffer.h

    rb0a91acb r424cd43  
    3838#include <stdint.h>
    3939#include <sys/types.h>
     40#include <bool.h>
    4041
    41 #define DEFAULT_FOREGROUND 0x0       /**< default console foreground color */
    42 #define DEFAULT_BACKGROUND 0xf0f0f0  /**< default console background color */
     42#define DEFAULT_FOREGROUND  0x0       /**< default console foreground color */
     43#define DEFAULT_BACKGROUND  0xf0f0f0  /**< default console background color */
    4344
    4445typedef struct {
     
    7374typedef struct {
    7475        wchar_t character;  /**< Character itself */
    75         attrs_t attrs;      /**< Character`s attributes */
     76        attrs_t attrs;      /**< Character attributes */
    7677} keyfield_t;
    7778
     
    7980 */
    8081typedef struct {
    81         keyfield_t *buffer;               /**< Screen content - characters and
    82                                                their attributes (used as a circular buffer) */
    83         unsigned int size_x;              /**< Number of columns  */
    84         unsigned int size_y;              /**< Number of rows */
     82        keyfield_t *buffer;      /**< Screen content - characters and
     83                                      their attributes (used as a circular buffer) */
     84        size_t size_x;           /**< Number of columns  */
     85        size_t size_y;           /**< Number of rows */
    8586       
    8687        /** Coordinates of last printed character for determining cursor position */
    87         unsigned int position_x;
    88         unsigned int position_y;
     88        size_t position_x;
     89        size_t position_y;
    8990       
    90         attrs_t attrs;                    /**< Current attributes. */
    91         unsigned int top_line;            /**< Points to buffer[][] line that will
    92                                                be printed at screen as the first line */
    93         unsigned char is_cursor_visible;  /**< Cursor state - default is visible */
     91        attrs_t attrs;           /**< Current attributes. */
     92        size_t top_line;         /**< Points to buffer[][] line that will
     93                                      be printed at screen as the first line */
     94        bool is_cursor_visible;  /**< Cursor state - default is visible */
    9495} screenbuffer_t;
    9596
     
    106107 *
    107108 */
    108 static inline keyfield_t *get_field_at(screenbuffer_t *scr, unsigned int x, unsigned int y)
     109static inline keyfield_t *get_field_at(screenbuffer_t *scr, size_t x, size_t y)
    109110{
    110111        return scr->buffer + x + ((y + scr->top_line) % scr->size_y) * scr->size_x;
     
    139140
    140141void screenbuffer_putchar(screenbuffer_t *scr, wchar_t c);
    141 screenbuffer_t *screenbuffer_init(screenbuffer_t *scr, int size_x, int size_y);
     142screenbuffer_t *screenbuffer_init(screenbuffer_t *scr, size_t size_x, size_t size_y);
    142143
    143144void screenbuffer_clear(screenbuffer_t *scr);
    144 void screenbuffer_clear_line(screenbuffer_t *scr, unsigned int line);
     145void screenbuffer_clear_line(screenbuffer_t *scr, size_t line);
    145146void screenbuffer_copy_buffer(screenbuffer_t *scr, keyfield_t *dest);
    146 void screenbuffer_goto(screenbuffer_t *scr, unsigned int x, unsigned int y);
    147 void screenbuffer_set_style(screenbuffer_t *scr, int style);
    148 void screenbuffer_set_color(screenbuffer_t *scr, unsigned int fg_color,
    149     unsigned int bg_color, unsigned int attr);
    150 void screenbuffer_set_rgb_color(screenbuffer_t *scr, unsigned int fg_color,
    151     unsigned int bg_color);
     147void screenbuffer_goto(screenbuffer_t *scr, size_t x, size_t y);
     148void screenbuffer_set_style(screenbuffer_t *scr, uint8_t style);
     149void screenbuffer_set_color(screenbuffer_t *scr, uint8_t fg_color,
     150    uint8_t bg_color, uint8_t attr);
     151void screenbuffer_set_rgb_color(screenbuffer_t *scr, uint32_t fg_color,
     152    uint32_t bg_color);
    152153
    153154#endif
Note: See TracChangeset for help on using the changeset viewer.