Changeset 1601f3c in mainline for uspace/srv/console/screenbuffer.c


Ignore:
Timestamp:
2009-05-21T15:32:42Z (16 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7d158097
Parents:
a095d20
Message:

console cleanup (no functional changes)

File:
1 edited

Legend:

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

    ra095d20 r1601f3c  
    2828
    2929/** @addtogroup console
    30  * @{ 
     30 * @{
    3131 */
    3232/** @file
     
    3838#include <unistd.h>
    3939
    40 /** Store one character to screenbuffer. Its position is determined by
    41  * scr->position_x and scr->position_y.
     40/** Store one character to screenbuffer.
    4241 *
    43  * @param scr   screenbuffer
    44  * @param c     stored character
     42 * Its position is determined by scr->position_x
     43 * and scr->position_y.
     44 *
     45 * @param scr Screenbuffer
     46 * @param c   Stored character
     47 *
    4548 */
    4649void screenbuffer_putchar(screenbuffer_t *scr, wchar_t ch)
    4750{
    48         keyfield_t *field;
    49 
    50         field = get_field_at(scr, scr->position_x, scr->position_y);
    51 
     51        keyfield_t *field =
     52            get_field_at(scr, scr->position_x, scr->position_y);
     53       
    5254        field->character = ch;
    5355        field->attrs = scr->attrs;
    5456}
    5557
    56 /** Initilize screenbuffer. Allocate space for screen content in accordance to given size.
    57  * @param scr           initialized screenbuffer
    58  * @param size_x        width in characters             
    59  * @param size_y        height in characters
    60  * @return pointer to screenbuffer (same as scr parameter) or NULL
     58/** Initilize screenbuffer.
     59 *
     60 * Allocate space for screen content in accordance to given size.
     61 *
     62 * @param scr    Initialized screenbuffer
     63 * @param size_x Width in characters
     64 * @param size_y Height in characters
     65 *
     66 * @return Pointer to screenbuffer (same as scr parameter) or NULL
     67 *
    6168 */
    6269screenbuffer_t *screenbuffer_init(screenbuffer_t *scr, int size_x, int size_y)
    6370{
    6471        scr->buffer = (keyfield_t *) malloc(sizeof(keyfield_t) * size_x * size_y);
    65         if (!scr->buffer) {
     72        if (!scr->buffer)
    6673                return NULL;
    67         }
    6874       
    6975        scr->size_x = size_x;
     
    7884}
    7985
    80 /** Clear screenbuffer.
    81  * @param scr screenbuffer
     86/** Clear screenbuffer.
     87 *
     88 * @param scr Screenbuffer
     89 *
    8290 */
    8391void screenbuffer_clear(screenbuffer_t *scr)
     
    8997                scr->buffer[i].attrs = scr->attrs;
    9098        }
    91 
     99       
    92100        scr->top_line = 0;
    93101        scr->position_y = 0;
     
    96104
    97105/** Clear one buffer line.
     106 *
    98107 * @param scr
    99108 * @param line One buffer line (not a screen line!)
     109 *
    100110 */
    101111void screenbuffer_clear_line(screenbuffer_t *scr, unsigned int line)
     
    110120
    111121/** Copy content buffer from screenbuffer to given memory.
    112  * @param scr   source screenbuffer
    113  * @param dest  destination
     122 *
     123 * @param scr  Source screenbuffer
     124 * @param dest Destination
     125 *
    114126 */
    115127void screenbuffer_copy_buffer(screenbuffer_t *scr, keyfield_t *dest)
     
    117129        unsigned int i;
    118130       
    119         for (i = 0; i < scr->size_x * scr->size_y; i++) {
     131        for (i = 0; i < scr->size_x * scr->size_y; i++)
    120132                dest[i] = scr->buffer[i];
    121         }
    122133}
    123134
    124135/** Set new cursor position in screenbuffer.
     136 *
    125137 * @param scr
    126138 * @param x
    127139 * @param y
     140 *
    128141 */
    129142void screenbuffer_goto(screenbuffer_t *scr, unsigned int x, unsigned int y)
     
    134147
    135148/** Set new style.
     149 *
    136150 * @param scr
    137151 * @param fg_color
    138152 * @param bg_color
     153 *
    139154 */
    140155void screenbuffer_set_style(screenbuffer_t *scr, int style)
     
    145160
    146161/** Set new color.
     162 *
    147163 * @param scr
    148164 * @param fg_color
    149165 * @param bg_color
     166 *
    150167 */
    151168void screenbuffer_set_color(screenbuffer_t *scr, unsigned int fg_color, unsigned int bg_color, unsigned int flags)
     
    158175
    159176/** Set new RGB color.
     177 *
    160178 * @param scr
    161179 * @param fg_color
    162180 * @param bg_color
     181 *
    163182 */
    164183void screenbuffer_set_rgb_color(screenbuffer_t *scr, unsigned int fg_color, unsigned int bg_color)
     
    169188}
    170189
    171  
    172190/** @}
    173191 */
Note: See TracChangeset for help on using the changeset viewer.