aboutsummaryrefslogtreecommitdiff
path: root/console/console.h
diff options
context:
space:
mode:
authorMarcus Brinkmann <marcus@gnu.org>2002-06-17 01:42:06 +0000
committerMarcus Brinkmann <marcus@gnu.org>2002-06-17 01:42:06 +0000
commit5835b9b309a0dae37c8545068c30fa2043369356 (patch)
treee2b39814fc0d95e87fd6aad8f6d8767dc82178a2 /console/console.h
parent36480790361183ac196efa1c8c9c97d38de0acc1 (diff)
downloadhurd-5835b9b309a0dae37c8545068c30fa2043369356.tar.gz
hurd-5835b9b309a0dae37c8545068c30fa2043369356.tar.bz2
hurd-5835b9b309a0dae37c8545068c30fa2043369356.zip
2002-06-17 Marcus Brinkmann <marcus@gnu.org>
* console.c (new_node): Adjust size of display node. * console.h: Add macros for color names. Add macros for intensity names. Add new types conchar_t and conchar_attr_t, which represent a console matrix cell and the attribute of one such cell, resp. Add macros for keycodes. (struct cons_display): Change type of _matrix member to conchar_t. * display.c (struct attr): Rewrite, usiong cons_attr_t to hold the attributes. (handle_escape_bracket_m): Use new members of ATTR. (display_flush_filechange): Send notification for changed matrix before the notification for new cur_line. Fix types in length calculation. (conchar_memset): New function. (user_create): Accept CHR and ATTR arguments. Fix calculation of NPAGES. Use conchar_memset instead of wmemset. (screen_fill): Fix type of ATTR argument. Use conchar_memset instead of wmemset. (screen_shift_left): Fix type of ATTR argument. Set attribute of empty cells. Fix length calculation. (screen_shift_right): Likewise. (handle_escape_bracket): Set default parameter for HUP. Be more ECMA-48 conform. (display_output_one): Fix arguments in screen_fill invocation. Set attribute for character output. Add <NEL> from ECMA-48. (display_create): Use 50 lines for now. Set default colors, and add new arguments to user_create invocation. CVSi: ----------------------------------------------------------------------
Diffstat (limited to 'console/console.h')
-rw-r--r--console/console.h54
1 files changed, 53 insertions, 1 deletions
diff --git a/console/console.h b/console/console.h
index 08f35955..771351f5 100644
--- a/console/console.h
+++ b/console/console.h
@@ -21,6 +21,35 @@
#include <stdint.h>
+#define CONS_COLOR_BLACK 0
+#define CONS_COLOR_RED 1
+#define CONS_COLOR_GREEN 2
+#define CONS_COLOR_YELLOW 3
+#define CONS_COLOR_BLUE 4
+#define CONS_COLOR_MAGENTA 5
+#define CONS_COLOR_CYAN 6
+#define CONS_COLOR_WHITE 7
+
+typedef struct
+{
+#define CONS_ATTR_INTENSITY_NORMAL 000000000000
+#define CONS_ATTR_INTENSITY_BOLD 000000000001
+#define CONS_ATTR_INTENSITY_DIM 000000000002
+ uint32_t intensity : 2;
+ uint32_t underlined : 1;
+ uint32_t blinking : 1;
+ uint32_t reversed : 1;
+ uint32_t concealed : 1;
+ uint32_t bgcol : 3;
+ uint32_t fgcol : 3;
+} conchar_attr_t;
+
+typedef struct
+{
+ wchar_t chr;
+ conchar_attr_t attr;
+} conchar_t;
+
struct cons_display
{
#define CONS_MAGIC 0x48555244 /* Hex for "HURD". */
@@ -61,8 +90,31 @@ struct cons_display
/* Don't use this, use ((wchar_t *) cons_display +
cons_display.screen.matrix) instead. This will make your client
upward compatible with future versions of this interface. */
- wchar_t _matrix[0];
+ conchar_t _matrix[0];
};
+
+#define CONS_KEY_UP "\e[A" /* Cursor up. */
+#define CONS_KEY_DOWN "\e[B" /* Cursor down. */
+#define CONS_KEY_RIGHT "\e[C" /* Cursor right. */
+#define CONS_KEY_LEFT "\e[D" /* Cursor left. */
+#define CONS_KEY_HOME "\e[H" /* Home key. */
+#define CONS_KEY_BACKSPACE "\177" /* Backspace key. */
+#define CONS_KEY_F1 "\eOP" /* Function key 1. */
+#define CONS_KEY_F2 "\eOQ" /* Function key 2. */
+#define CONS_KEY_F3 "\eOR" /* Function key 3. */
+#define CONS_KEY_F4 "\eOS" /* Function key 4. */
+#define CONS_KEY_F5 "\eOT" /* Function key 5. */
+#define CONS_KEY_F6 "\eOU" /* Function key 6. */
+#define CONS_KEY_F7 "\eOV" /* Function key 7. */
+#define CONS_KEY_F8 "\eOW" /* Function key 8. */
+#define CONS_KEY_F9 "\eOX" /* Function key 9. */
+#define CONS_KEY_F10 "\eOY" /* Function key 10. */
+#define CONS_KEY_DC "\e[9" /* Delete character. */
+#define CONS_KEY_NPAGE "\e[U" /* Next page. */
+#define CONS_KEY_PPAGE "\e[V" /* Previous page. */
+#define CONS_KEY_BTAB "\e[Z" /* Back tab key. */
+#define CONS_KEY_IC "\e[@" /* Insert char mode. */
+#define CONS_KEY_END "\e[Y" /* End key. */
#endif /* _HURD_CONSOLE_H */