Changeset 6d5e378 in mainline for uspace/lib/c/include/io/charfield.h


Ignore:
Timestamp:
2012-08-16T19:27:44Z (12 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4f351432, 7d27f422
Parents:
c9d011e4
Message:

cherrypick GUI implementation (originally by Petr Koupy), with several major changes

  • for character-oriented devices a new output server and output protocol was created based on the original fb server
  • DDF visualizer drivers are pixel-oriented only
  • console and compositor can coexist in the same build
  • terminal widget is self-sufficient, no strange console nesting is needed
File:
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/include/io/charfield.h

    rc9d011e4 r6d5e378  
    11/*
    22 * Copyright (c) 2006 Josef Cejka
     3 * Copyright (c) 2011 Petr Koupy
    34 * All rights reserved.
    45 *
     
    3334 */
    3435
    35 #ifndef IMGMAP_SCREENBUFFER_H__
    36 #define IMGMAP_SCREENBUFFER_H__
     36#ifndef LIBC_IO_CHARFIELD_H_
     37#define LIBC_IO_CHARFIELD_H_
    3738
    3839#include <sys/types.h>
     
    4041#include <io/color.h>
    4142#include <io/style.h>
    42 #include "fb.h"
     43#include <io/pixel.h>
    4344
    4445typedef enum {
    45         SCREENBUFFER_FLAG_NONE = 0,
    46         SCREENBUFFER_FLAG_SHARED = 1
    47 } screenbuffer_flag_t;
     46        CHAR_FLAG_NONE = 0,
     47        CHAR_FLAG_DIRTY = 1
     48} char_flags_t;
    4849
    4950typedef enum {
     
    5253        CHAR_ATTR_RGB
    5354} char_attr_type_t;
    54 
    55 typedef enum {
    56         CHAR_FLAG_NONE = 0,
    57         CHAR_FLAG_DIRTY = 1
    58 } char_flags_t;
    5955
    6056typedef struct {
     
    6561
    6662typedef struct {
    67         pixel_t bgcolor;  /**< Background color */
    68         pixel_t fgcolor;  /**< Foreground color */
     63        pixel_t bgcolor;
     64        pixel_t fgcolor;
    6965} char_attr_rgb_t;
    7066
     
    8076} char_attrs_t;
    8177
    82 /** One field on screen. It contain one character and its attributes. */
    8378typedef struct {
    84         wchar_t ch;          /**< Character itself */
    85         char_attrs_t attrs;  /**< Character attributes */
    86         char_flags_t flags;  /**< Character flags */
     79        wchar_t ch;
     80        char_attrs_t attrs;
     81        char_flags_t flags;
    8782} charfield_t;
    8883
    89 /** Compare two sets of attributes.
    90  *
    91  * @param a1 First attribute.
    92  * @param a2 Second attribute.
    93  *
    94  * @return True on equality
    95  *
    96  */
    9784static inline bool attrs_same(char_attrs_t a1, char_attrs_t a2)
    9885{
     
    115102}
    116103
    117 extern screenbuffer_t *screenbuffer_create(sysarg_t, sysarg_t,
    118     screenbuffer_flag_t);
    119 
    120 extern charfield_t *screenbuffer_field_at(screenbuffer_t *, sysarg_t, sysarg_t);
    121 extern bool screenbuffer_cursor_at(screenbuffer_t *, sysarg_t, sysarg_t);
    122 
    123 extern sysarg_t screenbuffer_get_top_row(screenbuffer_t *);
    124 
    125 extern sysarg_t screenbuffer_putchar(screenbuffer_t *, wchar_t, bool);
    126 extern sysarg_t screenbuffer_newline(screenbuffer_t *);
    127 extern sysarg_t screenbuffer_tabstop(screenbuffer_t *, sysarg_t);
    128 extern sysarg_t screenbuffer_backspace(screenbuffer_t *);
    129 
    130 extern void screenbuffer_clear(screenbuffer_t *);
    131 extern void screenbuffer_clear_row(screenbuffer_t *, sysarg_t);
    132 
    133 extern void screenbuffer_set_cursor(screenbuffer_t *, sysarg_t, sysarg_t);
    134 extern void screenbuffer_set_cursor_visibility(screenbuffer_t *, bool);
    135 extern bool screenbuffer_get_cursor_visibility(screenbuffer_t *);
    136 
    137 extern void screenbuffer_get_cursor(screenbuffer_t *, sysarg_t *, sysarg_t *);
    138 
    139 extern void screenbuffer_set_style(screenbuffer_t *, console_style_t);
    140 extern void screenbuffer_set_color(screenbuffer_t *, console_color_t,
    141     console_color_t, console_color_attr_t);
    142 extern void screenbuffer_set_rgb_color(screenbuffer_t *, pixel_t, pixel_t);
    143 
    144104#endif
    145105
Note: See TracChangeset for help on using the changeset viewer.