annotate src/w32console.c @ 112364:42e22c4f06b7

Move all DEFVAR'd globals into a structure -- threading infrastructure * globals.h: New file. * xterm.h (Vx_pixel_size_width_font_regexp): Remove declaration. * window.h (Vinitial_window_system, Vminibuf_scroll_window) (Vwindow_system_version): Remove declaration. * w32term.h (Vw32_enable_palette) (Vx_pixel_size_width_font_regexp): Remove declaration. * w32menu.c (Voverriding_local_map) (Voverriding_local_map_menu_flag): Remove declaration. * w32inevt.c (Vw32_alt_is_meta, Vw32_apps_modifier) (Vw32_capslock_is_shiftlock, Vw32_enable_caps_lock) (Vw32_enable_num_lock, Vw32_lwindow_modifier) (Vw32_pass_lwindow_to_system, Vw32_pass_rwindow_to_system) (Vw32_phantom_key_code, Vw32_recognize_altgr) (Vw32_rwindow_modifier, Vw32_scroll_lock_modifier) (w32_use_full_screen_buffer): Remove declaration. * w32.c (Vsystem_configuration, Vw32_downcase_file_names) (Vw32_generate_fake_inodes, Vw32_get_true_file_attributes) (w32_num_mouse_buttons, w32_pipe_read_delay): Remove declaration. * termopts.h (Vtruncate_partial_width_windows, inverse_video) (no_redraw_on_reenter, visible_bell): Remove declaration. * sysdep.c (Vsystem_name): Remove declaration. * syntax.h (parse_sexp_lookup_properties): Remove declaration. * menu.h (Vmenu_updating_frame): Remove declaration. * macros.h (Vexecuting_kbd_macro, executing_kbd_macro_index): Remove declaration. * lisp.h (Vafter_init_time, Vafter_load_alist) (Vauto_save_list_file_name, Vbefore_init_time, Vcommand_history) (Vcompletion_regexp_list, Vcurrent_load_list) (Vcurrent_prefix_arg, Vdata_directory, Vdebug_on_error) (Vdoc_directory, Vdoc_file_name, Vdynamic_library_alist) (Vexec_directory, Vexec_path, Vexec_suffixes) (Vface_font_rescale_alist, Vface_ignored_fonts, Vfeatures) (Vhelp_form, Vhistory_length, Vinhibit_field_text_motion) (Vinhibit_quit, Vinhibit_read_only, Vinhibit_redisplay) (Vinstallation_directory, Vinvocation_directory) (Vinvocation_name, Vload_file_rep_suffixes, Vload_history) (Vload_suffixes, Vmark_even_if_inactive, Vmemory_full) (Vmessage_log_max, Vobarray, Vprint_length, Vprint_level) (Vpurify_flag, Vquit_flag, Vsaved_region_selection) (Vscalable_fonts_allowed, Vselect_active_regions) (Vshell_file_name, Vstandard_input, Vstandard_output) (Vsystem_name, Vtemporary_file_directory, Vthrow_on_input) (Vtop_level, Vtty_erase_char, Vundo_outer_limit) (Vuser_login_name, Vwindow_scroll_functions) (Vwindow_system_version, Vx_no_window_manager) (Vx_resource_class, Vx_resource_name, baud_rate) (completion_ignore_case, debug_on_next_call, gc_cons_threshold) (history_delete_duplicates, inhibit_x_resources) (last_nonmenu_event, load_in_progress, max_specpdl_size) (minibuffer_auto_raise, print_escape_newlines, scroll_margin) (use_dialog_box, use_file_dialog): Remove declaration. Include globals.h. * keymap.h (Voverriding_local_map) (Voverriding_local_map_menu_flag, meta_prefix_char): Remove declaration. * keyboard.h (Vdouble_click_time, Vfunction_key_map) (Vinput_method_function, Vkey_translation_map) (Vlucid_menu_bar_dirty_flag, Vthis_original_command) (do_mouse_tracking, extra_keyboard_modifiers) (num_nonmacro_input_events): Remove declaration. * intervals.h (Vchar_property_alias_alist) (Vdefault_text_properties, Vinhibit_point_motion_hooks) (Vtext_property_default_nonsticky): Remove declaration. * gtkutil.h (x_gtk_file_dialog_help_text) (x_gtk_show_hidden_files, x_gtk_use_old_file_dialog) (x_gtk_whole_detached_tool_bar): Remove declaration. * frame.h (Vdefault_frame_alist, Vframe_alpha_lower_limit) (Vmenu_bar_mode, Vmouse_highlight, Vterminal_frame) (Vtool_bar_mode, Vx_resource_class, Vx_resource_name) (focus_follows_mouse): Remove declaration. * fontset.h (Valternate_fontname_alist, Vfontset_alias_alist) (Vignore_relative_composition, Votf_script_alist) (Vuse_default_ascent, Vvertical_centering_font_regexp): Remove declaration. * font.h (Vfont_log): Remove declaration. * dosfns.h (Vdos_display_scancodes, Vdos_version) (Vdos_windows_version, dos_codepage, dos_country_code) (dos_decimal_point, dos_hyper_key, dos_keyboard_layout) (dos_keypad_mode, dos_super_key, dos_timezone_offset): Remove declaration. * disptab.h (Vglyph_table, Vstandard_display_table): Remove declaration. * dispextern.h (Vface_remapping_alist, Vglyphless_char_display) (Vmouse_autoselect_window, Voverflow_newline_into_fringe) (Vshow_trailing_whitespace, Vtool_bar_button_margin) (Vtool_bar_style, cursor_in_echo_area, display_hourglass_p) (inverse_video, mode_line_in_non_selected_windows) (tool_bar_button_relief, tool_bar_max_label_size) (underline_minimum_offset) (unibyte_display_via_language_environment, x_stretch_cursor_p): Remove declaration. * composite.h (Vauto_composition_function) (Vcomposition_function_table): Remove declaration. * commands.h (Vexecuting_kbd_macro) (Vminibuffer_local_completion_map) (Vminibuffer_local_filename_completion_map) (Vminibuffer_local_filename_must_match_map) (Vminibuffer_local_map, Vminibuffer_local_must_match_map) (Vminibuffer_local_ns_map, Vthis_command) (Vunread_command_events, cursor_in_echo_area) (last_command_event, last_nonmenu_event, unread_command_char): Remove declaration. * coding.h (Vcoding_system_for_read, Vcoding_system_for_write) (Vdefault_file_name_coding_system) (Vdefault_process_coding_system, Vfile_name_coding_system) (Vlast_coding_system_used, Vlocale_coding_system) (Vselect_safe_coding_system_function) (Vtranslation_table_for_input, coding_system_require_warning) (eol_mnemonic_dos, eol_mnemonic_mac, eol_mnemonic_undecided) (eol_mnemonic_unix, inherit_process_coding_system): Remove declaration. * charset.h (Vcharset_list, Vcurrent_iso639_language): Remove declaration. * character.h (Vauto_fill_chars, Vchar_direction_table) (Vchar_script_table, Vchar_width_table, Vprintable_chars) (Vscript_representative_chars, Vtranslation_table_vector) (Vunicode_category_table): Remove declaration. * ccl.h (Vfont_ccl_encoder_alist): Remove declaration. * buffer.h (Vafter_change_functions, Vbefore_change_functions) (Vdeactivate_mark, Vfirst_change_hook, Vtransient_mark_mode) (inhibit_modification_hooks): Remove declaration. * xterm.c (syms_of_xterm): Update. (Vx_alt_keysym, Vx_hyper_keysym, Vx_keysym_table) (Vx_meta_keysym, Vx_super_keysym, Vx_toolkit_scroll_bars) (x_mouse_click_focus_ignore_position) (x_underline_at_descent_line) (x_use_underline_position_properties): Remove. * xsmfns.c (syms_of_xsmfns): Update. (Vx_session_id, Vx_session_previous_id): Remove. * xsettings.c (syms_of_xsettings): Update. (Vxft_settings, use_system_font): Remove. * xselect.c (syms_of_xselect): Update. (Vselection_converter_alist, Vx_lost_selection_functions) (Vx_sent_selection_functions, x_selection_timeout): Remove. * xfns.c (syms_of_xfns): Update. (Vgtk_version_string, Vmotif_version_string) (Vx_cursor_fore_pixel, Vx_hourglass_pointer_shape) (Vx_max_tooltip_size, Vx_mode_pointer_shape) (Vx_no_window_manager, Vx_nontext_pointer_shape) (Vx_pixel_size_width_font_regexp, Vx_pointer_shape) (Vx_sensitive_text_pointer_shape) (Vx_window_horizontal_drag_shape, x_gtk_file_dialog_help_text) (x_gtk_show_hidden_files, x_gtk_use_old_file_dialog) (x_gtk_use_system_tooltips, x_gtk_whole_detached_tool_bar): Remove. * xfaces.c (syms_of_xfaces): Update. (Vface_default_stipple, Vface_font_rescale_alist) (Vface_ignored_fonts, Vface_new_frame_defaults) (Vface_remapping_alist, Vfont_list_limit) (Vscalable_fonts_allowed, Vtty_defined_color_alist): Remove. * xdisp.c (syms_of_xdisp): Update. (Vauto_resize_tool_bars, Vblink_cursor_alist) (Vdisplay_pixels_per_inch, Vfontification_functions) (Vframe_title_format, Vglobal_mode_string) (Vglyphless_char_display, Vhourglass_delay, Vhscroll_step) (Vicon_title_format, Vinhibit_redisplay) (Vline_number_display_limit, Vline_prefix) (Vmax_mini_window_height, Vmenu_bar_update_hook) (Vmenu_updating_frame, Vmessage_log_max) (Vmouse_autoselect_window, Vnobreak_char_display) (Voverlay_arrow_position, Voverlay_arrow_string) (Voverlay_arrow_variable_list, Vredisplay_end_trigger_functions) (Vresize_mini_windows, Vshow_trailing_whitespace) (Vtool_bar_border, Vtool_bar_button_margin, Vtool_bar_style) (Vtruncate_partial_width_windows, Vvoid_text_area_pointer) (Vwindow_scroll_functions, Vwindow_size_change_functions) (Vwindow_text_change_functions, Vwrap_prefix) (auto_raise_tool_bar_buttons_p, automatic_hscrolling_p) (debug_end_pos, display_hourglass_p, emacs_scroll_step) (highlight_nonselected_windows, hscroll_margin) (inhibit_eval_during_redisplay, inhibit_free_realized_faces) (inhibit_menubar_update, inhibit_try_cursor_movement) (inhibit_try_window_id, inhibit_try_window_reusing) (line_number_display_limit_width) (make_cursor_line_fully_visible_p, message_truncate_lines) (mode_line_inverse_video, multiple_frames, overline_margin) (scroll_conservatively, scroll_margin, tool_bar_button_relief) (tool_bar_max_label_size, underline_minimum_offset) (unibyte_display_via_language_environment, x_stretch_cursor_p): Remove. * window.c (syms_of_window): Update. (Vminibuf_scroll_window, Vother_window_scroll_buffer) (Vrecenter_redisplay, Vscroll_preserve_screen_position) (Vtemp_buffer_show_function, Vwindow_configuration_change_hook) (Vwindow_point_insertion_type, auto_window_vscroll_p) (mode_line_in_non_selected_windows, next_screen_context_lines) (window_min_height, window_min_width): Remove. (scroll_margin): Remove declaration. * w32term.c (syms_of_w32term): Update. (Vw32_capslock_is_shiftlock, Vw32_grab_focus_on_raise) (Vw32_recognize_altgr, Vw32_swap_mouse_buttons) (Vx_toolkit_scroll_bars, w32_num_mouse_buttons) (w32_use_visible_system_caret, x_underline_at_descent_line) (x_use_underline_position_properties): Remove. (Vcommand_line_args, Vsystem_name, extra_keyboard_modifiers): Remove declaration. * w32select.c (syms_of_w32select): Update. (Vnext_selection_coding_system, Vselection_coding_system): Remove. * w32proc.c (syms_of_ntproc): Update. (Vw32_downcase_file_names, Vw32_generate_fake_inodes) (Vw32_get_true_file_attributes, Vw32_quote_process_args) (Vw32_start_process_inherit_error_mode) (Vw32_start_process_share_console) (Vw32_start_process_show_window, w32_pipe_read_delay): Remove. (Vsystem_name): Remove declaration. * w32font.c (syms_of_w32font): Update. (Vw32_charset_info_alist): Remove. * w32fns.c (globals_of_w32fns, syms_of_w32fns): Update. (Vw32_alt_is_meta, Vw32_apps_modifier, Vw32_bdf_filename_alist) (Vw32_color_map, Vw32_enable_caps_lock, Vw32_enable_num_lock) (Vw32_enable_palette, Vw32_lwindow_modifier) (Vw32_pass_alt_to_system, Vw32_pass_lwindow_to_system) (Vw32_pass_rwindow_to_system, Vw32_phantom_key_code) (Vw32_rwindow_modifier, Vw32_scroll_lock_modifier) (Vx_cursor_fore_pixel, Vx_hourglass_pointer_shape) (Vx_max_tooltip_size, Vx_mode_pointer_shape) (Vx_no_window_manager, Vx_nontext_pointer_shape) (Vx_pixel_size_width_font_regexp, Vx_pointer_shape) (Vx_sensitive_text_pointer_shape) (Vx_window_horizontal_drag_shape, w32_ansi_code_page) (w32_enable_synthesized_fonts, w32_mouse_button_tolerance) (w32_mouse_move_interval) (w32_pass_extra_mouse_buttons_to_system) (w32_pass_multimedia_buttons_to_system, w32_quit_key) (w32_strict_fontnames, w32_strict_painting): Remove. (Vhourglass_delay, Vmenu_bar_mode, Vtool_bar_mode) (Vw32_recognize_altgr, Vwindow_system_version) (w32_num_mouse_buttons, w32_use_visible_system_caret): Remove declaration. * w32console.c (syms_of_ntterm): Update. (w32_use_full_screen_buffer): Remove. (Vtty_defined_color_alist): Remove declaration. * w16select.c (syms_of_win16select): Update. (Vnext_selection_coding_system, Vselection_coding_system): Remove. * undo.c (syms_of_undo): Update. (Vundo_outer_limit, Vundo_outer_limit_function) (undo_inhibit_record_point, undo_limit, undo_strong_limit): Remove. * textprop.c (syms_of_textprop): Update. (Vchar_property_alias_alist, Vdefault_text_properties) (Vinhibit_point_motion_hooks, Vtext_property_default_nonsticky): Remove. * terminal.c (syms_of_terminal): Update. (Vdelete_terminal_functions, Vring_bell_function): Remove. * term.c (syms_of_term): Update. (Vresume_tty_functions, Vsuspend_tty_functions) (no_redraw_on_reenter, system_uses_terminfo, visible_cursor): Remove. * syntax.c (syms_of_syntax): Update. (Vfind_word_boundary_function_table, multibyte_syntax_as_symbol) (open_paren_in_column_0_is_defun_start) (parse_sexp_ignore_comments, parse_sexp_lookup_properties) (words_include_escapes): Remove. * search.c (syms_of_search): Update. (Vinhibit_changing_match_data, Vsearch_spaces_regexp): Remove. * process.c (syms_of_process): Update. (Vprocess_adaptive_read_buffering, Vprocess_connection_type) (delete_exited_processes): Remove. * print.c (syms_of_print): Update. (Vfloat_output_format, Vprint_charset_text_property) (Vprint_circle, Vprint_continuous_numbering, Vprint_gensym) (Vprint_length, Vprint_level, Vprint_number_table) (Vstandard_output, print_escape_multibyte) (print_escape_newlines, print_escape_nonascii, print_quoted): Remove. * msdos.c (syms_of_msdos): Update. (Vdos_unsupported_char_glyph): Remove. (unibyte_display_via_language_environment): Remove declaration. * minibuf.c (syms_of_minibuf): Update. (Vcompletion_regexp_list, Vhistory_add_new_input) (Vhistory_length, Vminibuffer_completing_file_name) (Vminibuffer_completion_confirm) (Vminibuffer_completion_predicate, Vminibuffer_completion_table) (Vminibuffer_exit_hook, Vminibuffer_help_form) (Vminibuffer_history_position, Vminibuffer_history_variable) (Vminibuffer_prompt_properties, Vminibuffer_setup_hook) (Vread_buffer_function, Vread_expression_map) (completion_ignore_case, enable_recursive_minibuffers) (history_delete_duplicates, minibuffer_allow_text_properties) (minibuffer_auto_raise, read_buffer_completion_ignore_case): Remove. * marker.c (syms_of_marker): Update. (byte_debug_flag): Remove. * macros.c (syms_of_macros): Update. (Vexecuting_kbd_macro, executing_kbd_macro_index): Remove. * lread.c (syms_of_lread): Update. (Vafter_load_alist, Vbyte_boolean_vars) (Vbytecomp_version_regexp, Vcurrent_load_list) (Veval_buffer_list, Vload_file_name, Vload_file_rep_suffixes) (Vload_history, Vload_path, Vload_read_function) (Vload_source_file_function, Vload_suffixes, Vobarray) (Vold_style_backquotes, Vpreloaded_file_list, Vread_circle) (Vread_symbol_positions_list, Vread_with_symbol_positions) (Vsource_directory, Vstandard_input, Vuser_init_file, Vvalues) (force_load_messages, load_convert_to_unibyte) (load_dangerous_libraries, load_force_doc_strings) (load_in_progress): Remove. * keymap.c (syms_of_keymap): Update. (Vdefine_key_rebound_commands, Vemulation_mode_map_alists) (Vminibuffer_local_completion_map) (Vminibuffer_local_filename_completion_map) (Vminibuffer_local_filename_must_match_map) (Vminibuffer_local_map, Vminibuffer_local_must_match_map) (Vminibuffer_local_ns_map, Vminor_mode_map_alist) (Vminor_mode_overriding_map_alist, Vwhere_is_preferred_modifier): Remove. * keyboard.c (syms_of_keyboard): Update. (Vauto_save_timeout, Vcommand_error_function) (Vcommand_hook_internal, Vdeactivate_mark) (Vdeferred_action_function, Vdeferred_action_list) (Vdisable_point_adjustment, Vdouble_click_time) (Vecho_keystrokes, Venable_disabled_menus_and_buttons) (Vfunction_key_map, Vglobal_disable_point_adjustment) (Vhelp_char, Vhelp_event_list, Vhelp_form) (Vinput_method_function, Vinput_method_previous_message) (Vkey_translation_map, Vlast_event_frame) (Vlucid_menu_bar_dirty_flag, Vmenu_bar_final_items) (Vminibuffer_message_timeout, Voverriding_local_map) (Voverriding_local_map_menu_flag, Vpost_command_hook) (Vpre_command_hook, Vprefix_help_command) (Vsaved_region_selection, Vselect_active_regions) (Vshow_help_function, Vspecial_event_map, Vsuggest_key_bindings) (Vthis_command, Vthis_command_keys_shift_translated) (Vthis_original_command, Vthrow_on_input, Vtimer_idle_list) (Vtimer_list, Vtool_bar_separator_image_expression, Vtop_level) (Vtty_erase_char, Vunread_command_events) (Vunread_input_method_events, Vunread_post_input_method_events) (auto_save_interval, cannot_suspend, do_mouse_tracking) (double_click_fuzz, extra_keyboard_modifiers) (inhibit_local_menu_bar_menus, last_command_event) (last_input_event, last_nonmenu_event, menu_prompt_more_char) (menu_prompting, meta_prefix_char, num_input_keys) (num_nonmacro_input_events, polling_period, unread_command_char): Remove. * insdel.c (syms_of_insdel): Update. (Vcombine_after_change_calls, check_markers_debug_flag): Remove. * indent.c (syms_of_indent): Update. (indent_tabs_mode): Remove. * image.c (syms_of_image): Update. (Vimage_cache_eviction_delay, Vimage_types) (Vimagemagick_render_type, Vmax_image_size, Vx_bitmap_file_path) (cross_disabled_images): Remove. * fringe.c (syms_of_fringe): Update. (Vfringe_bitmaps, Voverflow_newline_into_fringe): Remove. * frame.c (syms_of_frame): Update. (Vdefault_frame_alist, Vdefault_frame_scroll_bars) (Vdelete_frame_functions, Vframe_alpha_lower_limit) (Vmake_pointer_invisible, Vmenu_bar_mode, Vmouse_highlight) (Vmouse_position_function, Vterminal_frame, Vtool_bar_mode) (Vx_resource_class, Vx_resource_name, focus_follows_mouse): Remove. * fontset.c (syms_of_fontset): Update. (Valternate_fontname_alist, Vfont_encoding_charset_alist) (Vfontset_alias_alist, Vignore_relative_composition) (Votf_script_alist, Vuse_default_ascent) (Vvertical_centering_font_regexp): Remove. * font.c (syms_of_font): Update. (Vfont_encoding_alist, Vfont_log, Vfont_slant_table) (Vfont_weight_table, Vfont_width_table): Remove. * fns.c (syms_of_fns): Update. (Vfeatures, use_dialog_box, use_file_dialog): Remove. * filelock.c (syms_of_filelock): Update. (Vtemporary_file_directory): Remove. * fileio.c (syms_of_fileio): Update. (Vafter_insert_file_functions, Vauto_save_include_big_deletions) (Vauto_save_list_file_name, Vauto_save_visited_file_name) (Vdefault_file_name_coding_system, Vfile_name_coding_system) (Vfile_name_handler_alist, Vinhibit_file_name_handlers) (Vinhibit_file_name_operation, Vset_auto_coding_function) (Vwrite_region_annotate_functions) (Vwrite_region_annotations_so_far) (Vwrite_region_post_annotation_function) (delete_by_moving_to_trash, write_region_inhibit_fsync): Remove. (Vw32_get_true_file_attributes): Remove declaration. * eval.c (syms_of_eval): Update. (Vdebug_ignored_errors, Vdebug_on_error, Vdebug_on_signal) (Vdebugger, Vinhibit_quit, Vmacro_declaration_function) (Vquit_flag, Vsignal_hook_function, Vstack_trace_on_error) (debug_on_next_call, debug_on_quit, debugger_may_continue) (max_lisp_eval_depth, max_specpdl_size): Remove. * emacs.c (syms_of_emacs): Update. (Vafter_init_time, Vbefore_init_time, Vcommand_line_args) (Vdynamic_library_alist, Vemacs_copyright, Vemacs_version) (Vinstallation_directory, Vinvocation_directory) (Vinvocation_name, Vkill_emacs_hook, Vpath_separator) (Vprevious_system_messages_locale, Vprevious_system_time_locale) (Vsystem_configuration, Vsystem_configuration_options) (Vsystem_messages_locale, Vsystem_time_locale, Vsystem_type) (inhibit_x_resources, noninteractive1): Remove. * editfns.c (syms_of_editfns): Update. (Vbuffer_access_fontified_property) (Vbuffer_access_fontify_functions, Vinhibit_field_text_motion) (Voperating_system_release, Vsystem_name, Vuser_full_name) (Vuser_login_name, Vuser_real_login_name): Remove. * dosfns.c (syms_of_dosfns): Update. (Vdos_display_scancodes, Vdos_version, Vdos_windows_version) (dos_codepage, dos_country_code, dos_decimal_point) (dos_hyper_key, dos_keyboard_layout, dos_keypad_mode) (dos_super_key, dos_timezone_offset): Remove. * doc.c (syms_of_doc): Update. (Vbuild_files, Vdoc_file_name): Remove. * dispnew.c (syms_of_display): Update. (Vglyph_table, Vinitial_window_system) (Vredisplay_preemption_period, Vstandard_display_table) (Vwindow_system_version, baud_rate, cursor_in_echo_area) (inverse_video, redisplay_dont_pause, visible_bell): Remove. * dired.c (syms_of_dired): Update. (Vcompletion_ignored_extensions): Remove. (Vw32_get_true_file_attributes): Remove declaration. * dbusbind.c (syms_of_dbusbind): Update. (Vdbus_debug, Vdbus_registered_buses) (Vdbus_registered_objects_table): Remove. * data.c (syms_of_data): Update. (Vmost_negative_fixnum, Vmost_positive_fixnum): Remove. * composite.c (syms_of_composite): Update. (Vauto_composition_function, Vauto_composition_mode) (Vcompose_chars_after_function, Vcomposition_function_table): Remove. * coding.c (syms_of_coding): Update. (Vcharset_revision_table, Vcoding_category_list) (Vcoding_system_alist, Vcoding_system_for_read) (Vcoding_system_for_write, Vcoding_system_list) (Vdefault_process_coding_system, Venable_character_translation) (Vfile_coding_system_alist, Vlast_code_conversion_error) (Vlast_coding_system_used, Vlatin_extra_code_table) (Vlocale_coding_system, Vnetwork_coding_system_alist) (Vprocess_coding_system_alist) (Vselect_safe_coding_system_function) (Vstandard_translation_table_for_decode) (Vstandard_translation_table_for_encode) (Vtranslation_table_for_input, coding_system_require_warning) (eol_mnemonic_dos, eol_mnemonic_mac, eol_mnemonic_undecided) (eol_mnemonic_unix, inherit_process_coding_system) (inhibit_eol_conversion, inhibit_iso_escape_detection) (inhibit_null_byte_detection): Remove. * cmds.c (syms_of_cmds): Update. (Vpost_self_insert_hook): Remove. * charset.c (syms_of_charset): Update. (Vcharset_list, Vcharset_map_path, Vcurrent_iso639_language) (inhibit_load_charset_map): Remove. * character.c (syms_of_character): Update. (Vauto_fill_chars, Vchar_direction_table, Vchar_script_table) (Vchar_width_table, Vprintable_chars) (Vscript_representative_chars, Vtranslation_table_vector) (Vunicode_category_table): Remove. * ccl.c (syms_of_ccl): Update. (Vcode_conversion_map_vector, Vfont_ccl_encoder_alist) (Vtranslation_hash_table_vector): Remove. * category.c (syms_of_category): Update. (Vword_combining_categories, Vword_separating_categories): Remove. * callproc.c (syms_of_callproc): Update. (Vconfigure_info_directory, Vdata_directory, Vdoc_directory) (Vexec_directory, Vexec_path, Vexec_suffixes) (Vinitial_environment, Vprocess_environment) (Vshared_game_score_directory, Vshell_file_name): Remove. * callint.c (syms_of_callint): Update. (Vcommand_debug_status, Vcommand_history, Vcurrent_prefix_arg) (Vmark_even_if_inactive, Vmouse_leave_buffer_hook): Remove. * bytecode.c (syms_of_bytecode): Update. (Vbyte_code_meter, byte_metering_on): Remove. * buffer.c (syms_of_buffer): Update. (Vafter_change_functions, Vbefore_change_functions) (Vchange_major_mode_hook, Vfirst_change_hook) (Vinhibit_read_only, Vkill_buffer_query_functions) (Vtransient_mark_mode, inhibit_modification_hooks): Remove. * alloc.c (syms_of_alloc): Update. (Vgc_cons_percentage, Vgc_elapsed, Vmemory_full) (Vmemory_signal_data, Vpost_gc_hook, Vpurify_flag) (cons_cells_consed, floats_consed, garbage_collection_messages) (gc_cons_threshold, gcs_done, intervals_consed) (misc_objects_consed, pure_bytes_used, string_chars_consed) (strings_consed, symbols_consed, vector_cells_consed): Remove. * lisp.h (DEFVAR_LISP, DEFVAR_LISP_NOPRO, DEFVAR_BOOL) (DEFVAR_INT): Assume global is in `globals'. * alloc.c (globals): Define.
author Tom Tromey <tromey@redhat.com>
date Tue, 18 Jan 2011 13:45:37 -0700
parents ef719132ddfa
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16883
d1d4d81f9ece Change all uses of win95, winnt, and win32
Geoff Voelker <voelker@cs.washington.edu>
parents: 16593
diff changeset
1 /* Terminal hooks for GNU Emacs on the Microsoft W32 API.
94963
8971ddf55736 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 91327
diff changeset
2 Copyright (C) 1992, 1999, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
112218
376148b31b5e Add 2011 to FSF/AIST copyright years.
Glenn Morris <rgm@gnu.org>
parents: 110994
diff changeset
3 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4
14186
ee40177f6c68 Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents: 13424
diff changeset
5 This file is part of GNU Emacs.
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
6
94963
8971ddf55736 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 91327
diff changeset
7 GNU Emacs is free software: you can redistribute it and/or modify
14186
ee40177f6c68 Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents: 13424
diff changeset
8 it under the terms of the GNU General Public License as published by
94963
8971ddf55736 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 91327
diff changeset
9 the Free Software Foundation, either version 3 of the License, or
8971ddf55736 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 91327
diff changeset
10 (at your option) any later version.
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
11
14186
ee40177f6c68 Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents: 13424
diff changeset
12 GNU Emacs is distributed in the hope that it will be useful,
ee40177f6c68 Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents: 13424
diff changeset
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
ee40177f6c68 Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents: 13424
diff changeset
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
ee40177f6c68 Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents: 13424
diff changeset
15 GNU General Public License for more details.
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
16
14186
ee40177f6c68 Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents: 13424
diff changeset
17 You should have received a copy of the GNU General Public License
94963
8971ddf55736 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 91327
diff changeset
18 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
19
94963
8971ddf55736 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 91327
diff changeset
20 /*
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
21 Tim Fleehart (apollo@online.com) 1-17-92
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
22 Geoff Voelker (voelker@cs.washington.edu) 9-12-93
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
23 */
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
24
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
25
12183
47685fb0fbd1 Include config.h before stdio.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 11942
diff changeset
26 #include <config.h>
47685fb0fbd1 Include config.h before stdio.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 11942
diff changeset
27
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
28 #include <stdio.h>
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
29 #include <windows.h>
105669
68dd71358159 * alloc.c: Do not define struct catchtag.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 100951
diff changeset
30 #include <setjmp.h>
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
31
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
32 #include "lisp.h"
88351
aac41b50c875 Include "character.h" instead of "charset.h".
Kenichi Handa <handa@m17n.org>
parents: 40962
diff changeset
33 #include "character.h"
27395
fe54558f20d8 (turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents: 24938
diff changeset
34 #include "coding.h"
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
35 #include "disptab.h"
27892
1857b9695885 Only disable window system features for dispextern.h
Jason Rumney <jasonr@gnu.org>
parents: 27518
diff changeset
36 #include "frame.h"
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
37 #include "termhooks.h"
83573
b77b83741308 (w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents: 75227
diff changeset
38 #include "termchar.h"
32668
3bdd8b545352 Do not undef HAVE_WINDOW_SYSTEM before
Jason Rumney <jasonr@gnu.org>
parents: 31109
diff changeset
39 #include "dispextern.h"
16593
4ed80eda6fac Use new names for w32 files
Geoff Voelker <voelker@cs.washington.edu>
parents: 16588
diff changeset
40 #include "w32inevt.h"
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
41
11389
4a8836398f3e (Fset_message_beep): Defined.
Karl Heuer <kwzh@gnu.org>
parents: 9907
diff changeset
42 /* from window.c */
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109116
diff changeset
43 extern Lisp_Object Frecenter (Lisp_Object);
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
44
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
45 /* from keyboard.c */
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109116
diff changeset
46 extern int detect_input_pending (void);
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
47
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
48 /* from sysdep.c */
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109116
diff changeset
49 extern int read_input_pending (void);
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
50
83573
b77b83741308 (w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents: 75227
diff changeset
51 static void w32con_move_cursor (struct frame *f, int row, int col);
b77b83741308 (w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents: 75227
diff changeset
52 static void w32con_clear_to_end (struct frame *f);
b77b83741308 (w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents: 75227
diff changeset
53 static void w32con_clear_frame (struct frame *f);
b77b83741308 (w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents: 75227
diff changeset
54 static void w32con_clear_end_of_line (struct frame *f, int);
b77b83741308 (w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents: 75227
diff changeset
55 static void w32con_ins_del_lines (struct frame *f, int vpos, int n);
b77b83741308 (w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents: 75227
diff changeset
56 static void w32con_insert_glyphs (struct frame *f, struct glyph *start, int len);
b77b83741308 (w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents: 75227
diff changeset
57 static void w32con_write_glyphs (struct frame *f, struct glyph *string, int len);
b77b83741308 (w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents: 75227
diff changeset
58 static void w32con_delete_glyphs (struct frame *f, int n);
b77b83741308 (w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents: 75227
diff changeset
59 static void w32con_reset_terminal_modes (struct terminal *t);
b77b83741308 (w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents: 75227
diff changeset
60 static void w32con_set_terminal_modes (struct terminal *t);
b77b83741308 (w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents: 75227
diff changeset
61 static void w32con_set_terminal_window (struct frame *f, int size);
55670
d3274c878082 Prefix RIF functions with w32con_ to avoid namespace clash with term.c.
Jason Rumney <jasonr@gnu.org>
parents: 55644
diff changeset
62 static void w32con_update_begin (struct frame * f);
d3274c878082 Prefix RIF functions with w32con_ to avoid namespace clash with term.c.
Jason Rumney <jasonr@gnu.org>
parents: 55644
diff changeset
63 static void w32con_update_end (struct frame * f);
27518
ff2e0205b5a0 (turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents: 27395
diff changeset
64 static WORD w32_face_attributes (struct frame *f, int face_id);
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
65
27518
ff2e0205b5a0 (turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents: 27395
diff changeset
66 static COORD cursor_coords;
ff2e0205b5a0 (turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents: 27395
diff changeset
67 static HANDLE prev_screen, cur_screen;
ff2e0205b5a0 (turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents: 27395
diff changeset
68 static WORD char_attr_normal;
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109116
diff changeset
69 static DWORD prev_console_mode;
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
70
19706
e21b63afe61f (DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18507
diff changeset
71 #ifndef USE_SEPARATE_SCREEN
27518
ff2e0205b5a0 (turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents: 27395
diff changeset
72 static CONSOLE_CURSOR_INFO prev_console_cursor;
19706
e21b63afe61f (DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18507
diff changeset
73 #endif
e21b63afe61f (DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18507
diff changeset
74
27518
ff2e0205b5a0 (turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents: 27395
diff changeset
75 HANDLE keyboard_handle;
24938
a4c871b96d4b (w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24755
diff changeset
76
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
77
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
78 /* Setting this as the ctrl handler prevents emacs from being killed when
12336
617f39b43557 (ctrl_c_handler): Ignore CTRL_BREAK_EVENT signals.
Richard M. Stallman <rms@gnu.org>
parents: 12183
diff changeset
79 someone hits ^C in a 'suspended' session (child shell).
617f39b43557 (ctrl_c_handler): Ignore CTRL_BREAK_EVENT signals.
Richard M. Stallman <rms@gnu.org>
parents: 12183
diff changeset
80 Also ignore Ctrl-Break signals. */
617f39b43557 (ctrl_c_handler): Ignore CTRL_BREAK_EVENT signals.
Richard M. Stallman <rms@gnu.org>
parents: 12183
diff changeset
81
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
82 BOOL
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
83 ctrl_c_handler (unsigned long type)
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
84 {
19706
e21b63afe61f (DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18507
diff changeset
85 /* Only ignore "interrupt" events when running interactively. */
e21b63afe61f (DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18507
diff changeset
86 return (!noninteractive
e21b63afe61f (DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18507
diff changeset
87 && (type == CTRL_C_EVENT || type == CTRL_BREAK_EVENT));
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
88 }
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
89
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
90
83573
b77b83741308 (w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents: 75227
diff changeset
91 /* Move the cursor to (ROW, COL) on FRAME. */
55644
fa1998970a4d Use static consistently.
Jason Rumney <jasonr@gnu.org>
parents: 52401
diff changeset
92 static void
83573
b77b83741308 (w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents: 75227
diff changeset
93 w32con_move_cursor (struct frame *f, int row, int col)
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
94 {
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
95 cursor_coords.X = col;
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
96 cursor_coords.Y = row;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 40962
diff changeset
97
83573
b77b83741308 (w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents: 75227
diff changeset
98 /* TODO: for multi-tty support, cur_screen should be replaced with a
b77b83741308 (w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents: 75227
diff changeset
99 reference to the terminal for this frame. */
b77b83741308 (w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents: 75227
diff changeset
100 SetConsoleCursorPosition (cur_screen, cursor_coords);
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
101 }
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
102
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
103 /* Clear from cursor to end of screen. */
55644
fa1998970a4d Use static consistently.
Jason Rumney <jasonr@gnu.org>
parents: 52401
diff changeset
104 static void
83573
b77b83741308 (w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents: 75227
diff changeset
105 w32con_clear_to_end (struct frame *f)
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
106 {
83573
b77b83741308 (w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents: 75227
diff changeset
107 w32con_clear_end_of_line (f, FRAME_COLS (f) - 1);
b77b83741308 (w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents: 75227
diff changeset
108 w32con_ins_del_lines (f, cursor_coords.Y, FRAME_LINES (f) - cursor_coords.Y - 1);
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
109 }
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
110
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
111 /* Clear the frame. */
55670
d3274c878082 Prefix RIF functions with w32con_ to avoid namespace clash with term.c.
Jason Rumney <jasonr@gnu.org>
parents: 55644
diff changeset
112 static void
83573
b77b83741308 (w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents: 75227
diff changeset
113 w32con_clear_frame (struct frame *f)
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
114 {
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
115 COORD dest;
31109
88608fbaf4eb (min): Define macro.
Andrew Innes <andrewi@gnu.org>
parents: 30837
diff changeset
116 int n;
88608fbaf4eb (min): Define macro.
Andrew Innes <andrewi@gnu.org>
parents: 30837
diff changeset
117 DWORD r;
24755
3bb855a40bf6 (clear_frame): Remember that the window width might
Andrew Innes <andrewi@gnu.org>
parents: 23572
diff changeset
118 CONSOLE_SCREEN_BUFFER_INFO info;
3bb855a40bf6 (clear_frame): Remember that the window width might
Andrew Innes <andrewi@gnu.org>
parents: 23572
diff changeset
119
3bb855a40bf6 (clear_frame): Remember that the window width might
Andrew Innes <andrewi@gnu.org>
parents: 23572
diff changeset
120 GetConsoleScreenBufferInfo (GetStdHandle (STD_OUTPUT_HANDLE), &info);
14244
493cff4d5960 (clear_frame): Use FillConsoleOutput* calls instead of
Geoff Voelker <voelker@cs.washington.edu>
parents: 14186
diff changeset
121
24755
3bb855a40bf6 (clear_frame): Remember that the window width might
Andrew Innes <andrewi@gnu.org>
parents: 23572
diff changeset
122 /* Remember that the screen buffer might be wider than the window. */
51206
22a5614b558f Make (few) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50247
diff changeset
123 n = FRAME_LINES (f) * info.dwSize.X;
14244
493cff4d5960 (clear_frame): Use FillConsoleOutput* calls instead of
Geoff Voelker <voelker@cs.washington.edu>
parents: 14186
diff changeset
124 dest.X = dest.Y = 0;
493cff4d5960 (clear_frame): Use FillConsoleOutput* calls instead of
Geoff Voelker <voelker@cs.washington.edu>
parents: 14186
diff changeset
125
27518
ff2e0205b5a0 (turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents: 27395
diff changeset
126 FillConsoleOutputAttribute (cur_screen, char_attr_normal, n, dest, &r);
14244
493cff4d5960 (clear_frame): Use FillConsoleOutput* calls instead of
Geoff Voelker <voelker@cs.washington.edu>
parents: 14186
diff changeset
127 FillConsoleOutputCharacter (cur_screen, ' ', n, dest, &r);
493cff4d5960 (clear_frame): Use FillConsoleOutput* calls instead of
Geoff Voelker <voelker@cs.washington.edu>
parents: 14186
diff changeset
128
83573
b77b83741308 (w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents: 75227
diff changeset
129 w32con_move_cursor (f, 0, 0);
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
130 }
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
131
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
132
27395
fe54558f20d8 (turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents: 24938
diff changeset
133 static struct glyph glyph_base[256];
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
134 static BOOL ceol_initialized = FALSE;
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
135
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
136 /* Clear from Cursor to end (what's "standout marker"?). */
55670
d3274c878082 Prefix RIF functions with w32con_ to avoid namespace clash with term.c.
Jason Rumney <jasonr@gnu.org>
parents: 55644
diff changeset
137 static void
83573
b77b83741308 (w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents: 75227
diff changeset
138 w32con_clear_end_of_line (struct frame *f, int end)
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
139 {
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
140 if (!ceol_initialized)
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
141 {
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
142 int i;
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
143 for (i = 0; i < 256; i++)
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
144 {
27395
fe54558f20d8 (turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents: 24938
diff changeset
145 memcpy (&glyph_base[i], &space_glyph, sizeof (struct glyph));
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
146 }
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
147 ceol_initialized = TRUE;
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
148 }
83573
b77b83741308 (w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents: 75227
diff changeset
149 w32con_write_glyphs (f, glyph_base, end - cursor_coords.X); /* fencepost ? */
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
150 }
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
151
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
152 /* Insert n lines at vpos. if n is negative delete -n lines. */
55670
d3274c878082 Prefix RIF functions with w32con_ to avoid namespace clash with term.c.
Jason Rumney <jasonr@gnu.org>
parents: 55644
diff changeset
153 static void
83573
b77b83741308 (w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents: 75227
diff changeset
154 w32con_ins_del_lines (struct frame *f, int vpos, int n)
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
155 {
40079
e62d3694acdc (reassert_line_highlight, change_line_highlight): Functions removed.
Miles Bader <miles@gnu.org>
parents: 39682
diff changeset
156 int i, nb;
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
157 SMALL_RECT scroll;
86876
24d5cc50cf7d (w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents: 86834
diff changeset
158 SMALL_RECT clip;
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
159 COORD dest;
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
160 CHAR_INFO fill;
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
161
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
162 if (n < 0)
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
163 {
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
164 scroll.Top = vpos - n;
51206
22a5614b558f Make (few) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50247
diff changeset
165 scroll.Bottom = FRAME_LINES (f);
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
166 dest.Y = vpos;
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
167 }
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
168 else
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
169 {
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
170 scroll.Top = vpos;
51206
22a5614b558f Make (few) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50247
diff changeset
171 scroll.Bottom = FRAME_LINES (f) - n;
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
172 dest.Y = vpos + n;
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
173 }
86876
24d5cc50cf7d (w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents: 86834
diff changeset
174 clip.Top = clip.Left = scroll.Left = 0;
24d5cc50cf7d (w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents: 86834
diff changeset
175 clip.Right = scroll.Right = FRAME_COLS (f);
24d5cc50cf7d (w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents: 86834
diff changeset
176 clip.Bottom = FRAME_LINES (f);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 40962
diff changeset
177
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
178 dest.X = 0;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 40962
diff changeset
179
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
180 fill.Char.AsciiChar = 0x20;
27518
ff2e0205b5a0 (turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents: 27395
diff changeset
181 fill.Attributes = char_attr_normal;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 40962
diff changeset
182
86876
24d5cc50cf7d (w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents: 86834
diff changeset
183 ScrollConsoleScreenBuffer (cur_screen, &scroll, &clip, dest, &fill);
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
184
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16262
diff changeset
185 /* Here we have to deal with a w32 console flake: If the scroll
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
186 region looks like abc and we scroll c to a and fill with d we get
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
187 cbd... if we scroll block c one line at a time to a, we get cdd...
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
188 Emacs expects cdd consistently... So we have to deal with that
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
189 here... (this also occurs scrolling the same way in the other
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
190 direction. */
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
191
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
192 if (n > 0)
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
193 {
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
194 if (scroll.Bottom < dest.Y)
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
195 {
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
196 for (i = scroll.Bottom; i < dest.Y; i++)
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
197 {
83573
b77b83741308 (w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents: 75227
diff changeset
198 w32con_move_cursor (f, i, 0);
b77b83741308 (w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents: 75227
diff changeset
199 w32con_clear_end_of_line (f, FRAME_COLS (f));
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
200 }
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
201 }
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
202 }
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
203 else
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
204 {
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
205 nb = dest.Y + (scroll.Bottom - scroll.Top) + 1;
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
206
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
207 if (nb < scroll.Top)
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 40962
diff changeset
208 {
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
209 for (i = nb; i < scroll.Top; i++)
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
210 {
83573
b77b83741308 (w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents: 75227
diff changeset
211 w32con_move_cursor (f, i, 0);
b77b83741308 (w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents: 75227
diff changeset
212 w32con_clear_end_of_line (f, FRAME_COLS (f));
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
213 }
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
214 }
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
215 }
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 40962
diff changeset
216
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
217 cursor_coords.X = 0;
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
218 cursor_coords.Y = vpos;
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
219 }
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
220
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
221 #undef LEFT
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
222 #undef RIGHT
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
223 #define LEFT 1
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
224 #define RIGHT 0
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
225
55644
fa1998970a4d Use static consistently.
Jason Rumney <jasonr@gnu.org>
parents: 52401
diff changeset
226 static void
83573
b77b83741308 (w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents: 75227
diff changeset
227 scroll_line (struct frame *f, int dist, int direction)
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
228 {
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
229 /* The idea here is to implement a horizontal scroll in one line to
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
230 implement delete and half of insert. */
86876
24d5cc50cf7d (w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents: 86834
diff changeset
231 SMALL_RECT scroll, clip;
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
232 COORD dest;
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
233 CHAR_INFO fill;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 40962
diff changeset
234
86876
24d5cc50cf7d (w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents: 86834
diff changeset
235 clip.Top = scroll.Top = clip.Bottom = scroll.Bottom = cursor_coords.Y;
24d5cc50cf7d (w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents: 86834
diff changeset
236 clip.Left = 0;
24d5cc50cf7d (w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents: 86834
diff changeset
237 clip.Right = FRAME_COLS (f);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 40962
diff changeset
238
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
239 if (direction == LEFT)
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
240 {
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
241 scroll.Left = cursor_coords.X + dist;
51206
22a5614b558f Make (few) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50247
diff changeset
242 scroll.Right = FRAME_COLS (f) - 1;
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
243 }
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
244 else
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
245 {
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
246 scroll.Left = cursor_coords.X;
51206
22a5614b558f Make (few) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50247
diff changeset
247 scroll.Right = FRAME_COLS (f) - dist - 1;
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
248 }
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 40962
diff changeset
249
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
250 dest.X = cursor_coords.X;
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
251 dest.Y = cursor_coords.Y;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 40962
diff changeset
252
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
253 fill.Char.AsciiChar = 0x20;
27518
ff2e0205b5a0 (turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents: 27395
diff changeset
254 fill.Attributes = char_attr_normal;
ff2e0205b5a0 (turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents: 27395
diff changeset
255
86876
24d5cc50cf7d (w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents: 86834
diff changeset
256 ScrollConsoleScreenBuffer (cur_screen, &scroll, &clip, dest, &fill);
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
257 }
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
258
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
259
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
260 /* If start is zero insert blanks instead of a string at start ?. */
55670
d3274c878082 Prefix RIF functions with w32con_ to avoid namespace clash with term.c.
Jason Rumney <jasonr@gnu.org>
parents: 55644
diff changeset
261 static void
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109116
diff changeset
262 w32con_insert_glyphs (struct frame *f, register struct glyph *start,
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109116
diff changeset
263 register int len)
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
264 {
83573
b77b83741308 (w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents: 75227
diff changeset
265 scroll_line (f, len, RIGHT);
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
266
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
267 /* Move len chars to the right starting at cursor_coords, fill with blanks */
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
268 if (start)
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
269 {
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
270 /* Print the first len characters of start, cursor_coords.X adjusted
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
271 by write_glyphs. */
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 40962
diff changeset
272
83573
b77b83741308 (w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents: 75227
diff changeset
273 w32con_write_glyphs (f, start, len);
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
274 }
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
275 else
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
276 {
83573
b77b83741308 (w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents: 75227
diff changeset
277 w32con_clear_end_of_line (f, cursor_coords.X + len);
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
278 }
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
279 }
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
280
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109116
diff changeset
281 extern unsigned char *encode_terminal_code (struct glyph *, int,
109100
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 108007
diff changeset
282 struct coding_system *);
58700
222a7e1090c3 (w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents: 55670
diff changeset
283
55670
d3274c878082 Prefix RIF functions with w32con_ to avoid namespace clash with term.c.
Jason Rumney <jasonr@gnu.org>
parents: 55644
diff changeset
284 static void
83573
b77b83741308 (w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents: 75227
diff changeset
285 w32con_write_glyphs (struct frame *f, register struct glyph *string,
b77b83741308 (w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents: 75227
diff changeset
286 register int len)
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
287 {
31109
88608fbaf4eb (min): Define macro.
Andrew Innes <andrewi@gnu.org>
parents: 30837
diff changeset
288 DWORD r;
27518
ff2e0205b5a0 (turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents: 27395
diff changeset
289 WORD char_attr;
58700
222a7e1090c3 (w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents: 55670
diff changeset
290 unsigned char *conversion_buffer;
222a7e1090c3 (w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents: 55670
diff changeset
291 struct coding_system *coding;
27518
ff2e0205b5a0 (turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents: 27395
diff changeset
292
ff2e0205b5a0 (turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents: 27395
diff changeset
293 if (len <= 0)
ff2e0205b5a0 (turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents: 27395
diff changeset
294 return;
27395
fe54558f20d8 (turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents: 24938
diff changeset
295
58700
222a7e1090c3 (w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents: 55670
diff changeset
296 /* If terminal_coding does any conversion, use it, otherwise use
222a7e1090c3 (w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents: 55670
diff changeset
297 safe_terminal_coding. We can't use CODING_REQUIRE_ENCODING here
222a7e1090c3 (w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents: 55670
diff changeset
298 because it always return 1 if the member src_multibyte is 1. */
83573
b77b83741308 (w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents: 75227
diff changeset
299 coding = (FRAME_TERMINAL_CODING (f)->common_flags & CODING_REQUIRE_ENCODING_MASK
b77b83741308 (w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents: 75227
diff changeset
300 ? FRAME_TERMINAL_CODING (f) : &safe_terminal_coding);
27395
fe54558f20d8 (turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents: 24938
diff changeset
301 /* The mode bit CODING_MODE_LAST_BLOCK should be set to 1 only at
fe54558f20d8 (turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents: 24938
diff changeset
302 the tail. */
83573
b77b83741308 (w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents: 75227
diff changeset
303 coding->mode &= ~CODING_MODE_LAST_BLOCK;
14244
493cff4d5960 (clear_frame): Use FillConsoleOutput* calls instead of
Geoff Voelker <voelker@cs.washington.edu>
parents: 14186
diff changeset
304
27395
fe54558f20d8 (turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents: 24938
diff changeset
305 while (len > 0)
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
306 {
27395
fe54558f20d8 (turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents: 24938
diff changeset
307 /* Identify a run of glyphs with the same face. */
fe54558f20d8 (turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents: 24938
diff changeset
308 int face_id = string->face_id;
fe54558f20d8 (turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents: 24938
diff changeset
309 int n;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 40962
diff changeset
310
27395
fe54558f20d8 (turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents: 24938
diff changeset
311 for (n = 1; n < len; ++n)
fe54558f20d8 (turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents: 24938
diff changeset
312 if (string[n].face_id != face_id)
fe54558f20d8 (turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents: 24938
diff changeset
313 break;
fe54558f20d8 (turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents: 24938
diff changeset
314
fe54558f20d8 (turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents: 24938
diff changeset
315 /* Turn appearance modes of the face of the run on. */
27518
ff2e0205b5a0 (turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents: 27395
diff changeset
316 char_attr = w32_face_attributes (f, face_id);
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
317
58700
222a7e1090c3 (w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents: 55670
diff changeset
318 if (n == len)
222a7e1090c3 (w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents: 55670
diff changeset
319 /* This is the last run. */
222a7e1090c3 (w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents: 55670
diff changeset
320 coding->mode |= CODING_MODE_LAST_BLOCK;
222a7e1090c3 (w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents: 55670
diff changeset
321 conversion_buffer = encode_terminal_code (string, n, coding);
222a7e1090c3 (w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents: 55670
diff changeset
322 if (coding->produced > 0)
222a7e1090c3 (w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents: 55670
diff changeset
323 {
222a7e1090c3 (w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents: 55670
diff changeset
324 /* Set the attribute for these characters. */
222a7e1090c3 (w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents: 55670
diff changeset
325 if (!FillConsoleOutputAttribute (cur_screen, char_attr,
222a7e1090c3 (w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents: 55670
diff changeset
326 coding->produced, cursor_coords,
222a7e1090c3 (w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents: 55670
diff changeset
327 &r))
27395
fe54558f20d8 (turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents: 24938
diff changeset
328 {
58700
222a7e1090c3 (w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents: 55670
diff changeset
329 printf ("Failed writing console attributes: %d\n",
222a7e1090c3 (w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents: 55670
diff changeset
330 GetLastError ());
222a7e1090c3 (w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents: 55670
diff changeset
331 fflush (stdout);
222a7e1090c3 (w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents: 55670
diff changeset
332 }
27395
fe54558f20d8 (turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents: 24938
diff changeset
333
58700
222a7e1090c3 (w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents: 55670
diff changeset
334 /* Write the characters. */
222a7e1090c3 (w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents: 55670
diff changeset
335 if (!WriteConsoleOutputCharacter (cur_screen, conversion_buffer,
222a7e1090c3 (w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents: 55670
diff changeset
336 coding->produced, cursor_coords,
222a7e1090c3 (w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents: 55670
diff changeset
337 &r))
222a7e1090c3 (w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents: 55670
diff changeset
338 {
222a7e1090c3 (w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents: 55670
diff changeset
339 printf ("Failed writing console characters: %d\n",
222a7e1090c3 (w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents: 55670
diff changeset
340 GetLastError ());
222a7e1090c3 (w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents: 55670
diff changeset
341 fflush (stdout);
222a7e1090c3 (w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents: 55670
diff changeset
342 }
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
343
58700
222a7e1090c3 (w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents: 55670
diff changeset
344 cursor_coords.X += coding->produced;
83573
b77b83741308 (w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents: 75227
diff changeset
345 w32con_move_cursor (f, cursor_coords.Y, cursor_coords.X);
58700
222a7e1090c3 (w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents: 55670
diff changeset
346 }
222a7e1090c3 (w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents: 55670
diff changeset
347 len -= n;
222a7e1090c3 (w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents: 55670
diff changeset
348 string += n;
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
349 }
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
350 }
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
351
27395
fe54558f20d8 (turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents: 24938
diff changeset
352
55670
d3274c878082 Prefix RIF functions with w32con_ to avoid namespace clash with term.c.
Jason Rumney <jasonr@gnu.org>
parents: 55644
diff changeset
353 static void
83573
b77b83741308 (w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents: 75227
diff changeset
354 w32con_delete_glyphs (struct frame *f, int n)
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
355 {
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 40962
diff changeset
356 /* delete chars means scroll chars from cursor_coords.X + n to
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 40962
diff changeset
357 cursor_coords.X, anything beyond the edge of the screen should
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
358 come out empty... */
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
359
83573
b77b83741308 (w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents: 75227
diff changeset
360 scroll_line (f, n, LEFT);
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
361 }
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
362
11389
4a8836398f3e (Fset_message_beep): Defined.
Karl Heuer <kwzh@gnu.org>
parents: 9907
diff changeset
363 static unsigned int sound_type = 0xFFFFFFFF;
23563
18c5f58b70b5 (Fset_message_beep): Recognize 'silent.
Geoff Voelker <voelker@cs.washington.edu>
parents: 22540
diff changeset
364 #define MB_EMACS_SILENT (0xFFFFFFFF - 1)
11389
4a8836398f3e (Fset_message_beep): Defined.
Karl Heuer <kwzh@gnu.org>
parents: 9907
diff changeset
365
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
366 void
83573
b77b83741308 (w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents: 75227
diff changeset
367 w32_sys_ring_bell (struct frame *f)
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
368 {
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 40962
diff changeset
369 if (sound_type == 0xFFFFFFFF)
23563
18c5f58b70b5 (Fset_message_beep): Recognize 'silent.
Geoff Voelker <voelker@cs.washington.edu>
parents: 22540
diff changeset
370 {
11389
4a8836398f3e (Fset_message_beep): Defined.
Karl Heuer <kwzh@gnu.org>
parents: 9907
diff changeset
371 Beep (666, 100);
23563
18c5f58b70b5 (Fset_message_beep): Recognize 'silent.
Geoff Voelker <voelker@cs.washington.edu>
parents: 22540
diff changeset
372 }
18c5f58b70b5 (Fset_message_beep): Recognize 'silent.
Geoff Voelker <voelker@cs.washington.edu>
parents: 22540
diff changeset
373 else if (sound_type == MB_EMACS_SILENT)
18c5f58b70b5 (Fset_message_beep): Recognize 'silent.
Geoff Voelker <voelker@cs.washington.edu>
parents: 22540
diff changeset
374 {
18c5f58b70b5 (Fset_message_beep): Recognize 'silent.
Geoff Voelker <voelker@cs.washington.edu>
parents: 22540
diff changeset
375 /* Do nothing. */
18c5f58b70b5 (Fset_message_beep): Recognize 'silent.
Geoff Voelker <voelker@cs.washington.edu>
parents: 22540
diff changeset
376 }
11389
4a8836398f3e (Fset_message_beep): Defined.
Karl Heuer <kwzh@gnu.org>
parents: 9907
diff changeset
377 else
23563
18c5f58b70b5 (Fset_message_beep): Recognize 'silent.
Geoff Voelker <voelker@cs.washington.edu>
parents: 22540
diff changeset
378 MessageBeep (sound_type);
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
379 }
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
380
11389
4a8836398f3e (Fset_message_beep): Defined.
Karl Heuer <kwzh@gnu.org>
parents: 9907
diff changeset
381 DEFUN ("set-message-beep", Fset_message_beep, Sset_message_beep, 1, 1, 0,
40962
f66d09d1bb2f Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40656
diff changeset
382 doc: /* Set the sound generated when the bell is rung.
f66d09d1bb2f Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40656
diff changeset
383 SOUND is 'asterisk, 'exclamation, 'hand, 'question, 'ok, or 'silent
f66d09d1bb2f Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40656
diff changeset
384 to use the corresponding system sound for the bell. The 'silent sound
f66d09d1bb2f Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40656
diff changeset
385 prevents Emacs from making any sound at all.
f66d09d1bb2f Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40656
diff changeset
386 SOUND is nil to use the normal beep. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109160
diff changeset
387 (Lisp_Object sound)
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
388 {
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40079
diff changeset
389 CHECK_SYMBOL (sound);
11389
4a8836398f3e (Fset_message_beep): Defined.
Karl Heuer <kwzh@gnu.org>
parents: 9907
diff changeset
390
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 40962
diff changeset
391 if (NILP (sound))
11389
4a8836398f3e (Fset_message_beep): Defined.
Karl Heuer <kwzh@gnu.org>
parents: 9907
diff changeset
392 sound_type = 0xFFFFFFFF;
4a8836398f3e (Fset_message_beep): Defined.
Karl Heuer <kwzh@gnu.org>
parents: 9907
diff changeset
393 else if (EQ (sound, intern ("asterisk")))
4a8836398f3e (Fset_message_beep): Defined.
Karl Heuer <kwzh@gnu.org>
parents: 9907
diff changeset
394 sound_type = MB_ICONASTERISK;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 40962
diff changeset
395 else if (EQ (sound, intern ("exclamation")))
11389
4a8836398f3e (Fset_message_beep): Defined.
Karl Heuer <kwzh@gnu.org>
parents: 9907
diff changeset
396 sound_type = MB_ICONEXCLAMATION;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 40962
diff changeset
397 else if (EQ (sound, intern ("hand")))
11389
4a8836398f3e (Fset_message_beep): Defined.
Karl Heuer <kwzh@gnu.org>
parents: 9907
diff changeset
398 sound_type = MB_ICONHAND;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 40962
diff changeset
399 else if (EQ (sound, intern ("question")))
11389
4a8836398f3e (Fset_message_beep): Defined.
Karl Heuer <kwzh@gnu.org>
parents: 9907
diff changeset
400 sound_type = MB_ICONQUESTION;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 40962
diff changeset
401 else if (EQ (sound, intern ("ok")))
11389
4a8836398f3e (Fset_message_beep): Defined.
Karl Heuer <kwzh@gnu.org>
parents: 9907
diff changeset
402 sound_type = MB_OK;
23563
18c5f58b70b5 (Fset_message_beep): Recognize 'silent.
Geoff Voelker <voelker@cs.washington.edu>
parents: 22540
diff changeset
403 else if (EQ (sound, intern ("silent")))
18c5f58b70b5 (Fset_message_beep): Recognize 'silent.
Geoff Voelker <voelker@cs.washington.edu>
parents: 22540
diff changeset
404 sound_type = MB_EMACS_SILENT;
11389
4a8836398f3e (Fset_message_beep): Defined.
Karl Heuer <kwzh@gnu.org>
parents: 9907
diff changeset
405 else
4a8836398f3e (Fset_message_beep): Defined.
Karl Heuer <kwzh@gnu.org>
parents: 9907
diff changeset
406 sound_type = 0xFFFFFFFF;
4a8836398f3e (Fset_message_beep): Defined.
Karl Heuer <kwzh@gnu.org>
parents: 9907
diff changeset
407
4a8836398f3e (Fset_message_beep): Defined.
Karl Heuer <kwzh@gnu.org>
parents: 9907
diff changeset
408 return sound;
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
409 }
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 40962
diff changeset
410
55670
d3274c878082 Prefix RIF functions with w32con_ to avoid namespace clash with term.c.
Jason Rumney <jasonr@gnu.org>
parents: 55644
diff changeset
411 static void
83573
b77b83741308 (w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents: 75227
diff changeset
412 w32con_reset_terminal_modes (struct terminal *t)
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
413 {
86876
24d5cc50cf7d (w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents: 86834
diff changeset
414 COORD dest;
24d5cc50cf7d (w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents: 86834
diff changeset
415 CONSOLE_SCREEN_BUFFER_INFO info;
24d5cc50cf7d (w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents: 86834
diff changeset
416 int n;
24d5cc50cf7d (w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents: 86834
diff changeset
417 DWORD r;
24d5cc50cf7d (w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents: 86834
diff changeset
418
24d5cc50cf7d (w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents: 86834
diff changeset
419 /* Clear the complete screen buffer. This is required because Emacs
24d5cc50cf7d (w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents: 86834
diff changeset
420 sets the cursor position to the top of the buffer, but there might
24d5cc50cf7d (w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents: 86834
diff changeset
421 be other output below the bottom of the Emacs frame if the screen buffer
24d5cc50cf7d (w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents: 86834
diff changeset
422 is larger than the window size. */
24d5cc50cf7d (w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents: 86834
diff changeset
423 GetConsoleScreenBufferInfo (cur_screen, &info);
24d5cc50cf7d (w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents: 86834
diff changeset
424 dest.X = 0;
24d5cc50cf7d (w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents: 86834
diff changeset
425 dest.Y = 0;
24d5cc50cf7d (w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents: 86834
diff changeset
426 n = info.dwSize.X * info.dwSize.Y;
24d5cc50cf7d (w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents: 86834
diff changeset
427
24d5cc50cf7d (w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents: 86834
diff changeset
428 FillConsoleOutputAttribute (cur_screen, char_attr_normal, n, dest, &r);
24d5cc50cf7d (w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents: 86834
diff changeset
429 FillConsoleOutputCharacter (cur_screen, ' ', n, dest, &r);
24d5cc50cf7d (w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents: 86834
diff changeset
430 /* Now that the screen is clear, put the cursor at the top. */
24d5cc50cf7d (w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents: 86834
diff changeset
431 SetConsoleCursorPosition (cur_screen, dest);
110994
734b2470f93c src/w32*.c: Whitespace fixes and typos.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
432
19706
e21b63afe61f (DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18507
diff changeset
433 #ifdef USE_SEPARATE_SCREEN
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
434 SetConsoleActiveScreenBuffer (prev_screen);
19706
e21b63afe61f (DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18507
diff changeset
435 #else
e21b63afe61f (DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18507
diff changeset
436 SetConsoleCursorInfo (prev_screen, &prev_console_cursor);
e21b63afe61f (DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18507
diff changeset
437 #endif
86876
24d5cc50cf7d (w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents: 86834
diff changeset
438
19706
e21b63afe61f (DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18507
diff changeset
439 SetConsoleMode (keyboard_handle, prev_console_mode);
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
440 }
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
441
55670
d3274c878082 Prefix RIF functions with w32con_ to avoid namespace clash with term.c.
Jason Rumney <jasonr@gnu.org>
parents: 55644
diff changeset
442 static void
83573
b77b83741308 (w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents: 75227
diff changeset
443 w32con_set_terminal_modes (struct terminal *t)
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
444 {
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
445 CONSOLE_CURSOR_INFO cci;
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
446
19706
e21b63afe61f (DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18507
diff changeset
447 /* make cursor big and visible (100 on Win95 makes it disappear) */
e21b63afe61f (DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18507
diff changeset
448 cci.dwSize = 99;
e21b63afe61f (DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18507
diff changeset
449 cci.bVisible = TRUE;
e21b63afe61f (DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18507
diff changeset
450 (void) SetConsoleCursorInfo (cur_screen, &cci);
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
451
19706
e21b63afe61f (DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18507
diff changeset
452 SetConsoleActiveScreenBuffer (cur_screen);
e21b63afe61f (DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18507
diff changeset
453
e21b63afe61f (DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18507
diff changeset
454 SetConsoleMode (keyboard_handle, ENABLE_MOUSE_INPUT | ENABLE_WINDOW_INPUT);
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
455
19706
e21b63afe61f (DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18507
diff changeset
456 /* Initialize input mode: interrupt_input off, no flow control, allow
e21b63afe61f (DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18507
diff changeset
457 8 bit character input, standard quit char. */
e21b63afe61f (DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18507
diff changeset
458 Fset_input_mode (Qnil, Qnil, make_number (2), Qnil);
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
459 }
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
460
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
461 /* hmmm... perhaps these let us bracket screen changes so that we can flush
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
462 clumps rather than one-character-at-a-time...
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 40962
diff changeset
463
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
464 we'll start with not moving the cursor while an update is in progress. */
55670
d3274c878082 Prefix RIF functions with w32con_ to avoid namespace clash with term.c.
Jason Rumney <jasonr@gnu.org>
parents: 55644
diff changeset
465 static void
d3274c878082 Prefix RIF functions with w32con_ to avoid namespace clash with term.c.
Jason Rumney <jasonr@gnu.org>
parents: 55644
diff changeset
466 w32con_update_begin (struct frame * f)
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
467 {
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
468 }
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
469
55670
d3274c878082 Prefix RIF functions with w32con_ to avoid namespace clash with term.c.
Jason Rumney <jasonr@gnu.org>
parents: 55644
diff changeset
470 static void
d3274c878082 Prefix RIF functions with w32con_ to avoid namespace clash with term.c.
Jason Rumney <jasonr@gnu.org>
parents: 55644
diff changeset
471 w32con_update_end (struct frame * f)
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
472 {
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
473 SetConsoleCursorPosition (cur_screen, cursor_coords);
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
474 }
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
475
55670
d3274c878082 Prefix RIF functions with w32con_ to avoid namespace clash with term.c.
Jason Rumney <jasonr@gnu.org>
parents: 55644
diff changeset
476 static void
83573
b77b83741308 (w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents: 75227
diff changeset
477 w32con_set_terminal_window (struct frame *f, int size)
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
478 {
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
479 }
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
480
27395
fe54558f20d8 (turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents: 24938
diff changeset
481 /***********************************************************************
108007
ea2f4615a622 Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
482 stubs from termcap.c
ea2f4615a622 Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
483 ***********************************************************************/
ea2f4615a622 Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
484
ea2f4615a622 Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
485 void
109160
f8660b83cdbf Fix whitespace to follow coding guidelines.
Juanma Barranquero <lekktu@gmail.com>
parents: 109152
diff changeset
486 sys_tputs (char *str, int nlines, int (*outfun) (int))
108007
ea2f4615a622 Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
487 {
ea2f4615a622 Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
488 }
ea2f4615a622 Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
489
ea2f4615a622 Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
490 char *
ea2f4615a622 Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
491 sys_tgetstr (char *cap, char **area)
ea2f4615a622 Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
492 {
ea2f4615a622 Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
493 return NULL;
ea2f4615a622 Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
494 }
ea2f4615a622 Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
495
ea2f4615a622 Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
496
ea2f4615a622 Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
497 /***********************************************************************
ea2f4615a622 Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
498 stubs from cm.c
ea2f4615a622 Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
499 ***********************************************************************/
ea2f4615a622 Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
500
ea2f4615a622 Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
501 struct tty_display_info *current_tty = NULL;
ea2f4615a622 Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
502 int cost = 0;
ea2f4615a622 Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
503
ea2f4615a622 Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
504 int
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109116
diff changeset
505 evalcost (int c)
108007
ea2f4615a622 Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
506 {
ea2f4615a622 Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
507 return c;
ea2f4615a622 Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
508 }
ea2f4615a622 Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
509
ea2f4615a622 Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
510 int
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109116
diff changeset
511 cmputc (int c)
108007
ea2f4615a622 Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
512 {
ea2f4615a622 Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
513 return c;
ea2f4615a622 Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
514 }
ea2f4615a622 Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
515
ea2f4615a622 Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
516 void
ea2f4615a622 Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
517 cmcheckmagic (struct tty_display_info *tty)
ea2f4615a622 Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
518 {
ea2f4615a622 Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
519 }
ea2f4615a622 Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
520
ea2f4615a622 Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
521 void
ea2f4615a622 Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
522 cmcostinit (struct tty_display_info *tty)
ea2f4615a622 Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
523 {
ea2f4615a622 Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
524 }
ea2f4615a622 Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
525
ea2f4615a622 Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
526 void
ea2f4615a622 Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
527 cmgoto (struct tty_display_info *tty, int row, int col)
ea2f4615a622 Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
528 {
ea2f4615a622 Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
529 }
ea2f4615a622 Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
530
ea2f4615a622 Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
531 void
ea2f4615a622 Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
532 Wcm_clear (struct tty_display_info *tty)
ea2f4615a622 Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
533 {
ea2f4615a622 Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
534 }
ea2f4615a622 Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
535
ea2f4615a622 Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
536
ea2f4615a622 Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
537 /***********************************************************************
27395
fe54558f20d8 (turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents: 24938
diff changeset
538 Faces
fe54558f20d8 (turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents: 24938
diff changeset
539 ***********************************************************************/
fe54558f20d8 (turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents: 24938
diff changeset
540
fe54558f20d8 (turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents: 24938
diff changeset
541
fe54558f20d8 (turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents: 24938
diff changeset
542 /* Turn appearances of face FACE_ID on tty frame F on. */
fe54558f20d8 (turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents: 24938
diff changeset
543
27518
ff2e0205b5a0 (turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents: 27395
diff changeset
544 static WORD
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109116
diff changeset
545 w32_face_attributes (struct frame *f, int face_id)
27395
fe54558f20d8 (turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents: 24938
diff changeset
546 {
27518
ff2e0205b5a0 (turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents: 27395
diff changeset
547 WORD char_attr;
27395
fe54558f20d8 (turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents: 24938
diff changeset
548 struct face *face = FACE_FROM_ID (f, face_id);
fe54558f20d8 (turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents: 24938
diff changeset
549
fe54558f20d8 (turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents: 24938
diff changeset
550 xassert (face != NULL);
fe54558f20d8 (turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents: 24938
diff changeset
551
fe54558f20d8 (turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents: 24938
diff changeset
552 char_attr = char_attr_normal;
fe54558f20d8 (turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents: 24938
diff changeset
553
86880
a7773099c258 (w32_face_attributes): Don't use color indexes that are out of range.
Jason Rumney <jasonr@gnu.org>
parents: 86876
diff changeset
554 /* Reverse the default color if requested. If background and
a7773099c258 (w32_face_attributes): Don't use color indexes that are out of range.
Jason Rumney <jasonr@gnu.org>
parents: 86876
diff changeset
555 foreground are specified, then they have been reversed already. */
40079
e62d3694acdc (reassert_line_highlight, change_line_highlight): Functions removed.
Miles Bader <miles@gnu.org>
parents: 39682
diff changeset
556 if (face->tty_reverse_p)
27518
ff2e0205b5a0 (turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents: 27395
diff changeset
557 char_attr = (char_attr & 0xff00) + ((char_attr & 0x000f) << 4)
ff2e0205b5a0 (turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents: 27395
diff changeset
558 + ((char_attr & 0x00f0) >> 4);
ff2e0205b5a0 (turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents: 27395
diff changeset
559
86880
a7773099c258 (w32_face_attributes): Don't use color indexes that are out of range.
Jason Rumney <jasonr@gnu.org>
parents: 86876
diff changeset
560 /* Before the terminal is properly initialized, all colors map to 0.
a7773099c258 (w32_face_attributes): Don't use color indexes that are out of range.
Jason Rumney <jasonr@gnu.org>
parents: 86876
diff changeset
561 Don't try to resolve them. */
a7773099c258 (w32_face_attributes): Don't use color indexes that are out of range.
Jason Rumney <jasonr@gnu.org>
parents: 86876
diff changeset
562 if (NILP (Vtty_defined_color_alist))
a7773099c258 (w32_face_attributes): Don't use color indexes that are out of range.
Jason Rumney <jasonr@gnu.org>
parents: 86876
diff changeset
563 return char_attr;
a7773099c258 (w32_face_attributes): Don't use color indexes that are out of range.
Jason Rumney <jasonr@gnu.org>
parents: 86876
diff changeset
564
86907
0f135bf21932 (w32_face_attributes): Comment previous change.
Jason Rumney <jasonr@gnu.org>
parents: 86880
diff changeset
565 /* Colors should be in the range 0...15 unless they are one of
0f135bf21932 (w32_face_attributes): Comment previous change.
Jason Rumney <jasonr@gnu.org>
parents: 86880
diff changeset
566 FACE_TTY_DEFAULT_COLOR, FACE_TTY_DEFAULT_FG_COLOR or
0f135bf21932 (w32_face_attributes): Comment previous change.
Jason Rumney <jasonr@gnu.org>
parents: 86880
diff changeset
567 FACE_TTY_DEFAULT_BG_COLOR. Other out of range colors are
0f135bf21932 (w32_face_attributes): Comment previous change.
Jason Rumney <jasonr@gnu.org>
parents: 86880
diff changeset
568 invalid, so it is better to use the default color if they ever
0f135bf21932 (w32_face_attributes): Comment previous change.
Jason Rumney <jasonr@gnu.org>
parents: 86880
diff changeset
569 get through to here. */
0f135bf21932 (w32_face_attributes): Comment previous change.
Jason Rumney <jasonr@gnu.org>
parents: 86880
diff changeset
570 if (face->foreground >= 0 && face->foreground < 16)
86880
a7773099c258 (w32_face_attributes): Don't use color indexes that are out of range.
Jason Rumney <jasonr@gnu.org>
parents: 86876
diff changeset
571 char_attr = (char_attr & 0xfff0) + face->foreground;
a7773099c258 (w32_face_attributes): Don't use color indexes that are out of range.
Jason Rumney <jasonr@gnu.org>
parents: 86876
diff changeset
572
86907
0f135bf21932 (w32_face_attributes): Comment previous change.
Jason Rumney <jasonr@gnu.org>
parents: 86880
diff changeset
573 if (face->background >= 0 && face->background < 16)
86880
a7773099c258 (w32_face_attributes): Don't use color indexes that are out of range.
Jason Rumney <jasonr@gnu.org>
parents: 86876
diff changeset
574 char_attr = (char_attr & 0xff0f) + (face->background << 4);
a7773099c258 (w32_face_attributes): Don't use color indexes that are out of range.
Jason Rumney <jasonr@gnu.org>
parents: 86876
diff changeset
575
27518
ff2e0205b5a0 (turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents: 27395
diff changeset
576 return char_attr;
27395
fe54558f20d8 (turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents: 24938
diff changeset
577 }
fe54558f20d8 (turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents: 24938
diff changeset
578
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
579 void
83882
c81c5bd99c21 (one_and_only_w32cons): Remove.
Jason Rumney <jasonr@gnu.org>
parents: 83648
diff changeset
580 initialize_w32_display (struct terminal *term)
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
581 {
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
582 CONSOLE_SCREEN_BUFFER_INFO info;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 40962
diff changeset
583
83892
fc43b930f905 (initialize_w32_display): Zero unused hooks.
Jason Rumney <jasonr@gnu.org>
parents: 83882
diff changeset
584 term->rif = 0; /* No window based redisplay on the console. */
83573
b77b83741308 (w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents: 75227
diff changeset
585 term->cursor_to_hook = w32con_move_cursor;
110994
734b2470f93c src/w32*.c: Whitespace fixes and typos.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
586 term->raw_cursor_to_hook = w32con_move_cursor;
734b2470f93c src/w32*.c: Whitespace fixes and typos.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
587 term->clear_to_end_hook = w32con_clear_to_end;
734b2470f93c src/w32*.c: Whitespace fixes and typos.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
588 term->clear_frame_hook = w32con_clear_frame;
83573
b77b83741308 (w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents: 75227
diff changeset
589 term->clear_end_of_line_hook = w32con_clear_end_of_line;
110994
734b2470f93c src/w32*.c: Whitespace fixes and typos.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
590 term->ins_del_lines_hook = w32con_ins_del_lines;
734b2470f93c src/w32*.c: Whitespace fixes and typos.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
591 term->insert_glyphs_hook = w32con_insert_glyphs;
734b2470f93c src/w32*.c: Whitespace fixes and typos.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
592 term->write_glyphs_hook = w32con_write_glyphs;
734b2470f93c src/w32*.c: Whitespace fixes and typos.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
593 term->delete_glyphs_hook = w32con_delete_glyphs;
83573
b77b83741308 (w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents: 75227
diff changeset
594 term->ring_bell_hook = w32_sys_ring_bell;
110994
734b2470f93c src/w32*.c: Whitespace fixes and typos.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
595 term->reset_terminal_modes_hook = w32con_reset_terminal_modes;
83573
b77b83741308 (w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents: 75227
diff changeset
596 term->set_terminal_modes_hook = w32con_set_terminal_modes;
110994
734b2470f93c src/w32*.c: Whitespace fixes and typos.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
597 term->set_terminal_window_hook = w32con_set_terminal_window;
734b2470f93c src/w32*.c: Whitespace fixes and typos.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
598 term->update_begin_hook = w32con_update_begin;
83573
b77b83741308 (w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents: 75227
diff changeset
599 term->update_end_hook = w32con_update_end;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 40962
diff changeset
600
83573
b77b83741308 (w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents: 75227
diff changeset
601 term->read_socket_hook = w32_console_read_socket;
b77b83741308 (w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents: 75227
diff changeset
602 term->mouse_position_hook = w32_console_mouse_position;
19706
e21b63afe61f (DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18507
diff changeset
603
83892
fc43b930f905 (initialize_w32_display): Zero unused hooks.
Jason Rumney <jasonr@gnu.org>
parents: 83882
diff changeset
604 /* The following are not used on the console. */
fc43b930f905 (initialize_w32_display): Zero unused hooks.
Jason Rumney <jasonr@gnu.org>
parents: 83882
diff changeset
605 term->frame_rehighlight_hook = 0;
fc43b930f905 (initialize_w32_display): Zero unused hooks.
Jason Rumney <jasonr@gnu.org>
parents: 83882
diff changeset
606 term->frame_raise_lower_hook = 0;
fc43b930f905 (initialize_w32_display): Zero unused hooks.
Jason Rumney <jasonr@gnu.org>
parents: 83882
diff changeset
607 term->set_vertical_scroll_bar_hook = 0;
fc43b930f905 (initialize_w32_display): Zero unused hooks.
Jason Rumney <jasonr@gnu.org>
parents: 83882
diff changeset
608 term->condemn_scroll_bars_hook = 0;
fc43b930f905 (initialize_w32_display): Zero unused hooks.
Jason Rumney <jasonr@gnu.org>
parents: 83882
diff changeset
609 term->redeem_scroll_bar_hook = 0;
fc43b930f905 (initialize_w32_display): Zero unused hooks.
Jason Rumney <jasonr@gnu.org>
parents: 83882
diff changeset
610 term->judge_scroll_bars_hook = 0;
fc43b930f905 (initialize_w32_display): Zero unused hooks.
Jason Rumney <jasonr@gnu.org>
parents: 83882
diff changeset
611 term->frame_up_to_date_hook = 0;
19706
e21b63afe61f (DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18507
diff changeset
612
22540
0e7c65caf1cb (initialize_w32_display): Call init_crit to initialize
Andrew Innes <andrewi@gnu.org>
parents: 21828
diff changeset
613 /* Initialize interrupt_handle. */
0e7c65caf1cb (initialize_w32_display): Call init_crit to initialize
Andrew Innes <andrewi@gnu.org>
parents: 21828
diff changeset
614 init_crit ();
0e7c65caf1cb (initialize_w32_display): Call init_crit to initialize
Andrew Innes <andrewi@gnu.org>
parents: 21828
diff changeset
615
19706
e21b63afe61f (DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18507
diff changeset
616 /* Remember original console settings. */
e21b63afe61f (DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18507
diff changeset
617 keyboard_handle = GetStdHandle (STD_INPUT_HANDLE);
e21b63afe61f (DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18507
diff changeset
618 GetConsoleMode (keyboard_handle, &prev_console_mode);
e21b63afe61f (DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18507
diff changeset
619
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
620 prev_screen = GetStdHandle (STD_OUTPUT_HANDLE);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 40962
diff changeset
621
19706
e21b63afe61f (DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18507
diff changeset
622 #ifdef USE_SEPARATE_SCREEN
e21b63afe61f (DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18507
diff changeset
623 cur_screen = CreateConsoleScreenBuffer (GENERIC_READ | GENERIC_WRITE,
e21b63afe61f (DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18507
diff changeset
624 0, NULL,
e21b63afe61f (DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18507
diff changeset
625 CONSOLE_TEXTMODE_BUFFER,
e21b63afe61f (DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18507
diff changeset
626 NULL);
e21b63afe61f (DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18507
diff changeset
627
e21b63afe61f (DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18507
diff changeset
628 if (cur_screen == INVALID_HANDLE_VALUE)
e21b63afe61f (DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18507
diff changeset
629 {
e21b63afe61f (DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18507
diff changeset
630 printf ("CreateConsoleScreenBuffer failed in ResetTerm\n");
e21b63afe61f (DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18507
diff changeset
631 printf ("LastError = 0x%lx\n", GetLastError ());
e21b63afe61f (DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18507
diff changeset
632 fflush (stdout);
e21b63afe61f (DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18507
diff changeset
633 exit (0);
e21b63afe61f (DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18507
diff changeset
634 }
e21b63afe61f (DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18507
diff changeset
635 #else
e21b63afe61f (DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18507
diff changeset
636 cur_screen = prev_screen;
e21b63afe61f (DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18507
diff changeset
637 GetConsoleCursorInfo (prev_screen, &prev_console_cursor);
e21b63afe61f (DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18507
diff changeset
638 #endif
e21b63afe61f (DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18507
diff changeset
639
24938
a4c871b96d4b (w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24755
diff changeset
640 /* Respect setting of LINES and COLUMNS environment variables. */
a4c871b96d4b (w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24755
diff changeset
641 {
110994
734b2470f93c src/w32*.c: Whitespace fixes and typos.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
642 char * lines = getenv ("LINES");
734b2470f93c src/w32*.c: Whitespace fixes and typos.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
643 char * columns = getenv ("COLUMNS");
24938
a4c871b96d4b (w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24755
diff changeset
644
a4c871b96d4b (w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24755
diff changeset
645 if (lines != NULL && columns != NULL)
a4c871b96d4b (w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24755
diff changeset
646 {
a4c871b96d4b (w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24755
diff changeset
647 SMALL_RECT new_win_dims;
a4c871b96d4b (w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24755
diff changeset
648 COORD new_size;
a4c871b96d4b (w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24755
diff changeset
649
a4c871b96d4b (w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24755
diff changeset
650 new_size.X = atoi (columns);
a4c871b96d4b (w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24755
diff changeset
651 new_size.Y = atoi (lines);
a4c871b96d4b (w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24755
diff changeset
652
a4c871b96d4b (w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24755
diff changeset
653 GetConsoleScreenBufferInfo (cur_screen, &info);
a4c871b96d4b (w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24755
diff changeset
654
a4c871b96d4b (w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24755
diff changeset
655 /* Shrink the window first, so the buffer dimensions can be
a4c871b96d4b (w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24755
diff changeset
656 reduced if necessary. */
a4c871b96d4b (w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24755
diff changeset
657 new_win_dims.Top = 0;
a4c871b96d4b (w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24755
diff changeset
658 new_win_dims.Left = 0;
a4c871b96d4b (w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24755
diff changeset
659 new_win_dims.Bottom = min (new_size.Y, info.dwSize.Y) - 1;
a4c871b96d4b (w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24755
diff changeset
660 new_win_dims.Right = min (new_size.X, info.dwSize.X) - 1;
a4c871b96d4b (w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24755
diff changeset
661 SetConsoleWindowInfo (cur_screen, TRUE, &new_win_dims);
a4c871b96d4b (w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24755
diff changeset
662
a4c871b96d4b (w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24755
diff changeset
663 SetConsoleScreenBufferSize (cur_screen, new_size);
a4c871b96d4b (w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24755
diff changeset
664
a4c871b96d4b (w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24755
diff changeset
665 /* Set the window size to match the buffer dimension. */
a4c871b96d4b (w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24755
diff changeset
666 new_win_dims.Top = 0;
a4c871b96d4b (w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24755
diff changeset
667 new_win_dims.Left = 0;
a4c871b96d4b (w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24755
diff changeset
668 new_win_dims.Bottom = new_size.Y - 1;
a4c871b96d4b (w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24755
diff changeset
669 new_win_dims.Right = new_size.X - 1;
a4c871b96d4b (w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24755
diff changeset
670 SetConsoleWindowInfo (cur_screen, TRUE, &new_win_dims);
a4c871b96d4b (w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24755
diff changeset
671 }
a4c871b96d4b (w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24755
diff changeset
672 }
a4c871b96d4b (w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24755
diff changeset
673
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
674 GetConsoleScreenBufferInfo (cur_screen, &info);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 40962
diff changeset
675
27518
ff2e0205b5a0 (turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents: 27395
diff changeset
676 char_attr_normal = info.wAttributes;
23572
1fa5f9f5c92e (initialize_w32_display): Use buffer coords
Geoff Voelker <voelker@cs.washington.edu>
parents: 23563
diff changeset
677
64111
a948ecc89102 (initialize_w32_display): Detect when the console
Jason Rumney <jasonr@gnu.org>
parents: 64084
diff changeset
678 /* Determine if the info returned by GetConsoleScreenBufferInfo
a948ecc89102 (initialize_w32_display): Detect when the console
Jason Rumney <jasonr@gnu.org>
parents: 64084
diff changeset
679 is realistic. Old MS Telnet servers used to only fill out
a948ecc89102 (initialize_w32_display): Detect when the console
Jason Rumney <jasonr@gnu.org>
parents: 64084
diff changeset
680 the dwSize portion, even modern one fill the whole struct with
a948ecc89102 (initialize_w32_display): Detect when the console
Jason Rumney <jasonr@gnu.org>
parents: 64084
diff changeset
681 garbage when using non-MS telnet clients. */
a948ecc89102 (initialize_w32_display): Detect when the console
Jason Rumney <jasonr@gnu.org>
parents: 64084
diff changeset
682 if ((w32_use_full_screen_buffer
a948ecc89102 (initialize_w32_display): Detect when the console
Jason Rumney <jasonr@gnu.org>
parents: 64084
diff changeset
683 && (info.dwSize.Y < 20 || info.dwSize.Y > 100
a948ecc89102 (initialize_w32_display): Detect when the console
Jason Rumney <jasonr@gnu.org>
parents: 64084
diff changeset
684 || info.dwSize.X < 40 || info.dwSize.X > 200))
a948ecc89102 (initialize_w32_display): Detect when the console
Jason Rumney <jasonr@gnu.org>
parents: 64084
diff changeset
685 || (!w32_use_full_screen_buffer
a948ecc89102 (initialize_w32_display): Detect when the console
Jason Rumney <jasonr@gnu.org>
parents: 64084
diff changeset
686 && (info.srWindow.Bottom - info.srWindow.Top < 20
a948ecc89102 (initialize_w32_display): Detect when the console
Jason Rumney <jasonr@gnu.org>
parents: 64084
diff changeset
687 || info.srWindow.Bottom - info.srWindow.Top > 100
a948ecc89102 (initialize_w32_display): Detect when the console
Jason Rumney <jasonr@gnu.org>
parents: 64084
diff changeset
688 || info.srWindow.Right - info.srWindow.Left < 40
a948ecc89102 (initialize_w32_display): Detect when the console
Jason Rumney <jasonr@gnu.org>
parents: 64084
diff changeset
689 || info.srWindow.Right - info.srWindow.Left > 100)))
a948ecc89102 (initialize_w32_display): Detect when the console
Jason Rumney <jasonr@gnu.org>
parents: 64084
diff changeset
690 {
a948ecc89102 (initialize_w32_display): Detect when the console
Jason Rumney <jasonr@gnu.org>
parents: 64084
diff changeset
691 FRAME_LINES (SELECTED_FRAME ()) = 25;
a948ecc89102 (initialize_w32_display): Detect when the console
Jason Rumney <jasonr@gnu.org>
parents: 64084
diff changeset
692 SET_FRAME_COLS (SELECTED_FRAME (), 80);
a948ecc89102 (initialize_w32_display): Detect when the console
Jason Rumney <jasonr@gnu.org>
parents: 64084
diff changeset
693 }
a948ecc89102 (initialize_w32_display): Detect when the console
Jason Rumney <jasonr@gnu.org>
parents: 64084
diff changeset
694
a948ecc89102 (initialize_w32_display): Detect when the console
Jason Rumney <jasonr@gnu.org>
parents: 64084
diff changeset
695 else if (w32_use_full_screen_buffer)
24938
a4c871b96d4b (w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24755
diff changeset
696 {
51206
22a5614b558f Make (few) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50247
diff changeset
697 FRAME_LINES (SELECTED_FRAME ()) = info.dwSize.Y; /* lines per page */
22a5614b558f Make (few) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50247
diff changeset
698 SET_FRAME_COLS (SELECTED_FRAME (), info.dwSize.X); /* characters per line */
24938
a4c871b96d4b (w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24755
diff changeset
699 }
a4c871b96d4b (w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24755
diff changeset
700 else
a4c871b96d4b (w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24755
diff changeset
701 {
a4c871b96d4b (w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24755
diff changeset
702 /* Lines per page. Use buffer coords instead of buffer size. */
51206
22a5614b558f Make (few) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50247
diff changeset
703 FRAME_LINES (SELECTED_FRAME ()) = 1 + info.srWindow.Bottom -
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 40962
diff changeset
704 info.srWindow.Top;
24938
a4c871b96d4b (w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24755
diff changeset
705 /* Characters per line. Use buffer coords instead of buffer size. */
51206
22a5614b558f Make (few) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50247
diff changeset
706 SET_FRAME_COLS (SELECTED_FRAME (), 1 + info.srWindow.Right -
24938
a4c871b96d4b (w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24755
diff changeset
707 info.srWindow.Left);
a4c871b96d4b (w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24755
diff changeset
708 }
27892
1857b9695885 Only disable window system features for dispextern.h
Jason Rumney <jasonr@gnu.org>
parents: 27518
diff changeset
709
1857b9695885 Only disable window system features for dispextern.h
Jason Rumney <jasonr@gnu.org>
parents: 27518
diff changeset
710 /* Setup w32_display_info structure for this frame. */
1857b9695885 Only disable window system features for dispextern.h
Jason Rumney <jasonr@gnu.org>
parents: 27518
diff changeset
711
1857b9695885 Only disable window system features for dispextern.h
Jason Rumney <jasonr@gnu.org>
parents: 27518
diff changeset
712 w32_initialize_display_info (build_string ("Console"));
1857b9695885 Only disable window system features for dispextern.h
Jason Rumney <jasonr@gnu.org>
parents: 27518
diff changeset
713
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
714 }
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
715
83573
b77b83741308 (w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents: 75227
diff changeset
716
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
717 DEFUN ("set-screen-color", Fset_screen_color, Sset_screen_color, 2, 2, 0,
40962
f66d09d1bb2f Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40656
diff changeset
718 doc: /* Set screen colors. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109160
diff changeset
719 (Lisp_Object foreground, Lisp_Object background)
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
720 {
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
721 char_attr_normal = XFASTINT (foreground) + (XFASTINT (background) << 4);
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
722
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
723 Frecenter (Qnil);
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
724 return Qt;
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
725 }
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
726
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
727 DEFUN ("set-cursor-size", Fset_cursor_size, Sset_cursor_size, 1, 1, 0,
40962
f66d09d1bb2f Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40656
diff changeset
728 doc: /* Set cursor size. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109160
diff changeset
729 (Lisp_Object size)
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
730 {
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
731 CONSOLE_CURSOR_INFO cci;
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
732 cci.dwSize = XFASTINT (size);
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
733 cci.bVisible = TRUE;
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
734 (void) SetConsoleCursorInfo (cur_screen, &cci);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 40962
diff changeset
735
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
736 return Qt;
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
737 }
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
738
11389
4a8836398f3e (Fset_message_beep): Defined.
Karl Heuer <kwzh@gnu.org>
parents: 9907
diff changeset
739 void
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109116
diff changeset
740 syms_of_ntterm (void)
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
741 {
24938
a4c871b96d4b (w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24755
diff changeset
742 DEFVAR_BOOL ("w32-use-full-screen-buffer",
112364
42e22c4f06b7 Move all DEFVAR'd globals into a structure -- threading infrastructure
Tom Tromey <tromey@redhat.com>
parents: 112278
diff changeset
743 w32_use_full_screen_buffer,
40962
f66d09d1bb2f Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40656
diff changeset
744 doc: /* Non-nil means make terminal frames use the full screen buffer dimensions.
71534
cb66cca12fa5 (syms_of_ntterm) <w32-use-full-screen-buffer>: Doc fix - default value changed.
John Paul Wallington <jpw@pobox.com>
parents: 68651
diff changeset
745 This is desirable when running Emacs over telnet.
40962
f66d09d1bb2f Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40656
diff changeset
746 A value of nil means use the current console window dimensions; this
f66d09d1bb2f Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40656
diff changeset
747 may be preferrable when working directly at the console with a large
f66d09d1bb2f Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40656
diff changeset
748 scroll-back buffer. */);
64111
a948ecc89102 (initialize_w32_display): Detect when the console
Jason Rumney <jasonr@gnu.org>
parents: 64084
diff changeset
749 w32_use_full_screen_buffer = 0;
24938
a4c871b96d4b (w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24755
diff changeset
750
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
751 defsubr (&Sset_screen_color);
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
752 defsubr (&Sset_cursor_size);
11389
4a8836398f3e (Fset_message_beep): Defined.
Karl Heuer <kwzh@gnu.org>
parents: 9907
diff changeset
753 defsubr (&Sset_message_beep);
9907
2e5a14f7c44e Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
754 }
52401
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 51206
diff changeset
755