21 |
|
|
22 |
#include <stdint.h> |
#include <stdint.h> |
23 |
|
|
24 |
#define CONS_COLOR_BLACK 0 |
typedef enum |
25 |
#define CONS_COLOR_RED 1 |
{ |
26 |
#define CONS_COLOR_GREEN 2 |
CONS_COLOR_BLACK = 0, CONS_COLOR_RED, CONS_COLOR_GREEN, CONS_COLOR_YELLOW, |
27 |
#define CONS_COLOR_YELLOW 3 |
CONS_COLOR_BLUE, CONS_COLOR_MAGENTA, CONS_COLOR_CYAN, CONS_COLOR_WHITE |
28 |
#define CONS_COLOR_BLUE 4 |
} cons_color_t; |
29 |
#define CONS_COLOR_MAGENTA 5 |
#define CONS_COLOR_MAX (CONS_COLOR_WHITE) |
|
#define CONS_COLOR_CYAN 6 |
|
|
#define CONS_COLOR_WHITE 7 |
|
30 |
|
|
31 |
typedef struct |
typedef struct |
32 |
{ |
{ |
48 |
conchar_attr_t attr; |
conchar_attr_t attr; |
49 |
} conchar_t; |
} conchar_t; |
50 |
|
|
51 |
|
typedef union |
52 |
|
{ |
53 |
|
struct |
54 |
|
{ |
55 |
|
/* Only the first 31 bits are available (see WHAT.not_matrix). */ |
56 |
|
uint32_t start; |
57 |
|
uint32_t end; |
58 |
|
} matrix; |
59 |
|
struct |
60 |
|
{ |
61 |
|
uint32_t cursor_pos : 1; |
62 |
|
uint32_t cursor_status : 1; |
63 |
|
uint32_t screen_cur_line : 1; |
64 |
|
uint32_t screen_scr_lines : 1; |
65 |
|
uint32_t _unused : 27; |
66 |
|
uint32_t not_matrix : 1; |
67 |
|
} what; |
68 |
|
} cons_change_t; |
69 |
|
|
70 |
struct cons_display |
struct cons_display |
71 |
{ |
{ |
72 |
#define CONS_MAGIC 0x48555244 /* Hex for "HURD". */ |
#define CONS_MAGIC 0x48555244 /* Hex for "HURD". */ |
85 |
uint32_t cur_line; /* Beginning of visible area. This is only |
uint32_t cur_line; /* Beginning of visible area. This is only |
86 |
ever increased by the server, so clients |
ever increased by the server, so clients |
87 |
can optimize scrolling. */ |
can optimize scrolling. */ |
88 |
uint32_t scr_lines;/* Number of lines in scrollback buffer |
uint32_t scr_lines; /* Number of lines in scrollback buffer |
89 |
preceeding CUR_LINE. */ |
preceeding CUR_LINE. */ |
90 |
uint32_t height; /* Number of lines in visible area following |
uint32_t height; /* Number of lines in visible area following |
91 |
(and including) CUR_LINE. */ |
(and including) CUR_LINE. */ |
104 |
uint32_t status; /* Visibility status of cursor. */ |
uint32_t status; /* Visibility status of cursor. */ |
105 |
} cursor; |
} cursor; |
106 |
|
|
107 |
|
struct |
108 |
|
{ |
109 |
|
uint32_t buffer; /* Index (in uint32_t) of the beginning of the |
110 |
|
changes buffer in this structure. */ |
111 |
|
uint32_t length; /* Length of buffer. */ |
112 |
|
uint32_t written; /* Number of records written by server. */ |
113 |
|
|
114 |
|
#define _CONS_CHANGES_LENGTH 512 |
115 |
|
cons_change_t _buffer[_CONS_CHANGES_LENGTH]; |
116 |
|
} changes; |
117 |
|
|
118 |
/* Don't use this, use ((wchar_t *) cons_display + |
/* Don't use this, use ((wchar_t *) cons_display + |
119 |
cons_display.screen.matrix) instead. This will make your client |
cons_display.screen.matrix) instead. This will make your client |
120 |
upward compatible with future versions of this interface. */ |
upward compatible with future versions of this interface. */ |