Subversion Repositories Kolibri OS

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
4973 right-hear 1
#ifndef __TEXTCON_H
2
#define __TEXTCON_H
3
 
4
#include
5
 
6
#define COLOR_CONV_B_2_D	{ \
7
 0x000000, \
8
 0x000080, \
9
 0x800000, \
10
 0x008080, \
11
 0x800000, \
12
 0x808000, \
13
 0x404040, \
14
 0x808080, \
15
 0x606060, \
16
 0x0000FF, \
17
 0x00FF00, \
18
 0x00FFFF, \
19
 0xFF0000, \
20
 0xFFFF00, \
21
 0x00FFFF, \
22
 0xFFFFFF, \
23
}
24
 
25
#define CHAR_SIZE_X		5
26
#define CHAR_SIZE_Y		8
27
 
28
#define NR_CHARS_X		80
29
#define NR_CHARS_Y		25
30
 
31
#define CON_AT_X		10
32
#define CON_AT_Y		25
33
 
34
typedef struct
35
{
36
 unsigned char c_char;
37
 unsigned char c_back;
38
 unsigned char c_color;
39
} char_info_t;
40
 
41
typedef struct
42
{
43
 int esc[4];
44
} esc_info_t;
45
 
46
typedef struct
47
{
48
 unsigned char text_color,back_color;
49
 char_info_t char_table[NR_CHARS_X][NR_CHARS_Y];
50
 int id;
51
 int cur_x,cur_y;
52
 int cur_visible;
53
 unsigned char cur_color;
54
 esc_info_t esc_seq;
55
 DECLARE_SEMAPHORE_S(io_lock);
56
} console_t;
57
 
58
#define MAX_CONSOLES		4
59
 
60
extern console_t * consoles[MAX_CONSOLES];
61
extern console_t * visible_console;
62
 
63
void init_consoles(void);
64
void lcon_clrscr(console_t * con);
65
void lcon_flush_console(console_t * con);
66
void lcon_flushxy(console_t * con,int x,int y);
67
void lcon_scroll(console_t * con,int update);
68
void lcon_putch(console_t * con,char c);
69
void lcon_gotoxy(console_t * con,int x,int y);
70
void lcon_set_text_color(console_t * con,int color);
71
void lcon_set_back_color(console_t * con,int color);
72
void lcon_switch_to_console(int i);
73
unsigned char lcon_getcxy(console_t * con,int x,int y);
74
void lcon_putcxy(console_t * con,int x,int y,unsigned char c);
75
 
76
#define _lcon_clrscr()		lcon_clrscr(visible_console)
77
#define _lcon_flush_console()	lcon_flush_console(visible_console)
78
#define _lcon_flushxy(x,y)	lcon_flushxy(visible_console,(x),(y))
79
#define _lcon_scroll()		lcon_scroll(visible_console,1)
80
#define _lcon_putch(c)		lcon_putch(visible_console,(char)(c))
81
#define _lcon_gotoxy(x,y)	lcon_gotoxy(visible_console,(x),(y))
82
#define _lcon_set_text_color(c) lcon_set_text_color(visible_console,(c)&(1+2+4+8))
83
#define _lcon_set_back_color(c) lcon_set_back_color(visible_console,(c)&(1+2+4+8))
84
#define _lcon_switch(i)		lcon_switch_to_console((i))
85
#define _lcon_getcxy(x,y)	lcon_getcxy(visible_console,(x),(y))
86
#define _lcon_putcxy(x,y,c)	lcon_putcxy(visible_console,(x),(y),(c))
87
 
88
console_t * create_private_console(void);
89
void free_private_console(console_t * con);
90
 
91
#endif