Ignore:
Timestamp:
2011-09-16T21:13:57Z (13 years ago)
Author:
Martin Sucha <sucha14@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3a11f17
Parents:
c0e53ff (diff), fd07e526 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes

File:
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/dist/src/c/demos/tetris/screen.h

    rc0e53ff r432a269  
    11/*
    2  * Copyright (c) 2006 Josef Cejka
     2 * Copyright (c) 2011 Martin Decky
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup kbdgen
    30  * @brief HelenOS generic uspace keyboard handler.
    31  * @ingroup kbd
     29/** Attributations
     30 *
     31 * screen.h 8.1 (Berkeley) 5/31/93
     32 * NetBSD: screen.h,v 1.2 1995/04/22 07:42:42 cgd
     33 * OpenBSD: screen.h,v 1.5 2003/06/03 03:01:41 millert
     34 *
     35 * Based upon BSD Tetris
     36 *
     37 * Copyright (c) 1992, 1993
     38 *      The Regents of the University of California.
     39 *      Distributed under BSD license.
     40 *
     41 * This code is derived from software contributed to Berkeley by
     42 * Chris Torek and Darren F. Provine.
     43 *
     44 */
     45
     46/** @addtogroup tetris
    3247 * @{
    3348 */
     
    3550 */
    3651
    37 #ifndef __KEYBUFFER_H__
    38 #define __KEYBUFFER_H__
     52/*
     53 * putpad() is for padded strings with count = 1.
     54 */
     55#define putpad(s)  tputs(s, 1, put)
    3956
    4057#include <sys/types.h>
    4158#include <io/console.h>
     59#include <async.h>
    4260#include <bool.h>
    4361
    44 /** Size of buffer for pressed keys */
    45 #define KEYBUFFER_SIZE  128
     62typedef struct {
     63        sysarg_t ws_row;
     64        sysarg_t ws_col;
     65} winsize_t;
    4666
    47 typedef struct {
    48         kbd_event_t fifo[KEYBUFFER_SIZE];
    49         size_t head;
    50         size_t tail;
    51         size_t items;
    52 } keybuffer_t;
     67extern console_ctrl_t *console;
     68extern winsize_t winsize;
    5369
    54 extern void keybuffer_free(keybuffer_t *);
    55 extern void keybuffer_init(keybuffer_t *);
    56 extern size_t keybuffer_available(keybuffer_t *);
    57 extern bool keybuffer_empty(keybuffer_t *);
    58 extern void keybuffer_push(keybuffer_t *, const kbd_event_t *);
    59 extern bool keybuffer_pop(keybuffer_t *, kbd_event_t *);
     70extern void moveto(sysarg_t r, sysarg_t c);
     71extern void clear_screen(void);
    6072
    61 #endif
     73extern int put(int);
     74extern void scr_clear(void);
     75extern void scr_end(void);
     76extern void scr_init(void);
     77extern void scr_msg(char *, bool);
     78extern void scr_set(void);
     79extern void scr_update(void);
    6280
    63 /**
    64  * @}
     81extern void tsleep(void);
     82extern int tgetchar(void);
     83extern int twait(void);
     84
     85/** @}
    6586 */
Note: See TracChangeset for help on using the changeset viewer.