Changes in uspace/lib/clui/tinput.c [79ae36dd:96b02eb9] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/clui/tinput.c
r79ae36dd r96b02eb9 54 54 static void tinput_sel_all(tinput_t *); 55 55 static void tinput_sel_delete(tinput_t *); 56 static void tinput_key_ctrl(tinput_t *, kbd_event_t *);57 static void tinput_key_shift(tinput_t *, kbd_event_t *);58 static void tinput_key_ctrl_shift(tinput_t *, kbd_event_t *);59 static void tinput_key_unmod(tinput_t *, kbd_event_t *);56 static void tinput_key_ctrl(tinput_t *, console_event_t *); 57 static void tinput_key_shift(tinput_t *, console_event_t *); 58 static void tinput_key_ctrl_shift(tinput_t *, console_event_t *); 59 static void tinput_key_unmod(tinput_t *, console_event_t *); 60 60 static void tinput_pre_seek(tinput_t *, bool); 61 61 static void tinput_post_seek(tinput_t *, bool); … … 88 88 tinput_sel_get_bounds(ti, &sa, &sb); 89 89 90 console_set_pos( ti->console, (ti->col0 + start) % ti->con_cols,90 console_set_pos(fphone(stdout), (ti->col0 + start) % ti->con_cols, 91 91 ti->row0 + (ti->col0 + start) / ti->con_cols); 92 console_set_style( ti->console, STYLE_NORMAL);92 console_set_style(fphone(stdout), STYLE_NORMAL); 93 93 94 94 size_t p = start; … … 101 101 102 102 if (p < sb) { 103 console_flush(ti->console); 104 console_set_style(ti->console, STYLE_SELECTED); 105 103 fflush(stdout); 104 console_set_style(fphone(stdout), STYLE_SELECTED); 106 105 memcpy(dbuf, ti->buffer + p, 107 106 (sb - p) * sizeof(wchar_t)); … … 111 110 } 112 111 113 console_flush(ti->console);114 console_set_style( ti->console, STYLE_NORMAL);112 fflush(stdout); 113 console_set_style(fphone(stdout), STYLE_NORMAL); 115 114 116 115 if (p < ti->nc) { … … 124 123 putchar(' '); 125 124 126 console_flush(ti->console);125 fflush(stdout); 127 126 } 128 127 … … 134 133 static void tinput_position_caret(tinput_t *ti) 135 134 { 136 console_set_pos( ti->console, (ti->col0 + ti->pos) % ti->con_cols,135 console_set_pos(fphone(stdout), (ti->col0 + ti->pos) % ti->con_cols, 137 136 ti->row0 + (ti->col0 + ti->pos) / ti->con_cols); 138 137 } … … 517 516 static void tinput_init(tinput_t *ti) 518 517 { 519 ti->console = console_init(stdin, stdout);520 518 ti->hnum = 0; 521 519 ti->hpos = 0; … … 535 533 int tinput_read(tinput_t *ti, char **dstr) 536 534 { 537 console_flush(ti->console);538 if (console_get_size( ti->console, &ti->con_cols, &ti->con_rows) != EOK)535 fflush(stdout); 536 if (console_get_size(fphone(stdin), &ti->con_cols, &ti->con_rows) != EOK) 539 537 return EIO; 540 538 541 if (console_get_pos( ti->console, &ti->col0, &ti->row0) != EOK)539 if (console_get_pos(fphone(stdin), &ti->col0, &ti->row0) != EOK) 542 540 return EIO; 543 541 … … 550 548 551 549 while (!ti->done) { 552 console_flush(ti->console);553 554 kbd_event_t ev;555 if (!console_get_ kbd_event(ti->console, &ev))550 fflush(stdout); 551 552 console_event_t ev; 553 if (!console_get_event(fphone(stdin), &ev)) 556 554 return EIO; 557 555 … … 598 596 } 599 597 600 static void tinput_key_ctrl(tinput_t *ti, kbd_event_t *ev)598 static void tinput_key_ctrl(tinput_t *ti, console_event_t *ev) 601 599 { 602 600 switch (ev->key) { … … 637 635 } 638 636 639 static void tinput_key_ctrl_shift(tinput_t *ti, kbd_event_t *ev)637 static void tinput_key_ctrl_shift(tinput_t *ti, console_event_t *ev) 640 638 { 641 639 switch (ev->key) { … … 657 655 } 658 656 659 static void tinput_key_shift(tinput_t *ti, kbd_event_t *ev)657 static void tinput_key_shift(tinput_t *ti, console_event_t *ev) 660 658 { 661 659 switch (ev->key) { … … 683 681 } 684 682 685 static void tinput_key_unmod(tinput_t *ti, kbd_event_t *ev)683 static void tinput_key_unmod(tinput_t *ti, console_event_t *ev) 686 684 { 687 685 switch (ev->key) {
Note:
See TracChangeset
for help on using the changeset viewer.