Subversion Repositories HelenOS-historic

Rev

Rev 1522 | Rev 1547 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1522 Rev 1528
Line 46... Line 46...
46
static int use_gcons = 0;
46
static int use_gcons = 0;
47
static ipcarg_t xres,yres;
47
static ipcarg_t xres,yres;
48
 
48
 
49
static int console_vp;
49
static int console_vp;
50
static int cstatus_vp[CONSOLE_COUNT];
50
static int cstatus_vp[CONSOLE_COUNT];
-
 
51
static int console_has_input[CONSOLE_COUNT];
51
static int cstat_row, cstat_col; /* Size of cstatus buttons */
52
static int cstat_row, cstat_col; /* Size of cstatus buttons */
52
 
53
 
53
static int fbphone;
54
static int fbphone;
54
 
55
 
55
enum butstate {
56
enum butstate {
56
    CONS_ACTIVE = 0,
57
    CONS_ACTIVE = 0,
57
    CONS_IDLE,
58
    CONS_IDLE,
58
    CONS_HAS_INPUT
59
    CONS_HAS_INPUT,
-
 
60
    CONS_DISCONNECTED
59
};
61
};
60
 
62
 
61
static struct {
63
static struct {
62
    int fgcolor;
64
    int fgcolor;
63
    int bgcolor;
65
    int bgcolor;
64
} stat_colors[] = {
66
} stat_colors[] = {
65
    {0xd0d0d0, 0x808080},
67
    {0xd0d0d0, 0x808080},
66
    {0xd0d0d0, 0x0},
68
    {0xd0d0d0, 0x0},
67
    {0xd0d0d0, 0xa04040}
69
    {0xd0d0d0, 0xa04040},
-
 
70
    {0xd0d0d0, 0x0}
68
};
71
};
69
 
72
 
70
static int active_console = 0;
73
static int active_console = 0;
71
 
74
 
72
static void vp_switch(int vp)
75
static void vp_switch(int vp)
Line 106... Line 109...
106
    int i;
109
    int i;
107
   
110
   
108
    vp_switch(cstatus_vp[consnum]);
111
    vp_switch(cstatus_vp[consnum]);
109
    set_style(stat_colors[state].fgcolor, stat_colors[state].bgcolor);
112
    set_style(stat_colors[state].fgcolor, stat_colors[state].bgcolor);
110
    clear();
113
    clear();
-
 
114
    if (state != CONS_DISCONNECTED) {
111
    snprintf(data, 5, "%d", consnum+1);
115
        snprintf(data, 5, "%d", consnum+1);
112
    for (i=0;data[i];i++)
116
        for (i=0;data[i];i++)
113
        putch(data[i], 0, i);
117
            putch(data[i], 0, i);
-
 
118
    }
114
}
119
}
115
 
120
 
116
void gcons_change_console(int consnum)
121
void gcons_change_console(int consnum)
117
{
122
{
118
    if (!use_gcons)
123
    if (!use_gcons)
119
        return;
124
        return;
120
   
125
   
121
    draw_stat(active_console, CONS_IDLE);
126
    draw_stat(active_console, CONS_IDLE);
122
    active_console = consnum;
127
    active_console = consnum;
123
    draw_stat(consnum, CONS_ACTIVE);
128
    draw_stat(consnum, CONS_ACTIVE);
-
 
129
    console_has_input[consnum] = 0;
-
 
130
 
124
    vp_switch(console_vp);
131
    vp_switch(console_vp);
125
}
132
}
126
 
133
 
127
void gcons_notify_char(int consnum)
134
void gcons_notify_char(int consnum)
128
{
135
{
129
    if (!use_gcons)
136
    if (!use_gcons)
130
        return;
137
        return;
131
 
138
 
-
 
139
    if (consnum == active_console || console_has_input[consnum])
-
 
140
        return;
-
 
141
 
-
 
142
    console_has_input[consnum] = 1;
-
 
143
    draw_stat(consnum, CONS_HAS_INPUT);
-
 
144
   
132
    vp_switch(console_vp);
145
    vp_switch(console_vp);
133
}
146
}
134
 
147
 
135
void gcons_redraw_console(void)
148
void gcons_redraw_console(void)
136
{
149
{
Line 142... Line 155...
142
    vp_switch(0);
155
    vp_switch(0);
143
    set_style(MAIN_COLOR, MAIN_COLOR);
156
    set_style(MAIN_COLOR, MAIN_COLOR);
144
    clear();
157
    clear();
145
 
158
 
146
    for (i=0;i < CONSOLE_COUNT; i++)
159
    for (i=0;i < CONSOLE_COUNT; i++)
147
        draw_stat(i, i == active_console ? CONS_ACTIVE : CONS_IDLE);
160
        draw_stat(i, i == active_console ? CONS_ACTIVE : CONS_DISCONNECTED);
148
    vp_switch(console_vp);
161
    vp_switch(console_vp);
149
}
162
}
150
 
163
 
151
/** Initialize nice graphical console environment */
164
/** Initialize nice graphical console environment */
152
void gcons_init(int phone)
165
void gcons_init(int phone)