Subversion Repositories HelenOS-historic

Rev

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

Rev 1575 Rev 1578
Line 203... Line 203...
203
static void change_console(int newcons)
203
static void change_console(int newcons)
204
{
204
{
205
    connection_t *conn;
205
    connection_t *conn;
206
    static int console_pixmap = -1;
206
    static int console_pixmap = -1;
207
    int i, j;
207
    int i, j;
-
 
208
    keyfield_t *field;
-
 
209
    style_t *style;
208
    char c;
210
    char c;
209
 
211
 
210
    if (newcons == active_console)
212
    if (newcons == active_console)
211
        return;
213
        return;
212
 
214
 
Line 239... Line 241...
239
    gcons_change_console(newcons);
241
    gcons_change_console(newcons);
240
    conn = &connections[active_console];
242
    conn = &connections[active_console];
241
 
243
 
242
    set_style(&conn->screenbuffer.style);
244
    set_style(&conn->screenbuffer.style);
243
    curs_goto(conn->screenbuffer.position_y, conn->screenbuffer.position_x);
245
    curs_goto(conn->screenbuffer.position_y, conn->screenbuffer.position_x);
-
 
246
    curs_visibility(0);
-
 
247
   
244
    if (interbuffer) {
248
    if (interbuffer) {
245
        for (i = 0; i < conn->screenbuffer.size_x; i++)
249
        for (i = 0; i < conn->screenbuffer.size_x; i++)
246
            for (j = 0; j < conn->screenbuffer.size_y; j++)
250
            for (j = 0; j < conn->screenbuffer.size_y; j++)
247
                interbuffer[i + j*conn->screenbuffer.size_x] = *get_field_at(&(conn->screenbuffer),i, j);
251
                interbuffer[i + j*conn->screenbuffer.size_x] = *get_field_at(&(conn->screenbuffer),i, j);
248
        /* This call can preempt, but we are already at the end */
252
        /* This call can preempt, but we are already at the end */
249
        sync_send_2(fb_info.phone, FB_DRAW_TEXT_DATA, 0, 0, NULL, NULL);       
253
        j = sync_send_2(fb_info.phone, FB_DRAW_TEXT_DATA, 0, 0, NULL, NULL);       
-
 
254
    };
-
 
255
   
-
 
256
    if ((!interbuffer) || (j != 0)){
250
        curs_visibility(conn->screenbuffer.is_cursor_visible);
257
        set_style(&conn->screenbuffer.style);
251
    } else {
-
 
252
        clrscr();
258
        clrscr();
-
 
259
        style = &conn->screenbuffer.style;
253
       
260
 
254
        for (i = 0; i < conn->screenbuffer.size_x; i++)
261
        for (j = 0; j < conn->screenbuffer.size_y; j++)
255
            for (j = 0; j < conn->screenbuffer.size_y; j++) {
262
            for (i = 0; i < conn->screenbuffer.size_x; i++) {
256
                c = get_field_at(&(conn->screenbuffer),i, j)->character;
263
                field = get_field_at(&(conn->screenbuffer),i, j);
-
 
264
                if (!style_same(*style, field->style))
-
 
265
                    set_style(&field->style);
257
                if (c && c != ' ')
266
                style = &field->style;
-
 
267
                if ((field->character == ' ') && (style_same(field->style, conn->screenbuffer.style)))
-
 
268
                    continue;
-
 
269
 
258
                    prtchr(c, j, i);
270
                prtchr(field->character, j, i);
259
            }
271
            }
260
       
-
 
261
        curs_visibility(conn->screenbuffer.is_cursor_visible);
-
 
262
    }
272
    }
-
 
273
   
-
 
274
    curs_visibility(conn->screenbuffer.is_cursor_visible);
263
}
275
}
264
 
276
 
265
/** Handler for keyboard */
277
/** Handler for keyboard */
266
static void keyboard_events(ipc_callid_t iid, ipc_call_t *icall)
278
static void keyboard_events(ipc_callid_t iid, ipc_call_t *icall)
267
{
279
{