Lines Matching refs:vc
258 static unsigned char get_attributes(struct vc_data *vc, u16 *pos) in get_attributes() argument
260 pos = screen_pos(vc, pos - (u16 *)vc->vc_origin, true); in get_attributes()
261 return (scr_readw(pos) & ~vc->vc_hi_font_mask) >> 8; in get_attributes()
264 static void speakup_date(struct vc_data *vc) in speakup_date() argument
266 spk_x = spk_cx = vc->state.x; in speakup_date()
267 spk_y = spk_cy = vc->state.y; in speakup_date()
268 spk_pos = spk_cp = vc->vc_pos; in speakup_date()
270 spk_attr = get_attributes(vc, (u_short *)spk_pos); in speakup_date()
290 static void speakup_shut_up(struct vc_data *vc) in speakup_shut_up() argument
296 speakup_date(vc); in speakup_shut_up()
301 static void speech_kill(struct vc_data *vc) in speech_kill() argument
319 static void speakup_off(struct vc_data *vc) in speakup_off() argument
328 speakup_date(vc); in speakup_off()
331 static void speakup_parked(struct vc_data *vc) in speakup_parked() argument
342 static void speakup_cut(struct vc_data *vc) in speakup_cut() argument
351 spk_sel_cons = vc; in speakup_cut()
377 static void speakup_paste(struct vc_data *vc) in speakup_paste() argument
388 static void say_attributes(struct vc_data *vc) in say_attributes() argument
413 static void announce_edge(struct vc_data *vc, enum edge msg_id) in announce_edge() argument
457 static u16 get_char(struct vc_data *vc, u16 *pos, u_char *attribs) in get_char() argument
461 if (vc && pos) { in get_char()
465 pos = screen_pos(vc, pos - (u16 *)vc->vc_origin, true); in get_char()
469 if (w & vc->vc_hi_font_mask) { in get_char()
470 w &= ~vc->vc_hi_font_mask; in get_char()
474 ch = inverse_translate(vc, c, true); in get_char()
480 static void say_char(struct vc_data *vc) in say_char() argument
485 ch = get_char(vc, (u_short *)spk_pos, &spk_attr); in say_char()
490 say_attributes(vc); in say_char()
495 static void say_phonetic_char(struct vc_data *vc) in say_phonetic_char() argument
500 ch = get_char(vc, (u_short *)spk_pos, &spk_attr); in say_phonetic_char()
511 static void say_prev_char(struct vc_data *vc) in say_prev_char() argument
515 announce_edge(vc, edge_left); in say_prev_char()
520 say_char(vc); in say_prev_char()
523 static void say_next_char(struct vc_data *vc) in say_next_char() argument
526 if (spk_x == vc->vc_cols - 1) { in say_next_char()
527 announce_edge(vc, edge_right); in say_next_char()
532 say_char(vc); in say_next_char()
544 static u_long get_word(struct vc_data *vc) in get_word() argument
552 ch = get_char(vc, (u_short *)tmp_pos, &temp); in get_word()
559 } else if (tmpx < vc->vc_cols - 2 && in get_word()
561 get_char(vc, (u_short *)tmp_pos + 1, &temp) > SPACE) { in get_word()
566 ch = get_char(vc, (u_short *)tmp_pos - 1, &temp); in get_word()
569 get_char(vc, (u_short *)tmp_pos, &temp) > SPACE) in get_word()
575 attr_ch = get_char(vc, (u_short *)tmp_pos, &spk_attr); in get_word()
577 while (tmpx < vc->vc_cols - 1 && cnt < ARRAY_SIZE(buf) - 1) { in get_word()
580 ch = get_char(vc, (u_short *)tmp_pos, &temp); in get_word()
591 static void say_word(struct vc_data *vc) in say_word() argument
593 u_long cnt = get_word(vc); in say_word()
604 static void say_prev_word(struct vc_data *vc) in say_prev_word() argument
615 announce_edge(vc, edge_top); in say_prev_word()
619 spk_x = vc->vc_cols; in say_prev_word()
633 spk_x = vc->vc_cols - 1; in say_prev_word()
638 ch = get_char(vc, (u_short *)spk_pos, &temp); in say_prev_word()
655 announce_edge(vc, edge_said); in say_prev_word()
656 say_word(vc); in say_prev_word()
659 static void say_next_word(struct vc_data *vc) in say_next_word() argument
667 if (spk_x == vc->vc_cols - 1 && spk_y == vc->vc_rows - 1) { in say_next_word()
668 announce_edge(vc, edge_bottom); in say_next_word()
672 ch = get_char(vc, (u_short *)spk_pos, &temp); in say_next_word()
681 if (spk_x >= vc->vc_cols - 1) { in say_next_word()
682 if (spk_y == vc->vc_rows - 1) { in say_next_word()
697 announce_edge(vc, edge_said); in say_next_word()
698 say_word(vc); in say_next_word()
701 static void spell_word(struct vc_data *vc) in spell_word() argument
711 if (!get_word(vc)) in spell_word()
751 static int get_line(struct vc_data *vc) in get_line() argument
758 spk_attr = get_attributes(vc, (u_short *)spk_pos); in get_line()
759 for (i = 0; i < vc->vc_cols; i++) { in get_line()
760 buf[i] = get_char(vc, (u_short *)tmp, &tmp2); in get_line()
769 static void say_line(struct vc_data *vc) in say_line() argument
771 int i = get_line(vc); in say_line()
791 static void say_prev_line(struct vc_data *vc) in say_prev_line() argument
795 announce_edge(vc, edge_top); in say_prev_line()
799 spk_pos -= vc->vc_size_row; in say_prev_line()
800 say_line(vc); in say_prev_line()
803 static void say_next_line(struct vc_data *vc) in say_next_line() argument
806 if (spk_y == vc->vc_rows - 1) { in say_next_line()
807 announce_edge(vc, edge_bottom); in say_next_line()
811 spk_pos += vc->vc_size_row; in say_next_line()
812 say_line(vc); in say_next_line()
815 static int say_from_to(struct vc_data *vc, u_long from, u_long to, in say_from_to() argument
823 spk_attr = get_attributes(vc, (u_short *)from); in say_from_to()
825 buf[i++] = get_char(vc, (u_short *)from, &tmp); in say_from_to()
827 if (i >= vc->vc_size_row) in say_from_to()
845 static void say_line_from_to(struct vc_data *vc, u_long from, u_long to, in say_line_from_to() argument
848 u_long start = vc->vc_origin + (spk_y * vc->vc_size_row); in say_line_from_to()
852 if (say_from_to(vc, start, end, read_punc) <= 0) in say_line_from_to()
881 static int get_sentence_buf(struct vc_data *vc, int read_punc) in get_sentence_buf() argument
891 start = vc->vc_origin + ((spk_y) * vc->vc_size_row); in get_sentence_buf()
892 end = vc->vc_origin + ((spk_y) * vc->vc_size_row) + vc->vc_cols * 2; in get_sentence_buf()
898 spk_attr = get_attributes(vc, (u_short *)start); in get_sentence_buf()
901 sentbuf[bn][i] = get_char(vc, (u_short *)start, &tmp); in get_sentence_buf()
914 if (i >= vc->vc_size_row) in get_sentence_buf()
932 static void say_screen_from_to(struct vc_data *vc, u_long from, u_long to) in say_screen_from_to() argument
934 u_long start = vc->vc_origin, end; in say_screen_from_to()
937 start += from * vc->vc_size_row; in say_screen_from_to()
938 if (to > vc->vc_rows) in say_screen_from_to()
939 to = vc->vc_rows; in say_screen_from_to()
940 end = vc->vc_origin + (to * vc->vc_size_row); in say_screen_from_to()
942 to = from + vc->vc_size_row; in say_screen_from_to()
943 say_from_to(vc, from, to, 1); in say_screen_from_to()
947 static void say_screen(struct vc_data *vc) in say_screen() argument
949 say_screen_from_to(vc, 0, vc->vc_rows); in say_screen()
952 static void speakup_win_say(struct vc_data *vc) in speakup_win_say() argument
960 start = vc->vc_origin + (win_top * vc->vc_size_row); in speakup_win_say()
961 end = vc->vc_origin + (win_bottom * vc->vc_size_row); in speakup_win_say()
965 say_from_to(vc, from, to, 1); in speakup_win_say()
966 start += vc->vc_size_row; in speakup_win_say()
970 static void top_edge(struct vc_data *vc) in top_edge() argument
973 spk_pos = vc->vc_origin + 2 * spk_x; in top_edge()
975 say_line(vc); in top_edge()
978 static void bottom_edge(struct vc_data *vc) in bottom_edge() argument
981 spk_pos += (vc->vc_rows - spk_y - 1) * vc->vc_size_row; in bottom_edge()
982 spk_y = vc->vc_rows - 1; in bottom_edge()
983 say_line(vc); in bottom_edge()
986 static void left_edge(struct vc_data *vc) in left_edge() argument
991 say_char(vc); in left_edge()
994 static void right_edge(struct vc_data *vc) in right_edge() argument
997 spk_pos += (vc->vc_cols - spk_x - 1) * 2; in right_edge()
998 spk_x = vc->vc_cols - 1; in right_edge()
999 say_char(vc); in right_edge()
1002 static void say_first_char(struct vc_data *vc) in say_first_char() argument
1004 int i, len = get_line(vc); in say_first_char()
1022 static void say_last_char(struct vc_data *vc) in say_last_char() argument
1024 int len = get_line(vc); in say_last_char()
1039 static void say_position(struct vc_data *vc) in say_position() argument
1042 vc->vc_num + 1); in say_position()
1047 static void say_char_num(struct vc_data *vc) in say_char_num() argument
1050 u16 ch = get_char(vc, (u_short *)spk_pos, &tmp); in say_char_num()
1057 static void say_from_top(struct vc_data *vc) in say_from_top() argument
1059 say_screen_from_to(vc, 0, spk_y); in say_from_top()
1062 static void say_to_bottom(struct vc_data *vc) in say_to_bottom() argument
1064 say_screen_from_to(vc, spk_y, vc->vc_rows); in say_to_bottom()
1067 static void say_from_left(struct vc_data *vc) in say_from_left() argument
1069 say_line_from_to(vc, 0, spk_x, 1); in say_from_left()
1072 static void say_to_right(struct vc_data *vc) in say_to_right() argument
1074 say_line_from_to(vc, spk_x, vc->vc_cols, 1); in say_to_right()
1161 static void read_all_doc(struct vc_data *vc);
1165 static void do_handle_shift(struct vc_data *vc, u_char value, char up_flag) in do_handle_shift() argument
1178 read_all_doc(vc); in do_handle_shift()
1196 static void do_handle_latin(struct vc_data *vc, u_char value, char up_flag) in do_handle_latin() argument
1298 static void toggle_cursoring(struct vc_data *vc) in toggle_cursoring() argument
1328 static int edit_bits(struct vc_data *vc, u_char type, u_char ch, u_short key) in edit_bits() argument
1350 static int speakup_allocate(struct vc_data *vc, gfp_t gfp_flags) in speakup_allocate() argument
1354 vc_num = vc->vc_num; in speakup_allocate()
1360 speakup_date(vc); in speakup_allocate()
1362 speakup_date(vc); in speakup_allocate()
1368 static void speakup_deallocate(struct vc_data *vc) in speakup_deallocate() argument
1372 vc_num = vc->vc_num; in speakup_deallocate()
1398 static void start_read_all_timer(struct vc_data *vc, enum read_all_command command);
1400 static void kbd_fakekey2(struct vc_data *vc, enum read_all_command command) in kbd_fakekey2() argument
1404 start_read_all_timer(vc, command); in kbd_fakekey2()
1407 static void read_all_doc(struct vc_data *vc) in read_all_doc() argument
1409 if ((vc->vc_num != fg_console) || !synth || spk_shut_up) in read_all_doc()
1417 if (get_sentence_buf(vc, 0) == -1) { in read_all_doc()
1421 start_read_all_timer(vc, RA_DOWN_ARROW); in read_all_doc()
1425 start_read_all_timer(vc, RA_TIMER); in read_all_doc()
1429 static void stop_read_all(struct vc_data *vc) in stop_read_all() argument
1437 static void start_read_all_timer(struct vc_data *vc, enum read_all_command command) in start_read_all_timer() argument
1441 cursor_con = vc->vc_num; in start_read_all_timer()
1448 static void handle_cursor_read_all(struct vc_data *vc, enum read_all_command command) in handle_cursor_read_all() argument
1460 kbd_fakekey2(vc, RA_FIND_NEXT_SENT); in handle_cursor_read_all()
1473 kbd_fakekey2(vc, RA_FIND_NEXT_SENT); in handle_cursor_read_all()
1478 start_read_all_timer(vc, RA_TIMER); in handle_cursor_read_all()
1483 read_all_doc(vc); in handle_cursor_read_all()
1488 if (get_sentence_buf(vc, 0) == -1) { in handle_cursor_read_all()
1489 kbd_fakekey2(vc, RA_DOWN_ARROW); in handle_cursor_read_all()
1493 start_read_all_timer(vc, RA_TIMER); in handle_cursor_read_all()
1497 rv = get_sentence_buf(vc, 0); in handle_cursor_read_all()
1499 read_all_doc(vc); in handle_cursor_read_all()
1501 kbd_fakekey2(vc, RA_FIND_NEXT_SENT); in handle_cursor_read_all()
1505 start_read_all_timer(vc, RA_TIMER); in handle_cursor_read_all()
1513 kbd_fakekey2(vc, RA_DOWN_ARROW); in handle_cursor_read_all()
1515 start_read_all_timer(vc, RA_TIMER); in handle_cursor_read_all()
1520 static int pre_handle_cursor(struct vc_data *vc, u_char value, char up_flag) in pre_handle_cursor() argument
1534 start_read_all_timer(vc, value + 1); in pre_handle_cursor()
1542 static void do_handle_cursor(struct vc_data *vc, u_char value, char up_flag) in do_handle_cursor() argument
1560 old_cursor_pos = vc->vc_pos; in do_handle_cursor()
1561 old_cursor_x = vc->state.x; in do_handle_cursor()
1562 old_cursor_y = vc->state.y; in do_handle_cursor()
1563 speakup_console[vc->vc_num]->ht.cy = vc->state.y; in do_handle_cursor()
1564 cursor_con = vc->vc_num; in do_handle_cursor()
1566 reset_highlight_buffers(vc); in do_handle_cursor()
1573 static void update_color_buffer(struct vc_data *vc, const u16 *ic, int len) in update_color_buffer() argument
1576 int vc_num = vc->vc_num; in update_color_buffer()
1578 bi = (vc->vc_attr & 0x70) >> 4; in update_color_buffer()
1583 speakup_console[vc_num]->ht.rpos[bi] = vc->vc_pos; in update_color_buffer()
1584 speakup_console[vc_num]->ht.rx[bi] = vc->state.x; in update_color_buffer()
1585 speakup_console[vc_num]->ht.ry[bi] = vc->state.y; in update_color_buffer()
1604 static void reset_highlight_buffers(struct vc_data *vc) in reset_highlight_buffers() argument
1607 int vc_num = vc->vc_num; in reset_highlight_buffers()
1613 static int count_highlight_color(struct vc_data *vc) in count_highlight_color() argument
1617 int vc_num = vc->vc_num; in count_highlight_color()
1619 u16 *start = (u16 *)vc->vc_origin; in count_highlight_color()
1624 for (i = 0; i < vc->vc_rows; i++) { in count_highlight_color()
1625 u16 *end = start + vc->vc_cols * 2; in count_highlight_color()
1629 ch = get_attributes(vc, ptr); in count_highlight_color()
1633 start += vc->vc_size_row; in count_highlight_color()
1643 static int get_highlight_color(struct vc_data *vc) in get_highlight_color() argument
1647 int vc_num = vc->vc_num; in get_highlight_color()
1665 static int speak_highlight(struct vc_data *vc) in speak_highlight() argument
1668 int vc_num = vc->vc_num; in speak_highlight()
1670 if (count_highlight_color(vc) == 1) in speak_highlight()
1672 hc = get_highlight_color(vc); in speak_highlight()
1674 d = vc->state.y - speakup_console[vc_num]->ht.cy; in speak_highlight()
1676 if (speakup_console[vc_num]->ht.ry[hc] != vc->state.y) in speak_highlight()
1692 struct vc_data *vc = vc_cons[cursor_con].d; in cursor_done() local
1701 speakup_date(vc); in cursor_done()
1703 if (vc->state.x >= win_left && vc->state.x <= win_right && in cursor_done()
1704 vc->state.y >= win_top && vc->state.y <= win_bottom) { in cursor_done()
1711 handle_cursor_read_all(vc, read_all_key); in cursor_done()
1715 if (speak_highlight(vc)) { in cursor_done()
1722 speakup_win_say(vc); in cursor_done()
1724 say_line_from_to(vc, 0, vc->vc_cols, 0); in cursor_done()
1727 say_phonetic_char(vc); in cursor_done()
1729 say_char(vc); in cursor_done()
1738 static void speakup_bs(struct vc_data *vc) in speakup_bs() argument
1742 if (!speakup_console[vc->vc_num]) in speakup_bs()
1748 speakup_date(vc); in speakup_bs()
1753 if (vc->vc_num == fg_console && spk_keydown) { in speakup_bs()
1756 say_char(vc); in speakup_bs()
1762 static void speakup_con_write(struct vc_data *vc, u16 *str, int len) in speakup_con_write() argument
1766 if ((vc->vc_num != fg_console) || spk_shut_up || !synth) in speakup_con_write()
1771 if (spk_bell_pos && spk_keydown && (vc->state.x == spk_bell_pos - 1)) in speakup_con_write()
1775 update_color_buffer(vc, str, len); in speakup_con_write()
1780 if (vc->state.x >= win_left && vc->state.x <= win_right && in speakup_con_write()
1781 vc->state.y >= win_top && vc->state.y <= win_bottom) { in speakup_con_write()
1791 static void speakup_con_update(struct vc_data *vc) in speakup_con_update() argument
1795 if (!speakup_console[vc->vc_num] || spk_parked || !synth) in speakup_con_update()
1800 speakup_date(vc); in speakup_con_update()
1801 if (vc->vc_mode == KD_GRAPHICS && !spk_paused && spk_str_pause[0]) { in speakup_con_update()
1808 static void do_handle_spec(struct vc_data *vc, u_char value, char up_flag) in do_handle_spec() argument
1832 if (speakup_console[vc->vc_num]) in do_handle_spec()
1833 speakup_console[vc->vc_num]->tty_stopped = on_off; in do_handle_spec()
1879 static void speakup_win_set(struct vc_data *vc) in speakup_win_set() argument
1893 win_right = vc->vc_cols - 1; in speakup_win_set()
1914 static void speakup_win_clear(struct vc_data *vc) in speakup_win_clear() argument
1924 static void speakup_win_enable(struct vc_data *vc) in speakup_win_enable() argument
1937 static void speakup_bits(struct vc_data *vc) in speakup_bits() argument
1950 static int handle_goto(struct vc_data *vc, u_char type, u_char ch, u_short key) in handle_goto() argument
2005 if (goto_pos >= vc->vc_cols) in handle_goto()
2006 goto_pos = vc->vc_cols - 1; in handle_goto()
2014 if (goto_pos >= vc->vc_rows) in handle_goto()
2015 goto_pos = vc->vc_rows - 1; in handle_goto()
2026 say_word(vc); in handle_goto()
2029 spk_pos = vc->vc_origin + (goto_pos * vc->vc_size_row); in handle_goto()
2030 say_line(vc); in handle_goto()
2035 static void speakup_goto(struct vc_data *vc) in speakup_goto() argument
2045 static void speakup_help(struct vc_data *vc) in speakup_help() argument
2047 spk_handle_help(vc, KT_SPKUP, SPEAKUP_HELP, 0); in speakup_help()
2050 static void do_nothing(struct vc_data *vc) in do_nothing() argument
2057 static void speakup_lock(struct vc_data *vc) in speakup_lock() argument
2088 static void do_spkup(struct vc_data *vc, u_char value) in do_spkup() argument
2098 (*spkup_handler[value]) (vc); in do_spkup()
2108 speakup_key(struct vc_data *vc, int shift_state, int keycode, u_short keysym, in speakup_key() argument
2122 tty = vc->port.tty; in speakup_key()
2153 stop_read_all(vc); in speakup_key()
2190 do_spkup(vc, new_key); in speakup_key()
2214 ret = (*spk_special_handler) (vc, type, value, keycode); in speakup_key()
2230 struct vc_data *vc = param->vc; in keyboard_notifier_call() local
2237 if (vc->vc_mode == KD_GRAPHICS) in keyboard_notifier_call()
2264 if (speakup_key(vc, param->shift, keycode, param->value, up)) in keyboard_notifier_call()
2267 ret = pre_handle_cursor(vc, KVAL(param->value), up); in keyboard_notifier_call()
2275 do_handle_shift(vc, val, up); in keyboard_notifier_call()
2279 do_handle_latin(vc, val, up); in keyboard_notifier_call()
2282 do_handle_cursor(vc, val, up); in keyboard_notifier_call()
2285 do_handle_spec(vc, val, up); in keyboard_notifier_call()
2300 struct vc_data *vc = param->vc; in vt_notifier_call() local
2304 if (vc->vc_mode == KD_TEXT) in vt_notifier_call()
2305 speakup_allocate(vc, GFP_ATOMIC); in vt_notifier_call()
2308 speakup_deallocate(vc); in vt_notifier_call()
2312 speakup_bs(vc); in vt_notifier_call()
2316 speakup_con_write(vc, &d, 1); in vt_notifier_call()
2320 speakup_con_update(vc); in vt_notifier_call()
2367 struct vc_data *vc = vc_cons[fg_console].d; in speakup_init() local
2375 spk_vars[0].u.n.high = vc->vc_cols; in speakup_init()