Rev 4235 | Rev 4326 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 4235 | Rev 4325 | ||
|---|---|---|---|
| Line 272... | Line 272... | ||
| 272 | for (j = 0; j < h; j++) { |
272 | for (j = 0; j < h; j++) { |
| 273 | if (j > 0 && w != scr_width) |
273 | if (j > 0 && w != scr_width) |
| 274 | serial_goto(y, x); |
274 | serial_goto(y, x); |
| 275 | 275 | ||
| 276 | for (i = 0; i < w; i++) { |
276 | for (i = 0; i < w; i++) { |
| 277 | unsigned int col = x + i; |
- | |
| 278 | unsigned int row = y + j; |
- | |
| 279 | - | ||
| 280 | field = &data[j * w + i]; |
277 | field = &data[j * w + i]; |
| 281 | 278 | ||
| 282 | a1 = &field->attrs; |
279 | a1 = &field->attrs; |
| 283 | if (!attrs_same(*a0, *a1)) |
280 | if (!attrs_same(*a0, *a1)) |
| 284 | serial_set_attrs(a1); |
281 | serial_set_attrs(a1); |
| Line 302... | Line 299... | ||
| 302 | keyfield_t *interbuf = NULL; |
299 | keyfield_t *interbuf = NULL; |
| 303 | size_t intersize = 0; |
300 | size_t intersize = 0; |
| 304 | 301 | ||
| 305 | wchar_t c; |
302 | wchar_t c; |
| 306 | int col, row, w, h; |
303 | int col, row, w, h; |
| 307 | int fgcolor; |
- | |
| 308 | int bgcolor; |
- | |
| 309 | int flags; |
- | |
| 310 | int style; |
- | |
| 311 | int i; |
304 | int i; |
| 312 | 305 | ||
| - | 306 | attrs_t cur_attr; |
|
| 313 | 307 | ||
| 314 | if (client_connected) { |
308 | if (client_connected) { |
| 315 | ipc_answer_0(iid, ELIMIT); |
309 | ipc_answer_0(iid, ELIMIT); |
| 316 | return; |
310 | return; |
| 317 | } |
311 | } |
| 318 | 312 | ||
| 319 | client_connected = 1; |
313 | client_connected = 1; |
| 320 | ipc_answer_0(iid, EOK); |
314 | ipc_answer_0(iid, EOK); |
| - | 315 | ||
| - | 316 | cur_attr.t = at_style; |
|
| - | 317 | cur_attr.a.s.style = STYLE_NORMAL; |
|
| 321 | 318 | ||
| 322 | /* Clear the terminal, set scrolling region |
319 | /* Clear the terminal, set scrolling region |
| 323 | to 0 - height rows. */ |
320 | to 0 - height rows. */ |
| 324 | serial_clrscr(); |
321 | serial_clrscr(); |
| 325 | serial_goto(0, 0); |
322 | serial_goto(0, 0); |
| Line 386... | Line 383... | ||
| 386 | case FB_CLEAR: |
383 | case FB_CLEAR: |
| 387 | serial_clrscr(); |
384 | serial_clrscr(); |
| 388 | retval = 0; |
385 | retval = 0; |
| 389 | break; |
386 | break; |
| 390 | case FB_SET_STYLE: |
387 | case FB_SET_STYLE: |
| - | 388 | cur_attr.t = at_style; |
|
| 391 | style = IPC_GET_ARG1(call); |
389 | cur_attr.a.s.style = IPC_GET_ARG1(call); |
| - | 390 | cur_attr.a.i.bg_color = IPC_GET_ARG2(call); |
|
| 392 | serial_set_style(style); |
391 | serial_set_attrs(&cur_attr); |
| - | 392 | ||
| 393 | retval = 0; |
393 | retval = 0; |
| 394 | break; |
394 | break; |
| 395 | case FB_SET_COLOR: |
395 | case FB_SET_COLOR: |
| - | 396 | cur_attr.t = at_idx; |
|
| 396 | fgcolor = IPC_GET_ARG1(call); |
397 | cur_attr.a.i.fg_color = IPC_GET_ARG1(call); |
| 397 | bgcolor = IPC_GET_ARG2(call); |
398 | cur_attr.a.i.bg_color = IPC_GET_ARG2(call); |
| 398 | flags = IPC_GET_ARG3(call); |
399 | cur_attr.a.i.flags = IPC_GET_ARG3(call); |
| - | 400 | serial_set_attrs(&cur_attr); |
|
| 399 | 401 | ||
| 400 | serial_set_idx(fgcolor, bgcolor, flags); |
- | |
| 401 | retval = 0; |
402 | retval = 0; |
| 402 | break; |
403 | break; |
| 403 | case FB_SET_RGB_COLOR: |
404 | case FB_SET_RGB_COLOR: |
| - | 405 | cur_attr.t = at_rgb; |
|
| 404 | fgcolor = IPC_GET_ARG1(call); |
406 | cur_attr.a.i.fg_color = IPC_GET_ARG1(call); |
| 405 | bgcolor = IPC_GET_ARG2(call); |
407 | cur_attr.a.i.bg_color = IPC_GET_ARG2(call); |
| - | 408 | serial_set_attrs(&cur_attr); |
|
| 406 | 409 | ||
| 407 | serial_set_rgb(fgcolor, bgcolor); |
- | |
| 408 | retval = 0; |
410 | retval = 0; |
| 409 | break; |
411 | break; |
| 410 | case FB_SCROLL: |
412 | case FB_SCROLL: |
| 411 | i = IPC_GET_ARG1(call); |
413 | i = IPC_GET_ARG1(call); |
| 412 | if ((i > scr_height) || (i < -scr_height)) { |
414 | if ((i > scr_height) || (i < -scr_height)) { |
| Line 422... | Line 424... | ||
| 422 | serial_cursor_enable(); |
424 | serial_cursor_enable(); |
| 423 | else |
425 | else |
| 424 | serial_cursor_disable(); |
426 | serial_cursor_disable(); |
| 425 | retval = 0; |
427 | retval = 0; |
| 426 | break; |
428 | break; |
| - | 429 | case FB_SCREEN_GRAB: |
|
| - | 430 | serial_clrscr(); |
|
| - | 431 | serial_set_attrs(&cur_attr); |
|
| - | 432 | retval = 0; |
|
| - | 433 | break; |
|
| - | 434 | case FB_SCREEN_RELINQUISH: |
|
| - | 435 | serial_sgr(SGR_RESET); |
|
| - | 436 | serial_puts("\033[2J"); |
|
| - | 437 | serial_goto(0, 0); |
|
| - | 438 | serial_cursor_enable(); |
|
| - | 439 | retval = 0; |
|
| - | 440 | break; |
|
| 427 | default: |
441 | default: |
| 428 | retval = ENOENT; |
442 | retval = ENOENT; |
| 429 | } |
443 | } |
| 430 | ipc_answer_0(callid, retval); |
444 | ipc_answer_0(callid, retval); |
| 431 | } |
445 | } |