Lines Matching refs:tems
169 tem_state_t tems; /* common term info */ variable
186 #define tem_callback_display (*tems.ts_callbacks->tsc_display)
187 #define tem_callback_copy (*tems.ts_callbacks->tsc_copy)
188 #define tem_callback_cursor (*tems.ts_callbacks->tsc_cursor)
189 #define tem_callback_cls (*tems.ts_callbacks->tsc_cls)
190 #define tem_callback_bit2pix (*tems.ts_callbacks->tsc_bit2pix)
195 list_insert_head(&tems.ts_list, tem); in tem_add()
207 if (tems.ts_initialized == 0 || tem->tvs_initialized == 0) { in tem_write()
221 if (tems.ts_display_mode == VIS_PIXEL) { in tem_internal_init()
222 ptem->tvs_pix_data_size = tems.ts_pix_data_size; in tem_internal_init()
228 width = tems.ts_c_dimension.width; in tem_internal_init()
229 height = tems.ts_c_dimension.height; in tem_internal_init()
283 if (!tems.ts_initialized) { in tem_init()
329 if (finish_ioctl && tems.ts_hdl != NULL) in tems_failed()
330 (void) tems.ts_hdl->c_ioctl(tems.ts_hdl, VIS_DEVFINI, NULL); in tems_failed()
332 tems.ts_hdl = NULL; in tems_failed()
348 if (tems.ts_initialized) { in tem_info_init()
352 list_create(&tems.ts_list, sizeof (struct tem_vt_state), in tem_info_init()
354 tems.ts_active = NULL; in tem_info_init()
356 tems.ts_hdl = cp; in tem_info_init()
402 tems_get_initial_color(&tems.ts_init_color); in tem_info_init()
404 tems.ts_initialized = 1; /* initialization flag */ in tem_info_init()
406 for (p = list_head(&tems.ts_list); p != NULL; in tem_info_init()
407 p = list_next(&tems.ts_list, p)) { in tem_info_init()
424 if (tems.ts_pdepth != tp->depth) in tems_check_videomode()
428 if (tems.ts_c_dimension.width != tp->width || in tems_check_videomode()
429 tems.ts_c_dimension.height != tp->height) in tems_check_videomode()
432 if (tems.ts_p_dimension.width != tp->width || in tems_check_videomode()
433 tems.ts_p_dimension.height != tp->height) in tems_check_videomode()
436 if (tems.update_font == true) in tems_check_videomode()
445 if (tems.ts_p_dimension.width == 0 && in env_screen_nounset()
446 tems.ts_p_dimension.height == 0) in env_screen_nounset()
463 font_data = set_font(&tems.ts_c_dimension.height, in tems_setup_font()
464 &tems.ts_c_dimension.width, height, width); in tems_setup_font()
475 tems.ts_font.vf_map[i] = in tems_setup_font()
477 tems.ts_font.vf_map_count[i] = in tems_setup_font()
481 tems.ts_font.vf_bytes = font_data->font->vf_bytes; in tems_setup_font()
482 tems.ts_font.vf_width = font_data->font->vf_width; in tems_setup_font()
483 tems.ts_font.vf_height = font_data->font->vf_height; in tems_setup_font()
491 tems.ts_pdepth = tp->depth; in tems_setup_terminal()
492 tems.ts_linebytes = tp->linebytes; in tems_setup_terminal()
493 tems.ts_display_mode = tp->mode; in tems_setup_terminal()
494 tems.ts_color_map = tp->color_map; in tems_setup_terminal()
499 tems.ts_p_dimension.width = 0; in tems_setup_terminal()
500 tems.ts_p_dimension.height = 0; in tems_setup_terminal()
501 tems.ts_c_dimension.width = tp->width; in tems_setup_terminal()
502 tems.ts_c_dimension.height = tp->height; in tems_setup_terminal()
503 tems.ts_callbacks = &tem_text_callbacks; in tems_setup_terminal()
522 tems.ts_c_dimension.height = (screen_size_t)height; in tems_setup_terminal()
523 tems.ts_c_dimension.width = (screen_size_t)width; in tems_setup_terminal()
524 tems.ts_p_dimension.height = tp->height; in tems_setup_terminal()
525 tems.ts_p_dimension.width = tp->width; in tems_setup_terminal()
526 tems.ts_callbacks = &tem_pix_callbacks; in tems_setup_terminal()
530 snprintf(env, sizeof (env), "%d", tems.ts_p_dimension.height); in tems_setup_terminal()
533 snprintf(env, sizeof (env), "%d", tems.ts_p_dimension.width); in tems_setup_terminal()
537 tems.ts_p_offset.y = (tems.ts_p_dimension.height - in tems_setup_terminal()
538 (tems.ts_c_dimension.height * tems.ts_font.vf_height)) / 2; in tems_setup_terminal()
539 tems.ts_p_offset.x = (tems.ts_p_dimension.width - in tems_setup_terminal()
540 (tems.ts_c_dimension.width * tems.ts_font.vf_width)) / 2; in tems_setup_terminal()
541 tems.ts_pix_data_size = in tems_setup_terminal()
542 tems.ts_font.vf_width * tems.ts_font.vf_height; in tems_setup_terminal()
543 tems.ts_pix_data_size *= 4; in tems_setup_terminal()
544 tems.ts_pdepth = tp->depth; in tems_setup_terminal()
549 tems.update_font = false; in tems_setup_terminal()
551 snprintf(env, sizeof (env), "%d", tems.ts_c_dimension.height); in tems_setup_terminal()
554 snprintf(env, sizeof (env), "%d", tems.ts_c_dimension.width); in tems_setup_terminal()
558 snprintf(env, sizeof (env), "%dx%d", tems.ts_font.vf_width, in tems_setup_terminal()
559 tems.ts_font.vf_height); in tems_setup_terminal()
595 struct tem_vt_state *active = tems.ts_active; in tems_modechange_callback()
596 tems_get_initial_color(&tems.ts_init_color); in tems_modechange_callback()
597 active->tvs_fg_color = tems.ts_init_color.fg_color; in tems_modechange_callback()
598 active->tvs_bg_color = tems.ts_init_color.bg_color; in tems_modechange_callback()
599 active->tvs_flags = tems.ts_init_color.a_flags; in tems_modechange_callback()
610 struct tem_vt_state *active = tems.ts_active; in tems_modechange_callback()
611 tems.ts_pdepth = devinit->depth; in tems_modechange_callback()
614 tems_get_initial_color(&tems.ts_init_color); in tems_modechange_callback()
622 state = tems.ts_initialized; in tems_modechange_callback()
623 tems.ts_initialized = 0; /* stop all output */ in tems_modechange_callback()
627 tems_get_initial_color(&tems.ts_init_color); in tems_modechange_callback()
628 tems.ts_initialized = state; /* restore state */ in tems_modechange_callback()
630 for (p = list_head(&tems.ts_list); p != NULL; in tems_modechange_callback()
631 p = list_next(&tems.ts_list, p)) { in tems_modechange_callback()
636 if (tems.ts_modechg_cb == NULL) { in tems_modechange_callback()
640 cb = tems.ts_modechg_cb; in tems_modechange_callback()
641 cb_arg = tems.ts_modechg_arg; in tems_modechange_callback()
653 if (tems.ts_hdl == NULL) in tems_cls()
655 return (tems.ts_hdl->c_ioctl(tems.ts_hdl, VIS_CONSCLEAR, pda)); in tems_cls()
666 if (tems.ts_hdl != NULL) in tems_display()
667 (void) tems.ts_hdl->c_ioctl(tems.ts_hdl, VIS_CONSDISPLAY, pda); in tems_display()
679 if (tems.ts_hdl != NULL) in tems_copy()
680 (void) tems.ts_hdl->c_ioctl(tems.ts_hdl, VIS_CONSCOPY, pma); in tems_copy()
690 if (tems.ts_hdl != NULL) in tems_cursor()
691 (void) tems.ts_hdl->c_ioctl(tems.ts_hdl, VIS_CONSCURSOR, pca); in tems_cursor()
697 if (tems.ts_hdl != NULL) { in tem_kdsetmode()
698 (void) tems.ts_hdl->c_ioctl(tems.ts_hdl, KDSETMODE, in tem_kdsetmode()
708 switch (tems.ts_pdepth) { in tems_reset_colormap()
718 if (tems.ts_hdl != NULL) in tems_reset_colormap()
719 (void) tems.ts_hdl->c_ioctl(tems.ts_hdl, in tems_reset_colormap()
728 *r = (uint16_t)tems.ts_c_dimension.height; in tem_get_size()
729 *c = (uint16_t)tems.ts_c_dimension.width; in tem_get_size()
730 *x = (uint16_t)tems.ts_p_dimension.width; in tem_get_size()
731 *y = (uint16_t)tems.ts_p_dimension.height; in tem_get_size()
742 struct tem_vt_state *active = tems.ts_active; in tem_save_state()
763 tems.ts_modechg_cb = func; in tem_register_modechg_cb()
764 tems.ts_modechg_arg = arg; in tem_register_modechg_cb()
778 ma.s_row = nrows * tems.ts_font.vf_height; in tem_prom_scroll_up()
779 ma.e_row = tems.ts_p_dimension.height - 1; in tem_prom_scroll_up()
783 ma.e_col = tems.ts_p_dimension.width - 1; in tem_prom_scroll_up()
789 width = tems.ts_font.vf_width; in tem_prom_scroll_up()
790 ncols = (tems.ts_p_dimension.width + (width - 1)) / width; in tem_prom_scroll_up()
792 tem_pix_cls_range(tem, 0, nrows, tems.ts_p_offset.y, in tem_prom_scroll_up()
811 prom_charheight = tems.ts_font.vf_height; in tem_adjust_row()
814 tems.ts_p_offset.y; in tem_adjust_row()
815 tem_row = (tem_y + tems.ts_font.vf_height - 1) / in tem_adjust_row()
816 tems.ts_font.vf_height - 1; in tem_adjust_row()
820 } else if (tem_row >= (tems.ts_c_dimension.height - 1)) { in tem_adjust_row()
826 (tems.ts_c_dimension.height - 1); in tem_adjust_row()
828 tem_row = tems.ts_c_dimension.height - 1; in tem_adjust_row()
933 tems.ts_active = tem; in tem_activate()
957 if (tems.ts_display_mode == VIS_TEXT) in tem_check_first_time()
1196 if (tems.ts_display_mode == VIS_TEXT && color > 15) in tem_select_color()
1254 tem->tvs_fg_color = tems.ts_init_color.fg_color; in tem_selgraph()
1255 tem->tvs_bg_color = tems.ts_init_color.bg_color; in tem_selgraph()
1256 tem->tvs_flags = tems.ts_init_color.a_flags; in tem_selgraph()
1347 if (tems.ts_display_mode == VIS_PIXEL && in tem_selgraph()
1348 tems.ts_pdepth > 8) { in tem_selgraph()
1374 tem->tvs_fg_color = tems.ts_init_color.fg_color; in tem_selgraph()
1376 if (tems.ts_init_color.a_flags & TEM_ATTR_BRIGHT_FG) in tem_selgraph()
1427 if (tems.ts_display_mode == VIS_PIXEL && in tem_selgraph()
1428 tems.ts_pdepth > 8) { in tem_selgraph()
1454 tem->tvs_bg_color = tems.ts_init_color.bg_color; in tem_selgraph()
1456 if (tems.ts_init_color.a_flags & TEM_ATTR_BRIGHT_BG) in tem_selgraph()
1596 tems.ts_c_dimension.width - in tem_chkparam()
1603 row < tems.ts_c_dimension.height; in tem_chkparam()
1606 tems.ts_c_dimension.width, row, 0); in tem_chkparam()
1617 tems.ts_c_dimension.width, row, 0); in tem_chkparam()
1628 row < tems.ts_c_dimension.height; in tem_chkparam()
1631 tems.ts_c_dimension.width, row, 0); in tem_chkparam()
1644 (tems.ts_c_dimension.width - in tem_chkparam()
1660 tems.ts_c_dimension.width, in tem_chkparam()
1671 tems.ts_c_dimension.height - 1, in tem_chkparam()
1680 tems.ts_c_dimension.height - 1, in tem_chkparam()
1693 tems.ts_c_dimension.height - 1, in tem_chkparam()
1701 tems.ts_c_dimension.height - 1, in tem_chkparam()
1723 if (tem->tvs_params[0] > tems.ts_c_dimension.width) in tem_chkparam()
1724 tem->tvs_params[0] = tems.ts_c_dimension.width; in tem_chkparam()
1854 if (tem->tvs_c_cursor.col >= tems.ts_c_dimension.width) { in tem_outch()
1892 if (row >= tems.ts_c_dimension.height) { in tem_lf()
1895 tems.ts_c_dimension.height - 1, in tem_lf()
1897 row = tems.ts_c_dimension.height - in tem_lf()
1914 tems.ts_c_dimension.width - in tem_lf()
2074 if (tem->tvs_nscroll > tems.ts_c_dimension.height) in tem_parse()
2075 tem->tvs_nscroll = tems.ts_c_dimension.height; in tem_parse()
2149 tems.ts_c_dimension.width - 1, end, 0, start); in tem_scroll()
2152 tem_clear_chars(tem, tems.ts_c_dimension.width, row, 0); in tem_scroll()
2159 tems.ts_c_dimension.width - 1, in tem_scroll()
2163 tem_clear_chars(tem, tems.ts_c_dimension.width, row, 0); in tem_scroll()
2208 s_col >= tems.ts_c_dimension.width || in tem_copy_area()
2209 e_col >= tems.ts_c_dimension.width || in tem_copy_area()
2210 t_col >= tems.ts_c_dimension.width || in tem_copy_area()
2211 s_row >= tems.ts_c_dimension.height || in tem_copy_area()
2212 e_row >= tems.ts_c_dimension.height || in tem_copy_area()
2213 t_row >= tems.ts_c_dimension.height) in tem_copy_area()
2221 if (t_row + rows > tems.ts_c_dimension.height || in tem_copy_area()
2222 t_col + cols > tems.ts_c_dimension.width) in tem_copy_area()
2233 soffset = s_col + s_row * tems.ts_c_dimension.width; in tem_copy_area()
2234 toffset = t_col + t_row * tems.ts_c_dimension.width; in tem_copy_area()
2244 int increment = i * tems.ts_c_dimension.width; in tem_copy_area()
2259 int increment = i * tems.ts_c_dimension.width; in tem_copy_area()
2279 if (row < 0 || row >= tems.ts_c_dimension.height || in tem_clear_chars()
2280 col < 0 || col >= tems.ts_c_dimension.width || in tem_clear_chars()
2288 if (count > tems.ts_c_dimension.width || in tem_clear_chars()
2289 col + count > tems.ts_c_dimension.width) in tem_clear_chars()
2290 count = tems.ts_c_dimension.width - col; in tem_clear_chars()
2377 if (count > tems.ts_c_dimension.width || in tem_text_cls()
2378 col + count > tems.ts_c_dimension.width) in tem_text_cls()
2379 count = tems.ts_c_dimension.width - col; in tem_text_cls()
2395 da.width = tems.ts_font.vf_width; in tem_pix_display()
2396 da.height = tems.ts_font.vf_height; in tem_pix_display()
2397 da.row = (row * da.height) + tems.ts_p_offset.y; in tem_pix_display()
2398 da.col = (col * da.width) + tems.ts_p_offset.x; in tem_pix_display()
2429 ma.s_row = s_row * tems.ts_font.vf_height + tems.ts_p_offset.y; in tem_pix_copy()
2430 ma.e_row = (e_row + 1) * tems.ts_font.vf_height + in tem_pix_copy()
2431 tems.ts_p_offset.y - 1; in tem_pix_copy()
2432 ma.t_row = t_row * tems.ts_font.vf_height + tems.ts_p_offset.y; in tem_pix_copy()
2439 e_col == tems.ts_c_dimension.width - 1) { in tem_pix_copy()
2444 ma.s_col = s_col * tems.ts_font.vf_width; in tem_pix_copy()
2445 ma.e_col = tems.ts_p_dimension.width - 1; in tem_pix_copy()
2447 ma.t_col = t_col * tems.ts_font.vf_width; in tem_pix_copy()
2449 ma.s_col = s_col * tems.ts_font.vf_width + tems.ts_p_offset.x; in tem_pix_copy()
2450 ma.e_col = (e_col + 1) * tems.ts_font.vf_width + in tem_pix_copy()
2451 tems.ts_p_offset.x - 1; in tem_pix_copy()
2452 ma.t_col = t_col * tems.ts_font.vf_width + tems.ts_p_offset.x; in tem_pix_copy()
2484 tem_pix_cls_range(tem, row, 1, tems.ts_p_offset.y, in tem_pix_cls()
2485 col, count, tems.ts_p_offset.x, false); in tem_pix_cls()
2516 width = tems.ts_font.vf_width; in tem_pix_clear_prom_output()
2517 height = tems.ts_font.vf_height; in tem_pix_clear_prom_output()
2518 offset = tems.ts_p_offset.y % height; in tem_pix_clear_prom_output()
2520 nrows = tems.ts_p_offset.y / height; in tem_pix_clear_prom_output()
2521 ncols = (tems.ts_p_dimension.width + (width - 1)) / width; in tem_pix_clear_prom_output()
2540 for (row = 0; row < tems.ts_c_dimension.height; row++) { in tem_cls()
2541 tem_virtual_cls(tem, tems.ts_c_dimension.width, row, 0); in tem_cls()
2584 tabstop = tems.ts_c_dimension.width - 1; in tem_tab()
2654 if (row >= tems.ts_c_dimension.height) in tem_mv_cursor()
2655 row = tems.ts_c_dimension.height - 1; in tem_mv_cursor()
2658 if (col >= tems.ts_c_dimension.width) { in tem_mv_cursor()
2660 col = tems.ts_c_dimension.width - 1; in tem_mv_cursor()
2693 tem->tvs_fg_color = tems.ts_init_color.fg_color; in tem_reset_emulator()
2694 tem->tvs_bg_color = tems.ts_init_color.bg_color; in tem_reset_emulator()
2695 tem->tvs_flags = tems.ts_init_color.a_flags; in tem_reset_emulator()
2702 for (j = 8; j < tems.ts_c_dimension.width; j += 8) in tem_reset_emulator()
2730 rest_of_line = tems.ts_c_dimension.width - tem->tvs_c_cursor.col; in tem_shift()
2743 tems.ts_c_dimension.width - 1, in tem_shift()
2750 (tems.ts_c_dimension.width - count)); in tem_shift()
2757 tems.ts_c_dimension.width - count - 1, in tem_shift()
2794 ca.row = tem->tvs_c_cursor.row * tems.ts_font.vf_height + in tem_pix_cursor()
2795 tems.ts_p_offset.y; in tem_pix_cursor()
2796 ca.col = tem->tvs_c_cursor.col * tems.ts_font.vf_width + in tem_pix_cursor()
2797 tems.ts_p_offset.x; in tem_pix_cursor()
2798 ca.width = tems.ts_font.vf_width; in tem_pix_cursor()
2799 ca.height = tems.ts_font.vf_height; in tem_pix_cursor()
2818 tem->tvs_c_cursor.row = (ca.row - tems.ts_p_offset.y) / in tem_pix_cursor()
2819 tems.ts_font.vf_height; in tem_pix_cursor()
2822 tem->tvs_c_cursor.col = (ca.col - tems.ts_p_offset.x) / in tem_pix_cursor()
2823 tems.ts_font.vf_width; in tem_pix_cursor()
2835 font_bit_to_pix32(&tems.ts_font, dest, c, fg.n, bg.n); in bit_to_pix32()
2866 bold_font = tems.ts_font.vf_map_count[VFNT_MAP_BOLD] != 0; in tem_get_color()
2891 if (tems.ts_display_mode == VIS_TEXT) in tem_get_color()
2915 switch (tems.ts_pdepth) { in tem_set_color()
2965 row_add = tems.ts_c_dimension.height - 1; in tem_pix_cls_range()
2967 da.width = tems.ts_font.vf_width; in tem_pix_cls_range()
2968 da.height = tems.ts_font.vf_height; in tem_pix_cls_range()
3001 if (row < 0 || row >= tems.ts_c_dimension.height || in tem_virtual_display()
3002 col < 0 || col >= tems.ts_c_dimension.width || in tem_virtual_display()
3003 col + count > (size_t)tems.ts_c_dimension.width) in tem_virtual_display()
3006 width = tems.ts_c_dimension.width; in tem_virtual_display()