Lines Matching refs:vc
257 static unsigned char get_attributes(struct vc_data *vc, u16 *pos) in get_attributes() argument
259 pos = screen_pos(vc, pos - (u16 *)vc->vc_origin, true); in get_attributes()
260 return (scr_readw(pos) & ~vc->vc_hi_font_mask) >> 8; in get_attributes()
263 static void speakup_date(struct vc_data *vc) in speakup_date() argument
265 spk_x = spk_cx = vc->state.x; in speakup_date()
266 spk_y = spk_cy = vc->state.y; in speakup_date()
267 spk_pos = spk_cp = vc->vc_pos; in speakup_date()
269 spk_attr = get_attributes(vc, (u_short *)spk_pos); in speakup_date()
289 static void speakup_shut_up(struct vc_data *vc) in speakup_shut_up() argument
295 speakup_date(vc); in speakup_shut_up()
300 static void speech_kill(struct vc_data *vc) in speech_kill() argument
318 static void speakup_off(struct vc_data *vc) in speakup_off() argument
327 speakup_date(vc); in speakup_off()
330 static void speakup_parked(struct vc_data *vc) in speakup_parked() argument
341 static void speakup_cut(struct vc_data *vc) in speakup_cut() argument
350 spk_sel_cons = vc; in speakup_cut()
376 static void speakup_paste(struct vc_data *vc) in speakup_paste() argument
387 static void say_attributes(struct vc_data *vc) in say_attributes() argument
412 static void announce_edge(struct vc_data *vc, enum edge msg_id) in announce_edge() argument
456 static u16 get_char(struct vc_data *vc, u16 *pos, u_char *attribs) in get_char() argument
460 if (vc && pos) { in get_char()
464 pos = screen_pos(vc, pos - (u16 *)vc->vc_origin, true); in get_char()
468 if (w & vc->vc_hi_font_mask) { in get_char()
469 w &= ~vc->vc_hi_font_mask; in get_char()
473 ch = inverse_translate(vc, c, 1); in get_char()
479 static void say_char(struct vc_data *vc) in say_char() argument
484 ch = get_char(vc, (u_short *)spk_pos, &spk_attr); in say_char()
489 say_attributes(vc); in say_char()
494 static void say_phonetic_char(struct vc_data *vc) in say_phonetic_char() argument
499 ch = get_char(vc, (u_short *)spk_pos, &spk_attr); in say_phonetic_char()
510 static void say_prev_char(struct vc_data *vc) in say_prev_char() argument
514 announce_edge(vc, edge_left); in say_prev_char()
519 say_char(vc); in say_prev_char()
522 static void say_next_char(struct vc_data *vc) in say_next_char() argument
525 if (spk_x == vc->vc_cols - 1) { in say_next_char()
526 announce_edge(vc, edge_right); in say_next_char()
531 say_char(vc); in say_next_char()
543 static u_long get_word(struct vc_data *vc) in get_word() argument
551 ch = get_char(vc, (u_short *)tmp_pos, &temp); in get_word()
558 } else if (tmpx < vc->vc_cols - 2 && in get_word()
560 get_char(vc, (u_short *)tmp_pos + 1, &temp) > SPACE) { in get_word()
565 ch = get_char(vc, (u_short *)tmp_pos - 1, &temp); in get_word()
568 get_char(vc, (u_short *)tmp_pos, &temp) > SPACE) in get_word()
574 attr_ch = get_char(vc, (u_short *)tmp_pos, &spk_attr); in get_word()
576 while (tmpx < vc->vc_cols - 1) { in get_word()
579 ch = get_char(vc, (u_short *)tmp_pos, &temp); in get_word()
590 static void say_word(struct vc_data *vc) in say_word() argument
592 u_long cnt = get_word(vc); in say_word()
603 static void say_prev_word(struct vc_data *vc) in say_prev_word() argument
614 announce_edge(vc, edge_top); in say_prev_word()
618 spk_x = vc->vc_cols; in say_prev_word()
632 spk_x = vc->vc_cols - 1; in say_prev_word()
637 ch = get_char(vc, (u_short *)spk_pos, &temp); in say_prev_word()
654 announce_edge(vc, edge_said); in say_prev_word()
655 say_word(vc); in say_prev_word()
658 static void say_next_word(struct vc_data *vc) in say_next_word() argument
666 if (spk_x == vc->vc_cols - 1 && spk_y == vc->vc_rows - 1) { in say_next_word()
667 announce_edge(vc, edge_bottom); in say_next_word()
671 ch = get_char(vc, (u_short *)spk_pos, &temp); in say_next_word()
680 if (spk_x >= vc->vc_cols - 1) { in say_next_word()
681 if (spk_y == vc->vc_rows - 1) { in say_next_word()
696 announce_edge(vc, edge_said); in say_next_word()
697 say_word(vc); in say_next_word()
700 static void spell_word(struct vc_data *vc) in spell_word() argument
710 if (!get_word(vc)) in spell_word()
750 static int get_line(struct vc_data *vc) in get_line() argument
757 spk_attr = get_attributes(vc, (u_short *)spk_pos); in get_line()
758 for (i = 0; i < vc->vc_cols; i++) { in get_line()
759 buf[i] = get_char(vc, (u_short *)tmp, &tmp2); in get_line()
768 static void say_line(struct vc_data *vc) in say_line() argument
770 int i = get_line(vc); in say_line()
790 static void say_prev_line(struct vc_data *vc) in say_prev_line() argument
794 announce_edge(vc, edge_top); in say_prev_line()
798 spk_pos -= vc->vc_size_row; in say_prev_line()
799 say_line(vc); in say_prev_line()
802 static void say_next_line(struct vc_data *vc) in say_next_line() argument
805 if (spk_y == vc->vc_rows - 1) { in say_next_line()
806 announce_edge(vc, edge_bottom); in say_next_line()
810 spk_pos += vc->vc_size_row; in say_next_line()
811 say_line(vc); in say_next_line()
814 static int say_from_to(struct vc_data *vc, u_long from, u_long to, in say_from_to() argument
822 spk_attr = get_attributes(vc, (u_short *)from); in say_from_to()
824 buf[i++] = get_char(vc, (u_short *)from, &tmp); in say_from_to()
826 if (i >= vc->vc_size_row) in say_from_to()
844 static void say_line_from_to(struct vc_data *vc, u_long from, u_long to, in say_line_from_to() argument
847 u_long start = vc->vc_origin + (spk_y * vc->vc_size_row); in say_line_from_to()
851 if (say_from_to(vc, start, end, read_punc) <= 0) in say_line_from_to()
880 static int get_sentence_buf(struct vc_data *vc, int read_punc) in get_sentence_buf() argument
890 start = vc->vc_origin + ((spk_y) * vc->vc_size_row); in get_sentence_buf()
891 end = vc->vc_origin + ((spk_y) * vc->vc_size_row) + vc->vc_cols * 2; in get_sentence_buf()
897 spk_attr = get_attributes(vc, (u_short *)start); in get_sentence_buf()
900 sentbuf[bn][i] = get_char(vc, (u_short *)start, &tmp); in get_sentence_buf()
913 if (i >= vc->vc_size_row) in get_sentence_buf()
931 static void say_screen_from_to(struct vc_data *vc, u_long from, u_long to) in say_screen_from_to() argument
933 u_long start = vc->vc_origin, end; in say_screen_from_to()
936 start += from * vc->vc_size_row; in say_screen_from_to()
937 if (to > vc->vc_rows) in say_screen_from_to()
938 to = vc->vc_rows; in say_screen_from_to()
939 end = vc->vc_origin + (to * vc->vc_size_row); in say_screen_from_to()
941 to = from + vc->vc_size_row; in say_screen_from_to()
942 say_from_to(vc, from, to, 1); in say_screen_from_to()
946 static void say_screen(struct vc_data *vc) in say_screen() argument
948 say_screen_from_to(vc, 0, vc->vc_rows); in say_screen()
951 static void speakup_win_say(struct vc_data *vc) in speakup_win_say() argument
959 start = vc->vc_origin + (win_top * vc->vc_size_row); in speakup_win_say()
960 end = vc->vc_origin + (win_bottom * vc->vc_size_row); in speakup_win_say()
964 say_from_to(vc, from, to, 1); in speakup_win_say()
965 start += vc->vc_size_row; in speakup_win_say()
969 static void top_edge(struct vc_data *vc) in top_edge() argument
972 spk_pos = vc->vc_origin + 2 * spk_x; in top_edge()
974 say_line(vc); in top_edge()
977 static void bottom_edge(struct vc_data *vc) in bottom_edge() argument
980 spk_pos += (vc->vc_rows - spk_y - 1) * vc->vc_size_row; in bottom_edge()
981 spk_y = vc->vc_rows - 1; in bottom_edge()
982 say_line(vc); in bottom_edge()
985 static void left_edge(struct vc_data *vc) in left_edge() argument
990 say_char(vc); in left_edge()
993 static void right_edge(struct vc_data *vc) in right_edge() argument
996 spk_pos += (vc->vc_cols - spk_x - 1) * 2; in right_edge()
997 spk_x = vc->vc_cols - 1; in right_edge()
998 say_char(vc); in right_edge()
1001 static void say_first_char(struct vc_data *vc) in say_first_char() argument
1003 int i, len = get_line(vc); in say_first_char()
1021 static void say_last_char(struct vc_data *vc) in say_last_char() argument
1023 int len = get_line(vc); in say_last_char()
1038 static void say_position(struct vc_data *vc) in say_position() argument
1041 vc->vc_num + 1); in say_position()
1046 static void say_char_num(struct vc_data *vc) in say_char_num() argument
1049 u16 ch = get_char(vc, (u_short *)spk_pos, &tmp); in say_char_num()
1056 static void say_from_top(struct vc_data *vc) in say_from_top() argument
1058 say_screen_from_to(vc, 0, spk_y); in say_from_top()
1061 static void say_to_bottom(struct vc_data *vc) in say_to_bottom() argument
1063 say_screen_from_to(vc, spk_y, vc->vc_rows); in say_to_bottom()
1066 static void say_from_left(struct vc_data *vc) in say_from_left() argument
1068 say_line_from_to(vc, 0, spk_x, 1); in say_from_left()
1071 static void say_to_right(struct vc_data *vc) in say_to_right() argument
1073 say_line_from_to(vc, spk_x, vc->vc_cols, 1); in say_to_right()
1160 static void read_all_doc(struct vc_data *vc);
1164 static void do_handle_shift(struct vc_data *vc, u_char value, char up_flag) in do_handle_shift() argument
1177 read_all_doc(vc); in do_handle_shift()
1195 static void do_handle_latin(struct vc_data *vc, u_char value, char up_flag) in do_handle_latin() argument
1288 static void toggle_cursoring(struct vc_data *vc) in toggle_cursoring() argument
1318 static int edit_bits(struct vc_data *vc, u_char type, u_char ch, u_short key) in edit_bits() argument
1340 static int speakup_allocate(struct vc_data *vc, gfp_t gfp_flags) in speakup_allocate() argument
1344 vc_num = vc->vc_num; in speakup_allocate()
1350 speakup_date(vc); in speakup_allocate()
1352 speakup_date(vc); in speakup_allocate()
1358 static void speakup_deallocate(struct vc_data *vc) in speakup_deallocate() argument
1362 vc_num = vc->vc_num; in speakup_deallocate()
1388 static void start_read_all_timer(struct vc_data *vc, enum read_all_command command);
1390 static void kbd_fakekey2(struct vc_data *vc, enum read_all_command command) in kbd_fakekey2() argument
1394 start_read_all_timer(vc, command); in kbd_fakekey2()
1397 static void read_all_doc(struct vc_data *vc) in read_all_doc() argument
1399 if ((vc->vc_num != fg_console) || !synth || spk_shut_up) in read_all_doc()
1407 if (get_sentence_buf(vc, 0) == -1) { in read_all_doc()
1411 start_read_all_timer(vc, RA_DOWN_ARROW); in read_all_doc()
1415 start_read_all_timer(vc, RA_TIMER); in read_all_doc()
1419 static void stop_read_all(struct vc_data *vc) in stop_read_all() argument
1427 static void start_read_all_timer(struct vc_data *vc, enum read_all_command command) in start_read_all_timer() argument
1431 cursor_con = vc->vc_num; in start_read_all_timer()
1438 static void handle_cursor_read_all(struct vc_data *vc, enum read_all_command command) in handle_cursor_read_all() argument
1450 kbd_fakekey2(vc, RA_FIND_NEXT_SENT); in handle_cursor_read_all()
1463 kbd_fakekey2(vc, RA_FIND_NEXT_SENT); in handle_cursor_read_all()
1468 start_read_all_timer(vc, RA_TIMER); in handle_cursor_read_all()
1473 read_all_doc(vc); in handle_cursor_read_all()
1478 if (get_sentence_buf(vc, 0) == -1) { in handle_cursor_read_all()
1479 kbd_fakekey2(vc, RA_DOWN_ARROW); in handle_cursor_read_all()
1483 start_read_all_timer(vc, RA_TIMER); in handle_cursor_read_all()
1487 rv = get_sentence_buf(vc, 0); in handle_cursor_read_all()
1489 read_all_doc(vc); in handle_cursor_read_all()
1491 kbd_fakekey2(vc, RA_FIND_NEXT_SENT); in handle_cursor_read_all()
1495 start_read_all_timer(vc, RA_TIMER); in handle_cursor_read_all()
1503 kbd_fakekey2(vc, RA_DOWN_ARROW); in handle_cursor_read_all()
1505 start_read_all_timer(vc, RA_TIMER); in handle_cursor_read_all()
1510 static int pre_handle_cursor(struct vc_data *vc, u_char value, char up_flag) in pre_handle_cursor() argument
1524 start_read_all_timer(vc, value + 1); in pre_handle_cursor()
1532 static void do_handle_cursor(struct vc_data *vc, u_char value, char up_flag) in do_handle_cursor() argument
1550 old_cursor_pos = vc->vc_pos; in do_handle_cursor()
1551 old_cursor_x = vc->state.x; in do_handle_cursor()
1552 old_cursor_y = vc->state.y; in do_handle_cursor()
1553 speakup_console[vc->vc_num]->ht.cy = vc->state.y; in do_handle_cursor()
1554 cursor_con = vc->vc_num; in do_handle_cursor()
1556 reset_highlight_buffers(vc); in do_handle_cursor()
1563 static void update_color_buffer(struct vc_data *vc, const u16 *ic, int len) in update_color_buffer() argument
1566 int vc_num = vc->vc_num; in update_color_buffer()
1568 bi = (vc->vc_attr & 0x70) >> 4; in update_color_buffer()
1573 speakup_console[vc_num]->ht.rpos[bi] = vc->vc_pos; in update_color_buffer()
1574 speakup_console[vc_num]->ht.rx[bi] = vc->state.x; in update_color_buffer()
1575 speakup_console[vc_num]->ht.ry[bi] = vc->state.y; in update_color_buffer()
1594 static void reset_highlight_buffers(struct vc_data *vc) in reset_highlight_buffers() argument
1597 int vc_num = vc->vc_num; in reset_highlight_buffers()
1603 static int count_highlight_color(struct vc_data *vc) in count_highlight_color() argument
1607 int vc_num = vc->vc_num; in count_highlight_color()
1609 u16 *start = (u16 *)vc->vc_origin; in count_highlight_color()
1614 for (i = 0; i < vc->vc_rows; i++) { in count_highlight_color()
1615 u16 *end = start + vc->vc_cols * 2; in count_highlight_color()
1619 ch = get_attributes(vc, ptr); in count_highlight_color()
1623 start += vc->vc_size_row; in count_highlight_color()
1633 static int get_highlight_color(struct vc_data *vc) in get_highlight_color() argument
1637 int vc_num = vc->vc_num; in get_highlight_color()
1655 static int speak_highlight(struct vc_data *vc) in speak_highlight() argument
1658 int vc_num = vc->vc_num; in speak_highlight()
1660 if (count_highlight_color(vc) == 1) in speak_highlight()
1662 hc = get_highlight_color(vc); in speak_highlight()
1664 d = vc->state.y - speakup_console[vc_num]->ht.cy; in speak_highlight()
1666 if (speakup_console[vc_num]->ht.ry[hc] != vc->state.y) in speak_highlight()
1682 struct vc_data *vc = vc_cons[cursor_con].d; in cursor_done() local
1691 speakup_date(vc); in cursor_done()
1693 if (vc->state.x >= win_left && vc->state.x <= win_right && in cursor_done()
1694 vc->state.y >= win_top && vc->state.y <= win_bottom) { in cursor_done()
1701 handle_cursor_read_all(vc, read_all_key); in cursor_done()
1705 if (speak_highlight(vc)) { in cursor_done()
1712 speakup_win_say(vc); in cursor_done()
1714 say_line_from_to(vc, 0, vc->vc_cols, 0); in cursor_done()
1716 say_char(vc); in cursor_done()
1724 static void speakup_bs(struct vc_data *vc) in speakup_bs() argument
1728 if (!speakup_console[vc->vc_num]) in speakup_bs()
1734 speakup_date(vc); in speakup_bs()
1739 if (vc->vc_num == fg_console && spk_keydown) { in speakup_bs()
1742 say_char(vc); in speakup_bs()
1748 static void speakup_con_write(struct vc_data *vc, u16 *str, int len) in speakup_con_write() argument
1752 if ((vc->vc_num != fg_console) || spk_shut_up || !synth) in speakup_con_write()
1757 if (spk_bell_pos && spk_keydown && (vc->state.x == spk_bell_pos - 1)) in speakup_con_write()
1761 update_color_buffer(vc, str, len); in speakup_con_write()
1766 if (vc->state.x >= win_left && vc->state.x <= win_right && in speakup_con_write()
1767 vc->state.y >= win_top && vc->state.y <= win_bottom) { in speakup_con_write()
1777 static void speakup_con_update(struct vc_data *vc) in speakup_con_update() argument
1781 if (!speakup_console[vc->vc_num] || spk_parked || !synth) in speakup_con_update()
1786 speakup_date(vc); in speakup_con_update()
1787 if (vc->vc_mode == KD_GRAPHICS && !spk_paused && spk_str_pause[0]) { in speakup_con_update()
1794 static void do_handle_spec(struct vc_data *vc, u_char value, char up_flag) in do_handle_spec() argument
1818 if (speakup_console[vc->vc_num]) in do_handle_spec()
1819 speakup_console[vc->vc_num]->tty_stopped = on_off; in do_handle_spec()
1865 static void speakup_win_set(struct vc_data *vc) in speakup_win_set() argument
1879 win_right = vc->vc_cols - 1; in speakup_win_set()
1900 static void speakup_win_clear(struct vc_data *vc) in speakup_win_clear() argument
1910 static void speakup_win_enable(struct vc_data *vc) in speakup_win_enable() argument
1923 static void speakup_bits(struct vc_data *vc) in speakup_bits() argument
1936 static int handle_goto(struct vc_data *vc, u_char type, u_char ch, u_short key) in handle_goto() argument
1991 if (goto_pos >= vc->vc_cols) in handle_goto()
1992 goto_pos = vc->vc_cols - 1; in handle_goto()
2000 if (goto_pos >= vc->vc_rows) in handle_goto()
2001 goto_pos = vc->vc_rows - 1; in handle_goto()
2012 say_word(vc); in handle_goto()
2015 spk_pos = vc->vc_origin + (goto_pos * vc->vc_size_row); in handle_goto()
2016 say_line(vc); in handle_goto()
2021 static void speakup_goto(struct vc_data *vc) in speakup_goto() argument
2031 static void speakup_help(struct vc_data *vc) in speakup_help() argument
2033 spk_handle_help(vc, KT_SPKUP, SPEAKUP_HELP, 0); in speakup_help()
2036 static void do_nothing(struct vc_data *vc) in do_nothing() argument
2043 static void speakup_lock(struct vc_data *vc) in speakup_lock() argument
2074 static void do_spkup(struct vc_data *vc, u_char value) in do_spkup() argument
2084 (*spkup_handler[value]) (vc); in do_spkup()
2094 speakup_key(struct vc_data *vc, int shift_state, int keycode, u_short keysym, in speakup_key() argument
2108 tty = vc->port.tty; in speakup_key()
2139 stop_read_all(vc); in speakup_key()
2176 do_spkup(vc, new_key); in speakup_key()
2200 ret = (*spk_special_handler) (vc, type, value, keycode); in speakup_key()
2216 struct vc_data *vc = param->vc; in keyboard_notifier_call() local
2223 if (vc->vc_mode == KD_GRAPHICS) in keyboard_notifier_call()
2250 if (speakup_key(vc, param->shift, keycode, param->value, up)) in keyboard_notifier_call()
2253 ret = pre_handle_cursor(vc, KVAL(param->value), up); in keyboard_notifier_call()
2261 do_handle_shift(vc, val, up); in keyboard_notifier_call()
2265 do_handle_latin(vc, val, up); in keyboard_notifier_call()
2268 do_handle_cursor(vc, val, up); in keyboard_notifier_call()
2271 do_handle_spec(vc, val, up); in keyboard_notifier_call()
2286 struct vc_data *vc = param->vc; in vt_notifier_call() local
2290 if (vc->vc_mode == KD_TEXT) in vt_notifier_call()
2291 speakup_allocate(vc, GFP_ATOMIC); in vt_notifier_call()
2294 speakup_deallocate(vc); in vt_notifier_call()
2298 speakup_bs(vc); in vt_notifier_call()
2302 speakup_con_write(vc, &d, 1); in vt_notifier_call()
2306 speakup_con_update(vc); in vt_notifier_call()
2353 struct vc_data *vc = vc_cons[fg_console].d; in speakup_init() local
2361 spk_vars[0].u.n.high = vc->vc_cols; in speakup_init()