Ignore:
File:
1 edited

Legend:

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

    r79ae36dd r64d2b10  
    3636#define LIBC_IO_CONSOLE_H_
    3737
    38 #include <sys/time.h>
    39 #include <async.h>
    4038#include <bool.h>
    41 #include <stdio.h>
     39
     40typedef enum {
     41        KEY_PRESS,
     42        KEY_RELEASE
     43} console_ev_type_t;
    4244
    4345typedef enum {
     
    4850} console_caps_t;
    4951
    50 /** Console control structure. */
    51 typedef 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 
    71 typedef enum {
    72         KEY_PRESS,
    73         KEY_RELEASE
    74 } kbd_event_type_t;
    75 
    7652/** Console event structure. */
    7753typedef struct {
    7854        /** Press or release event. */
    79         kbd_event_type_t type;
     55        console_ev_type_t type;
    8056       
    8157        /** Keycode of the key that was pressed or released. */
     
    8763        /** The character that was generated or '\0' for none. */
    8864        wchar_t c;
    89 } kbd_event_t;
     65} console_event_t;
    9066
    91 extern console_ctrl_t *console_init(FILE *, FILE *);
    92 extern void console_done(console_ctrl_t *);
    93 extern bool console_kcon(void);
     67extern void console_clear(int phone);
    9468
    95 extern void console_flush(console_ctrl_t *);
    96 extern void console_clear(console_ctrl_t *);
     69extern int console_get_size(int phone, sysarg_t *cols, sysarg_t *rows);
     70extern int console_get_pos(int phone, sysarg_t *col, sysarg_t *row);
     71extern void console_set_pos(int phone, sysarg_t col, sysarg_t row);
    9772
    98 extern int console_get_size(console_ctrl_t *, sysarg_t *, sysarg_t *);
    99 extern int console_get_pos(console_ctrl_t *, sysarg_t *, sysarg_t *);
    100 extern void console_set_pos(console_ctrl_t *, sysarg_t, sysarg_t);
     73extern void console_set_style(int phone, uint8_t style);
     74extern void console_set_color(int phone, uint8_t fg_color, uint8_t bg_color,
     75    uint8_t flags);
     76extern void console_set_rgb_color(int phone, uint32_t fg_color, uint32_t bg_color);
    10177
    102 extern void console_set_style(console_ctrl_t *, uint8_t);
    103 extern void console_set_color(console_ctrl_t *, uint8_t, uint8_t, uint8_t);
    104 extern void console_set_rgb_color(console_ctrl_t *, uint32_t, uint32_t);
     78extern void console_cursor_visibility(int phone, bool show);
     79extern int console_get_color_cap(int phone, sysarg_t *ccap);
     80extern void console_kcon_enable(int phone);
    10581
    106 extern void console_cursor_visibility(console_ctrl_t *, bool);
    107 extern int console_get_color_cap(console_ctrl_t *, sysarg_t *);
    108 extern bool console_get_kbd_event(console_ctrl_t *, kbd_event_t *);
    109 extern bool console_get_kbd_event_timeout(console_ctrl_t *, kbd_event_t *,
    110     suseconds_t *);
     82extern bool console_get_event(int phone, console_event_t *event);
    11183
    11284#endif
Note: See TracChangeset for help on using the changeset viewer.