Ignore:
File:
1 edited

Legend:

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

    r64d2b10 r79ae36dd  
    3636#define LIBC_IO_CONSOLE_H_
    3737
     38#include <sys/time.h>
     39#include <async.h>
    3840#include <bool.h>
    39 
    40 typedef enum {
    41         KEY_PRESS,
    42         KEY_RELEASE
    43 } console_ev_type_t;
     41#include <stdio.h>
    4442
    4543typedef enum {
     
    5048} console_caps_t;
    5149
     50/** Console control structure. */
     51typedef struct {
     52        /** Console input file */
     53        FILE *input;
     54       
     55        /** Console output file */
     56        FILE *output;
     57       
     58        /** Console input session */
     59        async_sess_t *input_sess;
     60       
     61        /** Console output session */
     62        async_sess_t *output_sess;
     63       
     64        /** Input request call with timeout */
     65        ipc_call_t input_call;
     66       
     67        /** Input response with timeout */
     68        aid_t input_aid;
     69} console_ctrl_t;
     70
     71typedef enum {
     72        KEY_PRESS,
     73        KEY_RELEASE
     74} kbd_event_type_t;
     75
    5276/** Console event structure. */
    5377typedef struct {
    5478        /** Press or release event. */
    55         console_ev_type_t type;
     79        kbd_event_type_t type;
    5680       
    5781        /** Keycode of the key that was pressed or released. */
     
    6387        /** The character that was generated or '\0' for none. */
    6488        wchar_t c;
    65 } console_event_t;
     89} kbd_event_t;
    6690
    67 extern void console_clear(int phone);
     91extern console_ctrl_t *console_init(FILE *, FILE *);
     92extern void console_done(console_ctrl_t *);
     93extern bool console_kcon(void);
    6894
    69 extern int console_get_size(int phone, sysarg_t *cols, sysarg_t *rows);
    70 extern int console_get_pos(int phone, sysarg_t *col, sysarg_t *row);
    71 extern void console_set_pos(int phone, sysarg_t col, sysarg_t row);
     95extern void console_flush(console_ctrl_t *);
     96extern void console_clear(console_ctrl_t *);
    7297
    73 extern void console_set_style(int phone, uint8_t style);
    74 extern void console_set_color(int phone, uint8_t fg_color, uint8_t bg_color,
    75     uint8_t flags);
    76 extern void console_set_rgb_color(int phone, uint32_t fg_color, uint32_t bg_color);
     98extern int console_get_size(console_ctrl_t *, sysarg_t *, sysarg_t *);
     99extern int console_get_pos(console_ctrl_t *, sysarg_t *, sysarg_t *);
     100extern void console_set_pos(console_ctrl_t *, sysarg_t, sysarg_t);
    77101
    78 extern void console_cursor_visibility(int phone, bool show);
    79 extern int console_get_color_cap(int phone, sysarg_t *ccap);
    80 extern void console_kcon_enable(int phone);
     102extern void console_set_style(console_ctrl_t *, uint8_t);
     103extern void console_set_color(console_ctrl_t *, uint8_t, uint8_t, uint8_t);
     104extern void console_set_rgb_color(console_ctrl_t *, uint32_t, uint32_t);
    81105
    82 extern bool console_get_event(int phone, console_event_t *event);
     106extern void console_cursor_visibility(console_ctrl_t *, bool);
     107extern int console_get_color_cap(console_ctrl_t *, sysarg_t *);
     108extern bool console_get_kbd_event(console_ctrl_t *, kbd_event_t *);
     109extern bool console_get_kbd_event_timeout(console_ctrl_t *, kbd_event_t *,
     110    suseconds_t *);
    83111
    84112#endif
Note: See TracChangeset for help on using the changeset viewer.