Rev 4326 | Rev 4528 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 4326 | Rev 4457 | ||
|---|---|---|---|
| Line 49... | Line 49... | ||
| 49 | #include <ipc/ipc.h> |
49 | #include <ipc/ipc.h> |
| 50 | #include <ipc/ns.h> |
50 | #include <ipc/ns.h> |
| 51 | #include <ipc/services.h> |
51 | #include <ipc/services.h> |
| 52 | #include <kernel/errno.h> |
52 | #include <kernel/errno.h> |
| 53 | #include <kernel/genarch/fb/visuals.h> |
53 | #include <kernel/genarch/fb/visuals.h> |
| 54 | #include <console/color.h> |
54 | #include <io/color.h> |
| 55 | #include <console/style.h> |
55 | #include <io/style.h> |
| 56 | #include <async.h> |
56 | #include <async.h> |
| 57 | #include <bool.h> |
57 | #include <bool.h> |
| 58 | 58 | ||
| 59 | #include "font-8x16.h" |
59 | #include "font-8x16.h" |
| 60 | #include "fb.h" |
60 | #include "fb.h" |
| Line 373... | Line 373... | ||
| 373 | * @param vport Viewport to redraw |
373 | * @param vport Viewport to redraw |
| 374 | * |
374 | * |
| 375 | */ |
375 | */ |
| 376 | static void vport_redraw(viewport_t *vport) |
376 | static void vport_redraw(viewport_t *vport) |
| 377 | { |
377 | { |
| 378 | unsigned int row; |
- | |
| 379 | unsigned int col; |
378 | unsigned int col; |
| - | 379 | unsigned int row; |
|
| 380 | 380 | ||
| 381 | for (row = 0; row < vport->rows; row++) { |
381 | for (row = 0; row < vport->rows; row++) { |
| 382 | for (col = 0; col < vport->cols; col++) { |
382 | for (col = 0; col < vport->cols; col++) { |
| 383 | draw_vp_glyph(vport, false, col, row); |
383 | draw_vp_glyph(vport, false, col, row); |
| 384 | } |
384 | } |
| Line 429... | Line 429... | ||
| 429 | * @param lines Number of lines to scroll |
429 | * @param lines Number of lines to scroll |
| 430 | * |
430 | * |
| 431 | */ |
431 | */ |
| 432 | static void vport_scroll(viewport_t *vport, int lines) |
432 | static void vport_scroll(viewport_t *vport, int lines) |
| 433 | { |
433 | { |
| 434 | unsigned int row; |
- | |
| 435 | unsigned int col; |
434 | unsigned int col; |
| - | 435 | unsigned int row; |
|
| 436 | unsigned int x; |
436 | unsigned int x; |
| 437 | unsigned int y; |
437 | unsigned int y; |
| 438 | uint32_t glyph; |
438 | uint32_t glyph; |
| 439 | uint32_t fg_color; |
439 | uint32_t fg_color; |
| 440 | uint32_t bg_color; |
440 | uint32_t bg_color; |
| Line 1562... | Line 1562... | ||
| 1562 | ipc_call_t call; |
1562 | ipc_call_t call; |
| 1563 | int retval; |
1563 | int retval; |
| 1564 | unsigned int i; |
1564 | unsigned int i; |
| 1565 | int scroll; |
1565 | int scroll; |
| 1566 | wchar_t ch; |
1566 | wchar_t ch; |
| 1567 | unsigned int row, col; |
1567 | unsigned int col, row; |
| 1568 | 1568 | ||
| 1569 | if ((vport->cursor_active) || (anims_enabled)) |
1569 | if ((vport->cursor_active) || (anims_enabled)) |
| 1570 | callid = async_get_call_timeout(&call, 250000); |
1570 | callid = async_get_call_timeout(&call, 250000); |
| 1571 | else |
1571 | else |
| 1572 | callid = async_get_call(&call); |
1572 | callid = async_get_call(&call); |
| Line 1599... | Line 1599... | ||
| 1599 | /* Exit thread */ |
1599 | /* Exit thread */ |
| 1600 | return; |
1600 | return; |
| 1601 | 1601 | ||
| 1602 | case FB_PUTCHAR: |
1602 | case FB_PUTCHAR: |
| 1603 | ch = IPC_GET_ARG1(call); |
1603 | ch = IPC_GET_ARG1(call); |
| 1604 | row = IPC_GET_ARG2(call); |
1604 | col = IPC_GET_ARG2(call); |
| 1605 | col = IPC_GET_ARG3(call); |
1605 | row = IPC_GET_ARG3(call); |
| 1606 | 1606 | ||
| 1607 | if ((col >= vport->cols) || (row >= vport->rows)) { |
1607 | if ((col >= vport->cols) || (row >= vport->rows)) { |
| 1608 | retval = EINVAL; |
1608 | retval = EINVAL; |
| 1609 | break; |
1609 | break; |
| 1610 | } |
1610 | } |
| Line 1618... | Line 1618... | ||
| 1618 | vport_clear(vport); |
1618 | vport_clear(vport); |
| 1619 | cursor_show(vport); |
1619 | cursor_show(vport); |
| 1620 | retval = EOK; |
1620 | retval = EOK; |
| 1621 | break; |
1621 | break; |
| 1622 | case FB_CURSOR_GOTO: |
1622 | case FB_CURSOR_GOTO: |
| 1623 | row = IPC_GET_ARG1(call); |
1623 | col = IPC_GET_ARG1(call); |
| 1624 | col = IPC_GET_ARG2(call); |
1624 | row = IPC_GET_ARG2(call); |
| 1625 | 1625 | ||
| 1626 | if ((col >= vport->cols) || (row >= vport->rows)) { |
1626 | if ((col >= vport->cols) || (row >= vport->rows)) { |
| 1627 | retval = EINVAL; |
1627 | retval = EINVAL; |
| 1628 | break; |
1628 | break; |
| 1629 | } |
1629 | } |
| Line 1639... | Line 1639... | ||
| 1639 | vport->cursor_active = IPC_GET_ARG1(call); |
1639 | vport->cursor_active = IPC_GET_ARG1(call); |
| 1640 | cursor_show(vport); |
1640 | cursor_show(vport); |
| 1641 | retval = EOK; |
1641 | retval = EOK; |
| 1642 | break; |
1642 | break; |
| 1643 | case FB_GET_CSIZE: |
1643 | case FB_GET_CSIZE: |
| 1644 | ipc_answer_2(callid, EOK, vport->rows, vport->cols); |
1644 | ipc_answer_2(callid, EOK, vport->cols, vport->rows); |
| 1645 | continue; |
1645 | continue; |
| 1646 | case FB_SCROLL: |
1646 | case FB_SCROLL: |
| 1647 | scroll = IPC_GET_ARG1(call); |
1647 | scroll = IPC_GET_ARG1(call); |
| 1648 | if ((scroll > (int) vport->rows) || (scroll < (-(int) vport->rows))) { |
1648 | if ((scroll > (int) vport->rows) || (scroll < (-(int) vport->rows))) { |
| 1649 | retval = EINVAL; |
1649 | retval = EINVAL; |