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
415 static void announce_edge(struct vc_data *vc, int msg_id) in announce_edge() argument
459 static u16 get_char(struct vc_data *vc, u16 *pos, u_char *attribs) in get_char() argument
463 if (vc && pos) { in get_char()
467 pos = screen_pos(vc, pos - (u16 *)vc->vc_origin, true); in get_char()
471 if (w & vc->vc_hi_font_mask) { in get_char()
472 w &= ~vc->vc_hi_font_mask; in get_char()
476 ch = inverse_translate(vc, c, 1); in get_char()
482 static void say_char(struct vc_data *vc) in say_char() argument
487 ch = get_char(vc, (u_short *)spk_pos, &spk_attr); in say_char()
492 say_attributes(vc); in say_char()
497 static void say_phonetic_char(struct vc_data *vc) in say_phonetic_char() argument
502 ch = get_char(vc, (u_short *)spk_pos, &spk_attr); in say_phonetic_char()
513 static void say_prev_char(struct vc_data *vc) in say_prev_char() argument
517 announce_edge(vc, edge_left); in say_prev_char()
522 say_char(vc); in say_prev_char()
525 static void say_next_char(struct vc_data *vc) in say_next_char() argument
528 if (spk_x == vc->vc_cols - 1) { in say_next_char()
529 announce_edge(vc, edge_right); in say_next_char()
534 say_char(vc); in say_next_char()
546 static u_long get_word(struct vc_data *vc) in get_word() argument
554 ch = get_char(vc, (u_short *)tmp_pos, &temp); in get_word()
561 } else if (tmpx < vc->vc_cols - 2 && in get_word()
563 get_char(vc, (u_short *)tmp_pos + 1, &temp) > SPACE) { in get_word()
568 ch = get_char(vc, (u_short *)tmp_pos - 1, &temp); in get_word()
571 get_char(vc, (u_short *)tmp_pos, &temp) > SPACE) in get_word()
577 attr_ch = get_char(vc, (u_short *)tmp_pos, &spk_attr); in get_word()
579 while (tmpx < vc->vc_cols - 1) { in get_word()
582 ch = get_char(vc, (u_short *)tmp_pos, &temp); in get_word()
593 static void say_word(struct vc_data *vc) in say_word() argument
595 u_long cnt = get_word(vc); in say_word()
606 static void say_prev_word(struct vc_data *vc) in say_prev_word() argument
616 announce_edge(vc, edge_top); in say_prev_word()
620 spk_x = vc->vc_cols; in say_prev_word()
634 spk_x = vc->vc_cols - 1; in say_prev_word()
639 ch = get_char(vc, (u_short *)spk_pos, &temp); in say_prev_word()
656 announce_edge(vc, edge_said); in say_prev_word()
657 say_word(vc); in say_prev_word()
660 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
1289 static void toggle_cursoring(struct vc_data *vc) in toggle_cursoring() argument
1319 static int edit_bits(struct vc_data *vc, u_char type, u_char ch, u_short key) in edit_bits() argument
1341 static int speakup_allocate(struct vc_data *vc, gfp_t gfp_flags) in speakup_allocate() argument
1345 vc_num = vc->vc_num; in speakup_allocate()
1351 speakup_date(vc); in speakup_allocate()
1353 speakup_date(vc); in speakup_allocate()
1359 static void speakup_deallocate(struct vc_data *vc) in speakup_deallocate() argument
1363 vc_num = vc->vc_num; in speakup_deallocate()
1378 static void start_read_all_timer(struct vc_data *vc, int command);
1392 static void kbd_fakekey2(struct vc_data *vc, int command) in kbd_fakekey2() argument
1396 start_read_all_timer(vc, command); in kbd_fakekey2()
1399 static void read_all_doc(struct vc_data *vc) in read_all_doc() argument
1401 if ((vc->vc_num != fg_console) || !synth || spk_shut_up) in read_all_doc()
1409 if (get_sentence_buf(vc, 0) == -1) { in read_all_doc()
1413 start_read_all_timer(vc, RA_DOWN_ARROW); in read_all_doc()
1417 start_read_all_timer(vc, RA_TIMER); in read_all_doc()
1421 static void stop_read_all(struct vc_data *vc) in stop_read_all() argument
1429 static void start_read_all_timer(struct vc_data *vc, int command) in start_read_all_timer() argument
1433 cursor_con = vc->vc_num; in start_read_all_timer()
1440 static void handle_cursor_read_all(struct vc_data *vc, int command) in handle_cursor_read_all() argument
1452 kbd_fakekey2(vc, RA_FIND_NEXT_SENT); in handle_cursor_read_all()
1465 kbd_fakekey2(vc, RA_FIND_NEXT_SENT); in handle_cursor_read_all()
1470 start_read_all_timer(vc, RA_TIMER); in handle_cursor_read_all()
1475 read_all_doc(vc); in handle_cursor_read_all()
1480 if (get_sentence_buf(vc, 0) == -1) { in handle_cursor_read_all()
1481 kbd_fakekey2(vc, RA_DOWN_ARROW); in handle_cursor_read_all()
1485 start_read_all_timer(vc, RA_TIMER); in handle_cursor_read_all()
1489 rv = get_sentence_buf(vc, 0); in handle_cursor_read_all()
1491 read_all_doc(vc); in handle_cursor_read_all()
1493 kbd_fakekey2(vc, RA_FIND_NEXT_SENT); in handle_cursor_read_all()
1497 start_read_all_timer(vc, RA_TIMER); in handle_cursor_read_all()
1505 kbd_fakekey2(vc, RA_DOWN_ARROW); in handle_cursor_read_all()
1507 start_read_all_timer(vc, RA_TIMER); in handle_cursor_read_all()
1512 static int pre_handle_cursor(struct vc_data *vc, u_char value, char up_flag) in pre_handle_cursor() argument
1526 start_read_all_timer(vc, value + 1); in pre_handle_cursor()
1534 static void do_handle_cursor(struct vc_data *vc, u_char value, char up_flag) in do_handle_cursor() argument
1552 old_cursor_pos = vc->vc_pos; in do_handle_cursor()
1553 old_cursor_x = vc->state.x; in do_handle_cursor()
1554 old_cursor_y = vc->state.y; in do_handle_cursor()
1555 speakup_console[vc->vc_num]->ht.cy = vc->state.y; in do_handle_cursor()
1556 cursor_con = vc->vc_num; in do_handle_cursor()
1558 reset_highlight_buffers(vc); in do_handle_cursor()
1565 static void update_color_buffer(struct vc_data *vc, const u16 *ic, int len) in update_color_buffer() argument
1568 int vc_num = vc->vc_num; in update_color_buffer()
1570 bi = (vc->vc_attr & 0x70) >> 4; in update_color_buffer()
1575 speakup_console[vc_num]->ht.rpos[bi] = vc->vc_pos; in update_color_buffer()
1576 speakup_console[vc_num]->ht.rx[bi] = vc->state.x; in update_color_buffer()
1577 speakup_console[vc_num]->ht.ry[bi] = vc->state.y; in update_color_buffer()
1596 static void reset_highlight_buffers(struct vc_data *vc) in reset_highlight_buffers() argument
1599 int vc_num = vc->vc_num; in reset_highlight_buffers()
1605 static int count_highlight_color(struct vc_data *vc) in count_highlight_color() argument
1609 int vc_num = vc->vc_num; in count_highlight_color()
1611 u16 *start = (u16 *)vc->vc_origin; in count_highlight_color()
1616 for (i = 0; i < vc->vc_rows; i++) { in count_highlight_color()
1617 u16 *end = start + vc->vc_cols * 2; in count_highlight_color()
1621 ch = get_attributes(vc, ptr); in count_highlight_color()
1625 start += vc->vc_size_row; in count_highlight_color()
1635 static int get_highlight_color(struct vc_data *vc) in get_highlight_color() argument
1639 int vc_num = vc->vc_num; in get_highlight_color()
1657 static int speak_highlight(struct vc_data *vc) in speak_highlight() argument
1660 int vc_num = vc->vc_num; in speak_highlight()
1662 if (count_highlight_color(vc) == 1) in speak_highlight()
1664 hc = get_highlight_color(vc); in speak_highlight()
1666 d = vc->state.y - speakup_console[vc_num]->ht.cy; in speak_highlight()
1668 if (speakup_console[vc_num]->ht.ry[hc] != vc->state.y) in speak_highlight()
1684 struct vc_data *vc = vc_cons[cursor_con].d; in cursor_done() local
1693 speakup_date(vc); in cursor_done()
1695 if (vc->state.x >= win_left && vc->state.x <= win_right && in cursor_done()
1696 vc->state.y >= win_top && vc->state.y <= win_bottom) { in cursor_done()
1703 handle_cursor_read_all(vc, read_all_key); in cursor_done()
1707 if (speak_highlight(vc)) { in cursor_done()
1714 speakup_win_say(vc); in cursor_done()
1716 say_line_from_to(vc, 0, vc->vc_cols, 0); in cursor_done()
1718 say_char(vc); in cursor_done()
1726 static void speakup_bs(struct vc_data *vc) in speakup_bs() argument
1730 if (!speakup_console[vc->vc_num]) in speakup_bs()
1736 speakup_date(vc); in speakup_bs()
1741 if (vc->vc_num == fg_console && spk_keydown) { in speakup_bs()
1744 say_char(vc); in speakup_bs()
1750 static void speakup_con_write(struct vc_data *vc, u16 *str, int len) in speakup_con_write() argument
1754 if ((vc->vc_num != fg_console) || spk_shut_up || !synth) in speakup_con_write()
1759 if (spk_bell_pos && spk_keydown && (vc->state.x == spk_bell_pos - 1)) in speakup_con_write()
1763 update_color_buffer(vc, str, len); in speakup_con_write()
1768 if (vc->state.x >= win_left && vc->state.x <= win_right && in speakup_con_write()
1769 vc->state.y >= win_top && vc->state.y <= win_bottom) { in speakup_con_write()
1779 static void speakup_con_update(struct vc_data *vc) in speakup_con_update() argument
1783 if (!speakup_console[vc->vc_num] || spk_parked) in speakup_con_update()
1788 speakup_date(vc); in speakup_con_update()
1789 if (vc->vc_mode == KD_GRAPHICS && !spk_paused && spk_str_pause[0]) { in speakup_con_update()
1796 static void do_handle_spec(struct vc_data *vc, u_char value, char up_flag) in do_handle_spec() argument
1820 if (speakup_console[vc->vc_num]) in do_handle_spec()
1821 speakup_console[vc->vc_num]->tty_stopped = on_off; in do_handle_spec()
1867 static void speakup_win_set(struct vc_data *vc) in speakup_win_set() argument
1881 win_right = vc->vc_cols - 1; in speakup_win_set()
1902 static void speakup_win_clear(struct vc_data *vc) in speakup_win_clear() argument
1912 static void speakup_win_enable(struct vc_data *vc) in speakup_win_enable() argument
1925 static void speakup_bits(struct vc_data *vc) in speakup_bits() argument
1938 static int handle_goto(struct vc_data *vc, u_char type, u_char ch, u_short key) in handle_goto() argument
1993 if (goto_pos >= vc->vc_cols) in handle_goto()
1994 goto_pos = vc->vc_cols - 1; in handle_goto()
2002 if (goto_pos >= vc->vc_rows) in handle_goto()
2003 goto_pos = vc->vc_rows - 1; in handle_goto()
2014 say_word(vc); in handle_goto()
2017 spk_pos = vc->vc_origin + (goto_pos * vc->vc_size_row); in handle_goto()
2018 say_line(vc); in handle_goto()
2023 static void speakup_goto(struct vc_data *vc) in speakup_goto() argument
2033 static void speakup_help(struct vc_data *vc) in speakup_help() argument
2035 spk_handle_help(vc, KT_SPKUP, SPEAKUP_HELP, 0); in speakup_help()
2038 static void do_nothing(struct vc_data *vc) in do_nothing() argument
2045 static void speakup_lock(struct vc_data *vc) in speakup_lock() argument
2076 static void do_spkup(struct vc_data *vc, u_char value) in do_spkup() argument
2086 (*spkup_handler[value]) (vc); in do_spkup()
2096 speakup_key(struct vc_data *vc, int shift_state, int keycode, u_short keysym, in speakup_key() argument
2110 tty = vc->port.tty; in speakup_key()
2141 stop_read_all(vc); in speakup_key()
2178 do_spkup(vc, new_key); in speakup_key()
2202 ret = (*spk_special_handler) (vc, type, value, keycode); in speakup_key()
2218 struct vc_data *vc = param->vc; in keyboard_notifier_call() local
2225 if (vc->vc_mode == KD_GRAPHICS) in keyboard_notifier_call()
2252 if (speakup_key(vc, param->shift, keycode, param->value, up)) in keyboard_notifier_call()
2255 ret = pre_handle_cursor(vc, KVAL(param->value), up); in keyboard_notifier_call()
2263 do_handle_shift(vc, val, up); in keyboard_notifier_call()
2267 do_handle_latin(vc, val, up); in keyboard_notifier_call()
2270 do_handle_cursor(vc, val, up); in keyboard_notifier_call()
2273 do_handle_spec(vc, val, up); in keyboard_notifier_call()
2288 struct vc_data *vc = param->vc; in vt_notifier_call() local
2292 if (vc->vc_mode == KD_TEXT) in vt_notifier_call()
2293 speakup_allocate(vc, GFP_ATOMIC); in vt_notifier_call()
2296 speakup_deallocate(vc); in vt_notifier_call()
2300 speakup_bs(vc); in vt_notifier_call()
2304 speakup_con_write(vc, &d, 1); in vt_notifier_call()
2308 speakup_con_update(vc); in vt_notifier_call()
2355 struct vc_data *vc = vc_cons[fg_console].d; in speakup_init() local
2363 spk_vars[0].u.n.high = vc->vc_cols; in speakup_init()