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