Changes in uspace/lib/c/include/io/console.h [7c014d1:64d2b10] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/io/console.h
r7c014d1 r64d2b10 36 36 #define LIBC_IO_CONSOLE_H_ 37 37 38 #include <sys/time.h>39 #include <io/keycode.h>40 #include <async.h>41 38 #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 = 449 } 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;71 39 72 40 typedef enum { 73 41 KEY_PRESS, 74 42 KEY_RELEASE 75 } kbd_event_type_t; 43 } console_ev_type_t; 44 45 typedef enum { 46 CONSOLE_CCAP_NONE = 0, 47 CONSOLE_CCAP_STYLE, 48 CONSOLE_CCAP_INDEXED, 49 CONSOLE_CCAP_RGB 50 } console_caps_t; 76 51 77 52 /** Console event structure. */ 78 53 typedef struct { 79 /** List handle */80 link_t link;81 82 54 /** Press or release event. */ 83 kbd_event_type_t type;55 console_ev_type_t type; 84 56 85 57 /** Keycode of the key that was pressed or released. */ 86 keycode_t key;58 unsigned int key; 87 59 88 60 /** Bitmask of modifiers held. */ 89 keymod_t mods;61 unsigned int mods; 90 62 91 63 /** The character that was generated or '\0' for none. */ 92 64 wchar_t c; 93 } kbd_event_t;65 } console_event_t; 94 66 95 extern console_ctrl_t *console_init(FILE *, FILE *); 96 extern void console_done(console_ctrl_t *); 97 extern bool console_kcon(void); 67 extern void console_clear(int phone); 98 68 99 extern void console_flush(console_ctrl_t *); 100 extern void console_clear(console_ctrl_t *); 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); 101 72 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); 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); 105 77 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);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); 109 81 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 *); 82 extern bool console_get_event(int phone, console_event_t *event); 115 83 116 84 #endif
Note:
See TracChangeset
for help on using the changeset viewer.