Import 2.1.115pre1
[davej-history.git] / include / linux / console_struct.h
blobdafd1c299429b74a685e52688a660a6e2431ada2
1 /*
2 * console_struct.h
4 * Data structure describing single virtual console except for data
5 * used by vt.c.
7 * Fields marked with [#] must be set by the low-level driver.
8 * Fields marked with [!] can be changed by the low-level driver
9 * to achieve effects such as fast scrolling by changing the origin.
12 #define NPAR 16
14 struct vc_data {
15 unsigned short vc_num; /* Console number */
16 unsigned int vc_cols; /* [#] Console size */
17 unsigned int vc_rows;
18 unsigned int vc_size_row; /* Bytes per row */
19 struct consw *vc_sw;
20 unsigned short *vc_screenbuf; /* In-memory character/attribute buffer */
21 unsigned int vc_screenbuf_size;
22 unsigned short vc_video_erase_char; /* Background erase character */
23 unsigned char vc_attr; /* Current attributes */
24 unsigned char vc_def_color; /* Default colors */
25 unsigned char vc_color; /* Foreground & background */
26 unsigned char vc_s_color; /* Saved foreground & background */
27 unsigned char vc_ulcolor; /* Color for underline mode */
28 unsigned char vc_halfcolor; /* Color for half intensity mode */
29 unsigned short vc_complement_mask; /* [#] Xor mask for mouse pointer */
30 unsigned short vc_hi_font_mask; /* [#] Attribute set for upper 256 chars of font or 0 if not supported */
31 unsigned int vc_x, vc_y; /* Cursor position */
32 unsigned int vc_top, vc_bottom; /* Scrolling region */
33 unsigned int vc_state; /* Escape sequence parser state */
34 unsigned int vc_npar,vc_par[NPAR]; /* Parameters of current escape sequence */
35 unsigned long vc_origin; /* [!] Start of real screen */
36 unsigned long vc_scr_end; /* [!] End of real screen */
37 unsigned long vc_visible_origin; /* [!] Top of visible window */
38 unsigned long vc_pos; /* Cursor address */
39 unsigned int vc_saved_x;
40 unsigned int vc_saved_y;
41 /* mode flags */
42 unsigned int vc_charset : 1; /* Character set G0 / G1 */
43 unsigned int vc_s_charset : 1; /* Saved character set */
44 unsigned int vc_disp_ctrl : 1; /* Display chars < 32? */
45 unsigned int vc_toggle_meta : 1; /* Toggle high bit? */
46 unsigned int vc_decscnm : 1; /* Screen Mode */
47 unsigned int vc_decom : 1; /* Origin Mode */
48 unsigned int vc_decawm : 1; /* Autowrap Mode */
49 unsigned int vc_deccm : 1; /* Cursor Visible */
50 unsigned int vc_decim : 1; /* Insert Mode */
51 unsigned int vc_deccolm : 1; /* 80/132 Column Mode */
52 /* attribute flags */
53 unsigned int vc_intensity : 2; /* 0=half-bright, 1=normal, 2=bold */
54 unsigned int vc_underline : 1;
55 unsigned int vc_blink : 1;
56 unsigned int vc_reverse : 1;
57 unsigned int vc_s_intensity : 2; /* saved rendition */
58 unsigned int vc_s_underline : 1;
59 unsigned int vc_s_blink : 1;
60 unsigned int vc_s_reverse : 1;
61 /* misc */
62 unsigned int vc_ques : 1;
63 unsigned int vc_need_wrap : 1;
64 unsigned int vc_can_do_color : 1;
65 unsigned int vc_report_mouse : 2;
66 unsigned int vc_kmalloced : 1;
67 unsigned char vc_utf : 1; /* Unicode UTF-8 encoding */
68 unsigned char vc_utf_count;
69 int vc_utf_char;
70 unsigned int vc_tab_stop[5]; /* Tab stops. 160 columns. */
71 unsigned char vc_palette[16*3]; /* Colour palette for VGA+ */
72 unsigned short * vc_translate;
73 unsigned char vc_G0_charset;
74 unsigned char vc_G1_charset;
75 unsigned char vc_saved_G0;
76 unsigned char vc_saved_G1;
77 unsigned int vc_bell_pitch; /* Console bell pitch */
78 unsigned int vc_bell_duration; /* Console bell duration */
79 unsigned int vc_cursor_type;
80 struct vc_data **vc_display_fg; /* [!] Ptr to var holding fg console for this display */
81 unsigned long vc_uni_pagedir;
82 unsigned long *vc_uni_pagedir_loc; /* [!] Location of uni_pagedir variable for this console */
83 /* additional information is in vt_kern.h */
86 struct vc {
87 struct vc_data *d;
89 /* might add scrmem, vt_struct, kbd at some time,
90 to have everything in one place - the disadvantage
91 would be that vc_cons etc can no longer be static */
94 extern struct vc vc_cons [MAX_NR_CONSOLES];
96 #define CUR_DEF 0
97 #define CUR_NONE 1
98 #define CUR_UNDERLINE 2
99 #define CUR_LOWER_THIRD 3
100 #define CUR_LOWER_HALF 4
101 #define CUR_TWO_THIRDS 5
102 #define CUR_BLOCK 6
103 #define CUR_HWMASK 0x0f
104 #define CUR_SWMASK 0xfff0
106 #define CUR_DEFAULT CUR_UNDERLINE