Ignore:
File:
1 edited

Legend:

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

    r7c014d1 r64d2b10  
    3636#define LIBC_IO_CONSOLE_H_
    3737
    38 #include <sys/time.h>
    39 #include <io/keycode.h>
    40 #include <async.h>
    4138#include <bool.h>
    42 #include <stdio.h>
    43 
    44 typedef enum {
    45         CONSOLE_CAP_NONE = 0,
    46         CONSOLE_CAP_STYLE = 1,
    47         CONSOLE_CAP_INDEXED = 2,
    48         CONSOLE_CAP_RGB = 4
    49 } console_caps_t;
    50 
    51 /** Console control structure. */
    52 typedef struct {
    53         /** Console input file */
    54         FILE *input;
    55        
    56         /** Console output file */
    57         FILE *output;
    58        
    59         /** Console input session */
    60         async_sess_t *input_sess;
    61        
    62         /** Console output session */
    63         async_sess_t *output_sess;
    64        
    65         /** Input request call with timeout */
    66         ipc_call_t input_call;
    67        
    68         /** Input response with timeout */
    69         aid_t input_aid;
    70 } console_ctrl_t;
    7139
    7240typedef enum {
    7341        KEY_PRESS,
    7442        KEY_RELEASE
    75 } kbd_event_type_t;
     43} console_ev_type_t;
     44
     45typedef enum {
     46        CONSOLE_CCAP_NONE = 0,
     47        CONSOLE_CCAP_STYLE,
     48        CONSOLE_CCAP_INDEXED,
     49        CONSOLE_CCAP_RGB
     50} console_caps_t;
    7651
    7752/** Console event structure. */
    7853typedef struct {
    79         /** List handle */
    80         link_t link;
    81        
    8254        /** Press or release event. */
    83         kbd_event_type_t type;
     55        console_ev_type_t type;
    8456       
    8557        /** Keycode of the key that was pressed or released. */
    86         keycode_t key;
     58        unsigned int key;
    8759       
    8860        /** Bitmask of modifiers held. */
    89         keymod_t mods;
     61        unsigned int mods;
    9062       
    9163        /** The character that was generated or '\0' for none. */
    9264        wchar_t c;
    93 } kbd_event_t;
     65} console_event_t;
    9466
    95 extern console_ctrl_t *console_init(FILE *, FILE *);
    96 extern void console_done(console_ctrl_t *);
    97 extern bool console_kcon(void);
     67extern void console_clear(int phone);
    9868
    99 extern void console_flush(console_ctrl_t *);
    100 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);
    10172
    102 extern int console_get_size(console_ctrl_t *, sysarg_t *, sysarg_t *);
    103 extern int console_get_pos(console_ctrl_t *, sysarg_t *, sysarg_t *);
    104 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);
    10577
    106 extern void console_set_style(console_ctrl_t *, uint8_t);
    107 extern void console_set_color(console_ctrl_t *, uint8_t, uint8_t, uint8_t);
    108 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);
    10981
    110 extern void console_cursor_visibility(console_ctrl_t *, bool);
    111 extern int console_get_color_cap(console_ctrl_t *, sysarg_t *);
    112 extern bool console_get_kbd_event(console_ctrl_t *, kbd_event_t *);
    113 extern bool console_get_kbd_event_timeout(console_ctrl_t *, kbd_event_t *,
    114     suseconds_t *);
     82extern bool console_get_event(int phone, console_event_t *event);
    11583
    11684#endif
Note: See TracChangeset for help on using the changeset viewer.