summaryrefslogtreecommitdiff
path: root/src/frame.h
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright year to 2014 by running admin/update-copyright.Paul Eggert2014-01-011-1/+1
|
* Some more fixes for pixelwise resizing.Martin Rudalics2013-12-201-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove scroll_bar_actual_width from frames. * frame.h (struct frame): Remove scroll_bar_actual_width slot. * frame.c (Fscroll_bar_width): Return scroll bar area width. (x_figure_window_size): * nsterm.m (x_set_window_size): * widget.c (set_frame_size): * w32term.c (x_set_window_size): * xterm.c (x_set_window_size, x_set_window_size_1): Don't set scroll_bar_actual_width. Convert scroll_bar members to integers on Windows. * w32term.h (struct scroll_bar): Convert top, left, width, height, start, end and dragging to integers. * w32fns.c (w32_createscrollbar): Remove XINT conversions for scroll_bar members. * w32term.c (w32_set_scroll_bar_thumb) (w32_scroll_bar_handle_click): Remove XINT conversions for scroll_bar members. Treat bar->dragging as integer. (x_scroll_bar_create): Call ALLOCATE_PSEUDOVECTOR with "top" as first element. Remove XINT conversions for scroll_bar members. (w32_set_vertical_scroll_bar, x_scroll_bar_report_motion): Remove XINT conversions for scroll_bar members. Fix assignment for new window total sizes. * window.c (Fwindow_resize_apply_total): Assign values for minibuffer window. * window.el (window--pixel-to-size): Remove function. (window--pixel-to-total-1, window--pixel-to-total): Fix calculation of new total sizes.
* Fix session GUI startup.Eli Zaretskii2013-12-151-1/+1
| | | | | src/frame.h (FRAME_MOUSE_UPDATE): Fix a typo that caused infloop at startup.
* Use bool for boolean, focusing on headers.Paul Eggert2013-12-141-63/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.ac (PTY_OPEN, GC_MARK_SECONDARY_STACK): Use bool for boolean. * lib-src/emacsclient.c, lib-src/etags.c, lib-src/hexl.c (FALSE, TRUE): Remove. All uses replaced with uncapitalized version. * lib-src/emacsclient.c (message): * lib-src/etags.c (make_tag, pfnote, consider_token, make_C_tag, lang_names): * lib-src/hexl.c (un_flag, iso_flag, endian): * lib-src/pop.c (pop_debug, pop_open, pop_multi_first, pop_multi_next) (pop_trash): Use bool for boolean. * lib-src/etags.c (bool): Remove. * lib-src/etags.c (globals, members, declarations, no_line_directive) (no_duplicates): Use 'int' for boolean values that getopt requires to be 'int'. Formerly, these were 'bool' and 'bool' was 'int', but we can no longer rely on this implementation. * lib-src/pop.h (struct _popserver): Use bool_bf for boolean bit-fields. * lwlib/xlwmenuP.h (XlwMenu_part): Use bool_bf for boolean bit-fields. * src/atimer.h, src/lisp.h, src/syssignal.h, src/syswait.h, src/unexelf.c: No need to include <stdbool.h>, since conf_post.h does it now. * src/buffer.h (BUF_COMPUTE_UNCHANGED, DECODE_POSITION) (BUFFER_CHECK_INDIRECTION, GET_OVERLAYS_AT, PER_BUFFER_VALUE_P) (SET_PER_BUFFER_VALUE_P): * src/ccl.c, src/ccl.h (setup_ccl_program): * src/ccl.h (CHECK_CCL_PROGRAM): * src/character.h (MAKE_CHAR_UNIBYTE, CHECK_CHARACTER_CAR) (CHECK_CHARACTER_CDR, CHAR_STRING_ADVANCE, NEXT_CHAR_BOUNDARY) (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE) (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE) (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, FETCH_CHAR_ADVANCE) (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, INC_BOTH) (DEC_BOTH, BUF_INC_POS, BUF_DEC_POS): * src/charset.h (CHECK_CHARSET, CHECK_CHARSET_GET_ID) (CHECK_CHARSET_GET_ATTR, CHECK_CHARSET_GET_CHARSET) (CHARSET_FAST_MAP_SET): * src/coding.c (decode_coding_ccl, encode_coding_ccl): * src/coding.h (CHECK_CODING_SYSTEM, CHECK_CODING_SYSTEM_GET_SPEC) (CHECK_CODING_SYSTEM_GET_ID, SJIS_TO_JIS, SJIS_TO_JIS2) (JIS_TO_SJIS, JIS_TO_SJIS2, ENCODE_FILE, DECODE_FILE) (ENCODE_SYSTEM, DECODE_SYSTEM, ENCODE_UTF_8) (decode_coding_c_string): * src/composite.h (COMPOSITION_DECODE_REFS, COMPOSITION_DECODE_RULE): * src/conf_post.h (has_attribute): * src/dispextern.h (trace_redisplay_p): (INC_TEXT_POS, DEC_TEXT_POS, SET_GLYPH_FROM_GLYPH_CODE) (SET_CHAR_GLYPH, SET_CHAR_GLYPH_FROM_GLYPH) (SET_GLYPH_FROM_CHAR_GLYPH): (WINDOW_WANTS_MODELINE_P, WINDOW_WANTS_HEADER_LINE_P) (FACE_SUITABLE_FOR_ASCII_CHAR_P, FACE_SUITABLE_FOR_CHAR_P) (PRODUCE_GLYPHS, reset_mouse_highlight, in_display_vector_p) (cursor_in_mouse_face_p): * src/dispnew.c (adjust_glyph_matrix, clear_glyph_matrix_rows) (blank_row, prepare_desired_row) (build_frame_matrix_from_leaf_window, make_current) (mirror_make_current, mirrored_line_dance, mirror_line_dance) (update_window, scrolling_window, update_frame_line): * src/disptab.h (GLYPH_FOLLOW_ALIASES): * src/editfns.c (Fformat): * src/font.h (FONT_WEIGHT_SYMBOLIC, FONT_SLANT_SYMBOLIC) (FONT_WIDTH_SYMBOLIC, FONT_WEIGHT_FOR_FACE, FONT_SLANT_FOR_FACE) (FONT_WIDTH_FOR_FACE, FONT_WEIGHT_NAME_NUMERIC) (FONT_SLANT_NAME_NUMERIC, FONT_WIDTH_NAME_NUMERIC) (FONT_SET_STYLE, CHECK_FONT, CHECK_FONT_SPEC, CHECK_FONT_ENTITY) (CHECK_FONT_OBJECT, CHECK_FONT_GET_OBJECT, FONT_ADD_LOG) (FONT_DEFERRED_LOG): * src/frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_WINDOW_P): (FRAME_EXTERNAL_TOOL_BAR, FRAME_EXTERNAL_MENU_BAR, FOR_EACH_FRAME) (FRAME_MOUSE_UPDATE): * src/fringe.c (Fdefine_fringe_bitmap): * src/image.c (x_create_bitmap_from_data, x_create_bitmap_mask) (x_create_bitmap_from_xpm_data, xpm_load_image): * src/intervals.h (INTERVAL_HAS_PARENT, INTERVAL_PARENT) (set_interval_parent, RESET_INTERVAL, COPY_INTERVAL_CACHE) (MERGE_INTERVAL_CACHE): * src/keymap.h (KEYMAPP): * src/lisp.h (eassert, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE) (STRING_SET_UNIBYTE, STRING_SET_MULTIBYTE, DEFSYM, PSEUDOVECTORP) (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER) (CHECK_NUMBER_COERCE_MARKER, CHECK_NUMBER_OR_FLOAT_COERCE_MARKER) (DEFVAR_LISP, DEFVAR_LISP_NOPRO, DEFVAR_BOOL, DEFVAR_INT) (DEFVAR_BUFFER_DEFAULTS, DEFVAR_KBOARD, QUIT) (RETURN_UNGCPRO, USE_SAFE_ALLOCA, SAFE_NALLOCA, SAFE_FREE) (SAFE_ALLOCA_LISP, FOR_EACH_ALIST_VALUE, functionp): * src/syntax.h (SYNTAX_ENTRY, SYNTAX_WITH_FLAGS, SYNTAX) (UPDATE_SYNTAX_TABLE_FORWARD, UPDATE_SYNTAX_TABLE_BACKWARD) (SETUP_BUFFER_SYNTAX_TABLE): * src/systime.h (timespec_valid_p): * src/term.c (save_and_enable_current_matrix): * src/window.h (WINDOW_MENU_BAR_P, WINDOW_TOOL_BAR_P): * src/xdisp.c (in_display_vector_p, display_tool_bar_line) (redisplay_internal, try_window_reusing_current_matrix) (sync_frame_with_window_matrix_rows, try_window_id) (display_menu_bar, display_tty_menu_item, display_mode_line) (coords_in_mouse_face_p, cursor_in_mouse_face_p): * src/xmenu.c (xmenu_show): * src/xterm.c (use_xim, x_term_init): * src/xterm.h (XSync, GTK_CHECK_VERSION, use_xim, SET_SCROLL_BAR_X_WIDGET) (struct x_bitmap_record): Use bool for booleans. * src/ccl.c (struct buffer_text): * src/ccl.h (struct ccl_program): * src/charset.h (struct charset): * src/cm.h (struct cm): * src/coding.h (struct iso_2022_spec, struct coding_system): * src/dispextern.h (struct glyph, struct glyph_matrix, struct glyph_row) (struct glyph_string, struct face, struct face_cache) (struct bidi_string_data, struct bidi_it) (struct draw_fringe_bitmap_params, struct it, Mouse_HLInfo) (struct image): * src/editfns.c (Fformat): * src/frame.h (struct frame): * src/fringe.c (struct fringe_bitmap): * src/intervals.h (struct interval): * src/keyboard.h (struct kboard): * src/lisp.h (struct Lisp_Symbol, struct Lisp_Misc_Any, struct Lisp_Marker) (struct Lisp_Overlay, struct Lisp_Save_Value, struct Lisp_Free) (struct Lisp_Buffer_Local_Value, union specbinding): * src/macfont.m (struct macfont_info): * src/process.h (struct Lisp_Process): * src/termchar.h (struct tty_display_info): * src/window.h (struct window): * src/xterm.h (struct x_output): Use bool_bf for boolean bit-fields. * src/ccl.c (setup_ccl_program): Now returns bool instead of -1 or 0. All callers changed. * src/ccl.h (struct ccl_program): Remove unused members private_state, src_multibyte, dst_multibyte, cr_consumed, suppress_error, eight_bit_control. (struct ccl_spec): Remove unused members cr_carryover, eight_bit_carryover. * src/conf_post.h: Include <stdbool.h>. (bool_bf): New type. * src/dispextern.h (TRACE, PREPARE_FACE_FOR_DISPLAY): * src/interval.h (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE) Surround statement macro with proper 'do { ... } while (false)' brackets. (SET_MATRIX_ROW_ENABLED_P): Assume 2nd arg is bool. (PRODUCE_GLYPHS): Simplify use of boolean. * src/fileio.c (Fcopy_file): If I is an integer, prefer 'if (I != 0)' to 'if (I)'. * src/lisp.h (UNGCPRO): Return void, not int. (FOR_EACH_TAIL): Use void expression, not int expression. * src/region-cache.c: Reindent. * src/region-cache.h: Copy comments from region-cache.c, to fix incorrect remarks about booleans.
* * frame.h (SET_FRAME_VISIBLE): Now an inline function.Paul Eggert2013-12-071-4/+9
| | | | | | | The macro didn't conform to C99 due to type mismatch, which caused compilation failure with Sun C 5.12, and it was confusing anyway. Include window.h to declare redisplay_other_windows.
* Spelling and punctuation fixes.Paul Eggert2013-12-011-3/+3
|
* Support resizing frames and windows pixelwise.Martin Rudalics2013-11-301-72/+139
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dispextern.h (enum window_part): Add ON_SCROLL_BAR, ON_RIGHT_DIVIDER and ON_BOTTOM_DIVIDER. (struct glyph_matrix): Replace window_left_col and window_top_line by window_pixel_left and window_pixel_top. (WINDOW_WANTS_MODELINE_P, WINDOW_WANTS_HEADER_LINE_P): Minor rewrite. (enum face_id): Add WINDOW_DIVIDER_FACE_ID. (draw_window_divider, move_it_to, x_draw_right_divider) (x_draw_bottom_divider, change_frame_size): Add or fix declarations. * dispnew.c (change_frame_size_1): Change prototype. (adjust_glyph_matrix, required_matrix_width) (adjust_frame_glyphs_for_window_redisplay): Use pixel values instead of lines and columns. (marginal_area_string): Use WINDOW_FRINGES_WIDTH instead of WINDOW_TOTAL_FRINGE_WIDTH. (handle_window_change_signal, do_pending_window_change) (init_display): Adjusts calls of change_frame_size. (change_frame_size, change_frame_size_1): Handle pixelwise changes. * frame.c (Qright_divider_width, Qbottom_divider_width): New Lisp objects. (set_menu_bar_lines_1, set_menu_bar_lines, make_frame) (make_terminal_frame, Fmake_terminal_frame, Fframe_parameters) (x_set_internal_border_width, x_set_vertical_scroll_bars) (x_set_scroll_bar_width, x_figure_window_size): Handle pixel values. (set_frame_param): New function. (Fframe_text_cols, Fframe_text_lines, Fframe_total_cols) (Fframe_text_width, Fframe_text_height, Fscroll_bar_width) (Ffringe_width, Fborder_width, Fright_divider_width) (Fbottom_divider_width): New functions, defsubr them. (Fset_frame_height, Fset_frame_width, Fset_frame_size): New argument pixelwise. (struct frame_parm_table): New members Qright_divider_width and Qbottom_divider_width. (x_set_frame_parameters): Handle parameters for pixelwise sizes. (x_report_frame_params): Handle Qright_divider_width and Qbottom_divider_width. (x_set_right_divider_width, x_set_bottom_divider_width): New functions. (frame_resize_pixelwise): New option. * frame.h (struct frame): Add tool_bar_height, menu_bar_height, new_pixelwise, right_divider_width and bottom_divider_width; remove total_lines; rename text_lines, text_cols, new_text_lines and new_text_cols to text_height, text_width, new_height and new_width respectively. (FRAME_LINES, FRAME_COLS): Rename to FRAME_TEXT_HEIGHT and FRAME_TEXT_WIDTH respectively. (FRAME_MENU_BAR_HEIGHT, FRAME_TOOL_BAR_HEIGHT) (FRAME_RIGHT_DIVIDER_WIDTH, FRAME_BOTTOM_DIVIDER_WIDTH) (FRAME_TEXT_TO_PIXEL_WIDTH, FRAME_PIXEL_TO_TEXT_WIDTH): New macros. (FRAME_TOP_MARGIN_HEIGHT, FRAME_LEFT_SCROLL_BAR_AREA_WIDTH) (FRAME_RIGHT_SCROLL_BAR_AREA_WIDTH, FRAME_SCROLL_BAR_AREA_WIDTH) (SET_FRAME_COLS, SET_FRAME_WIDTH, SET_FRAME_HEIGHT) (FRAME_TEXT_COLS_TO_PIXEL_WIDTH, FRAME_PIXEL_WIDTH_TO_TEXT_COLS) (FRAME_TEXT_COLS_TO_PIXEL_WIDTH): Rewrite macros. (FRAME_TOTAL_COLS_ARG): Remove macro. * fringe.c (draw_fringe_bitmap_1): Handle right divder. * gtkutil.c (xg_frame_resized, xg_frame_set_char_size) (x_wm_set_size_hint): Handle frame pixel sizes. * indent.c (compute_motion, Fcompute_motion): Call window_body_width instead of window_body_cols. * keyboard.c (Qright_divider, Qbottom_divider): New symbols. (make_lispy_position): Handle right and bottom dividers. (Fsuspend_emacs): Pixelize call of change_frame_size. * keyboard.h: Extern Qright_divider, Qbottom_divider. * lisp.h: Extern set_frame_param. * nsfns.m (x_set_tool_bar_lines): Pixelize call of x_set_window_size. (Fx_create_frame): Add entry for vertical_drag_cursor. Pixelize call of change_frame_size. * nsterm.h (struct ns_output): Add vertical_drag_cursor. * nsterm.m (ns_update_window_end): Optionally draw right divider. (x_set_window_size): Add argument pixelwise. Call check_frame_size and change_frame_size with pixelwise zero. (ns_draw_window_divider): New function. (ns_redisplay_interface): Add ns_draw_window_divider. (updateFrameSize:): Call change_frame_size with pixelwise zero. (x_new_font): Call x_set_window_size with pixelwise zero. * print.c (print_object): For a window print its sequence number again. * term.c (Fresume_tty): Pixelize call of change_frame_size. * w32fns.c (x_set_mouse_color): Handle vertical drag cursor. (x_set_menu_bar_lines, x_set_tool_bar_lines): Calculate pixelwise. (w32_createwindow): Use scroll bar area width. (w32_wnd_proc): Handle bottom divider width. For WM_WINDOWPOSCHANGING return zero if we resize pixelwise. (Fx_create_frame): Default divider width parameters. Caclulate sizes pixelwise. Add vertical drag cursor support. (x_create_tip_frame): Default divider widths to zero. Pixelize call to change_frame_size. (Fx_show_tip): Add handling of divider widths. Pixelize window position and sizes. (Fw32_frame_rect): New function. (frame_parm_handler w32_frame_parm_handlers): Add divider widths. (Vx_window_vertical_drag_shape): Add variable. * w32inevt.c (resize_event, maybe_generate_resize_event): Pixelize change_frame_size calls. * w32menu.c (set_frame_menubar): Pixelize x_set_window_size call. * w32term.c (w32_draw_window_divider): New function. (x_update_window_end): Handle right divider. (w32_draw_fringe_bitmap, x_scroll_run) (w32_set_vertical_scroll_bar): Pixelize scrollbar widths. (w32_read_socket): Handle SIZE_MAXIMIZED separately. Calculate new frame sizes pixelwise. (x_new_font): Pixelize call to x_set_window_size. (x_check_fullscreen): Pixelize call to change_frame_size. (x_set_window_size_1, x_set_window_size): New argument pixelwise. Calculate pixelwise. (x_wm_set_size_hint): Use scroll bar area width. (w32_redisplay_interface): Add w32_draw_window_divider. * w32term.h (struct w32_output): Add vertical drag cursor. * widget.c (set_frame_size, update_wm_hints) (EmacsFrameResize, EmacsFrameSetValues): Pixelize calls of change_frame_size. (EmacsFrameSetCharSize): Pixelize call of x_set_window_size. * window.c (sequence_number): Restore. (Fwindow_pixel_width, Fwindow_pixel_height) (Fwindow_mode_line_height, Fwindow_header_line_height) (window_pixel_to_total, Frun_window_scroll_functions) (Fset_window_new_pixel, window_resize_apply_total) (Fwindow_resize_apply_total): New functions. (window_body_height, window_body_width): Rename from window_body_lines. New argument PIXELWISE. Calculate pixelwise. (Fwindow_body_height, Fwindow_body_width): New argument PIXELWISE. (coordinates_in_window, window_relative_x_coord): Use window's pixel width instead of total width. (replace_window, recombine_windows): Initialize pixel values. (resize_root_window, resize_frame_windows, grow_mini_window) (shrink_mini_window): New argument PIXELWISE. Calculate pixelwise. (Fdelete_other_windows_internal, adjust_window_margins) (window_resize_check, window_resize_apply) (Fdelete_window_internal, Fresize_mini_window_internal) (Fwindow_text_width, Fwindow_text_height): Calculate pixelwise. (check_frame_size): Rename arguments. New argument PIXELWISE. Calculate pixelwise. (set_window_buffer): Make samebuf bool. Run configuration change hook only if buffer changed. (Fset_window_buffer): Rewrite doc-string. (make_window): Initialize new_pixel slot. (Fwindow_resize_apply): Check pixel size of root window. (Fsplit_window_internal): Call 2nd argument pixel_size. Calculate pixelwise. (Fscroll_left, Fscroll_right): Call window_body_width instead of window_body_cols. (save_window_data): New slots frame_text_width, frame_text_height, frame_menu_bar_height, frame_tool_bar_height. (saved_window): New slots pixel_left, pixel_top, pixel_height, pixel_width. (Fcurrent_window_configuration, Fset_window_configuration) (save_window_save, compare_window_configurations): Handle new slots in save_window_data and saved_window. (Fset_window_scroll_bars): Fix doc-string. (window_resize_pixelwise): New variable. (coordinates_in_window, Fcoordinates_in_window_p): Handle dividers. (make_parent_window): Adjust sequence_number. (Fwindow_right_divider_width, Fwindow_bottom_divider_width): New functions. * window.h (struct window): New members new_pixel, pixel_left, pixel_top, pixel_width, pixel_height. Restore sequence_number. (wset_new_pixel): New function. (WINDOW_PIXEL_WIDTH, WINDOW_PIXEL_HEIGHT) (MIN_SAFE_WINDOW_PIXEL_WIDTH, MIN_SAFE_WINDOW_PIXEL_HEIGHT) (WINDOW_LEFT_PIXEL_EDGE, WINDOW_RIGHT_PIXEL_EDGE) (WINDOW_TOP_PIXEL_EDGE, WINDOW_BOTTOM_PIXEL_EDGE) (WINDOW_BOTTOMMOST_P, WINDOW_BOX_LEFT_PIXEL_EDGE) (WINDOW_BOX_RIGHT_PIXEL_EDGE, WINDOW_MARGINS_COLS) (WINDOW_MARGINS_WIDTH, WINDOW_RIGHT_DIVIDER_WIDTH) (WINDOW_BOTTOM_DIVIDER_WIDTH): New macros. (WINDOW_TOTAL_FRINGE_WIDTH): Rename to WINDOW_FRINGES_WIDTH. (WINDOW_TOTAL_WIDTH, WINDOW_TOTAL_HEIGHT): Remove macros. (WINDOW_RIGHT_EDGE_X, WINDOW_LEFT_EDGE_X, WINDOW_TOP_EDGE_Y) (WINDOW_BOTTOM_EDGE_Y, WINDOW_FULL_WIDTH_P, WINDOW_LEFTMOST_P) (WINDOW_RIGHTMOST_P, WINDOW_BOX_LEFT_EDGE_X) (WINDOW_BOX_RIGHT_EDGE_X, WINDOW_FRINGE_COLS) (WINDOW_BOX_HEIGHT_NO_MODE_LINE, WINDOW_BOX_TEXT_HEIGHT): Rewrite. (resize_frame_windows, grow_mini_window, shrink_mini_window) (window_body_width, check_frame_size): Adapt external declarations. * xdisp.c (last_max_ascent): New integer. (window_text_bottom_y): Handle bottom divider. (window_box_width, window_box_height): Calculate pixelwise. (get_glyph_string_clip_rects): Handle right divider. (remember_mouse_glyph): When windows are resized pixelwise proceed with width and height set to 1. (init_iterator): Use WINDOW_PIXEL_WIDTH instead of WINDOW_TOTAL_WIDTH. (move_it_to): Calculate and return maximum x position encountered. (Fwindow_text_pixel_size): New function. (resize_mini_window, update_tool_bar): Calculate pixelwise. (tool_bar_lines_needed): Rename to tool_bar_height. Calculate pixelwise. (Ftool_bar_lines_needed): Rename to Ftool_bar_height. Calculate pixelwise. (redisplay_tool_bar): Calculate pixelwise. (redisplay_window): Calculate pixelwise. Handle dividers. (draw_glyphs, x_clear_end_of_line, note_mouse_highlight) (x_draw_vertical_border): Handle dividers. (define_frame_cursor1): Handle vertical drag cursor. (x_draw_right_divider, x_draw_bottom_divider): New functions. (expose_window): Calculate pixelwise. Handle dividers. (init_xdisp): Initialize pixel values. * xfaces.c (Qwindow_divider): New face. (realize_basic_faces): Realize it. * xfns.c (x_set_mouse_color): Handle vertical_drag_cursor. (x_set_menu_bar_lines, x_set_tool_bar_lines): Calculate pixelwise. (x_set_scroll_bar_default_width): Default actual width to 16. (Fx_create_frame): Set sizes pixelwise. (x_create_tip_frame): Default divider widths to zero. Pixelize call of change_frame_size. (Fx_show_tip): Handle divider widths. Initial pixel position and sizes. (frame_parm_handler x_frame_parm_handlers): Add divider widths. (Vx_window_vertical_drag_shape): New option. * xmenu.c (free_frame_menubar): Pixelize call of x_set_window_size. * xterm.c (x_draw_window_divider): New function. (x_update_window_end): Optionally draw right divider. (x_draw_fringe_bitmap, x_scroll_run, x_scroll_bar_create) (XTset_vertical_scroll_bar): Use scroll bar pixel width. (handle_one_xevent, x_new_font): Calculate pixelwise. (x_set_window_size_1, x_set_window_size): New argument pixelwise. Calculate pixelwise. (x_wm_set_size_hint): Pixelize call of check_frame_size. (struct x_redisplay_interface): Add x_draw_window_divider. * xterm.h (struct x_output): Add vertical_drag_cursor. * cus-start.el (frame-resize-pixelwise) (window-resize-pixelwise): New entries. * emacs-lisp/debug.el (debug): Use window-total-height instead of window-total-size. * frame.el (tool-bar-lines-needed): Defalias to tool-bar-height. * help.el (describe-bindings-internal): Call help-buffer (temp-buffer-max-width): New option. (resize-temp-buffer-window, help-window-setup) (with-help-window): Rewrite. * mouse.el (mouse-drag-line): Rewrite. Add key bindings for dragging dividers. * window.el (frame-char-size, window-min-pixel-height) (window-safe-min-pixel-height, window-safe-min-pixel-width) (window-min-pixel-width, window-safe-min-pixel-size) (window-combination-p, window-safe-min-size) (window-resizable-p, window--size-to-pixel) (window--pixel-to-size, window--resize-apply-p): New functions. (window-safe-min-height): Fix doc-string. (window-size, window-min-size, window--min-size-1) (window-sizable, window-sizable-p, window--min-delta-1) (window-min-delta, window--max-delta-1, window-max-delta) (window--resizable, window--resizable-p, window-resizable) (window-full-height-p, window-full-width-p, window-at-side-p) (window--in-direction-2, window-in-direction) (window--resize-reset-1, window--resize-mini-window) (window-resize, window-resize-no-error) (window--resize-child-windows-normal) (window--resize-child-windows, window--resize-siblings) (window--resize-this-window, window--resize-root-window) (window--resize-root-window-vertically) (adjust-window-trailing-edge, enlarge-window, shrink-window) (maximize-window, minimize-window, delete-window) (quit-restore-window, window-split-min-size, split-window) (balance-windows-2, balance-windows) (balance-windows-area-adjust, balance-windows-area) (window--state-get-1, window-state-get, window--state-put-1) (window--state-put-2, window-state-put) (display-buffer-record-window, window--display-buffer): Make functions handle pixelwise sizing of windows. (display-buffer--action-function-custom-type) (display-buffer-fallback-action): Add display-buffer-in-previous-window. (display-buffer-use-some-window): Resize window to height it had before. (fit-window-to-buffer-horizontally): New option. (fit-frame-to-buffer): Describe new values. (fit-frame-to-buffer-bottom-margin): Replace with fit-frame-to-buffer-margins. (window--sanitize-margin): New function. (fit-frame-to-buffer, fit-window-to-buffer): Rewrite completely using window-text-pixel-size.
* Fix minor problems found by static checking.Paul Eggert2013-11-281-22/+22
| | | | | | | | | | | * buffer.h (struct buffer_text, struct buffer): * frame.h (struct frame): * window.h (struct window): Avoid 'bool foo : 1;', as it's not portable to pre-C99 compilers, as described in ../lib/stdbool.in.h. Use 'unsigned foo : 1;' instead. * menu.c (syms_of_menu): Define x-popup-dialog, removing a no-longer-valid use of HAVE_MENUS. * xdisp.c (propagate_buffer_redisplay): Now static.
* Refine redisplay optimizations to only redisplay *some* frames/windowsStefan Monnier2013-11-281-52/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rather than all of them. * src/xdisp.c (REDISPLAY_SOME): New constant. (redisplay_other_windows, wset_redisplay, fset_redisplay) (bset_redisplay, bset_update_mode_line): New functions. (message_dolog): Use bset_redisplay. (clear_garbaged_frames): Use fset_redisplay. (echo_area_display): Use wset_redisplay. (buffer_shared_and_changed): Remove. (prepare_menu_bars): Call Vpre_redisplay_function before updating frame titles. Compute the actual set of windows redisplayed. Don't update frame titles and menu bars for frames that don't need to be redisplayed. (propagate_buffer_redisplay): New function. (AINC): New macro. (redisplay_internal): Use it. Be more selective in the set of windows we redisplay. Propagate windows_or_buffers_changed to update_mode_lines a bit later to simplify the code. (mark_window_display_accurate_1): Reset window and buffer's `redisplay' flag. (redisplay_window): Do nothing if neither the window nor the buffer nor the frame needs redisplay. * src/window.h (struct window): Add `redisplay' field. (wset_redisplay, fset_redisplay, bset_redisplay, bset_update_mode_line) (redisplay_other_windows, window_list): New declarations. * src/window.c (select_window, Fset_window_start): Use wset_redisplay. (window_list): Not static any more. (grow_mini_window, shrink_mini_window): Use fset_redisplay. * src/minibuf.c (read_minibuf_unwind): Don't redisplay everything. * src/insdel.c (prepare_to_modify_buffer_1): Use bset_redisplay. * src/frame.c (Fmake_frame_visible): Don't redisplay everything. * src/frame.h (struct frame): Add `redisplay' field. Move `external_menu_bar' bitfield next to other bit-fields. (SET_FRAME_GARBAGED): Use fset_redisplay. (SET_FRAME_VISIBLE): Don't garbage the frame; Use redisplay_other_windows. * src/buffer.h (struct buffer): Add `redisplay' field. * src/buffer.c (Fforce_mode_line_update): Pay attention to the `all' flag. (modify_overlay): Use bset_redisplay. * src/alloc.c (gc_sweep): Don't unmark strings while sweeping symbols. * lisp/doc-view.el (doc-view-goto-page): Update mode-line.
* Support menus on text-mode terminals.Eli Zaretskii2013-10-081-3/+0
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | src/xterm.h (xw_popup_dialog): Add prototype. src/xmenu.c (Fx_popup_dialog): Function moved to menu.c. (xmenu_show): Block input here, instead in Fx_popup_menu. (xw_popup_dialog): New function, with X-specific bits of popup dialogs. src/xdisp.c (deep_copy_glyph_row, display_tty_menu_item): New functions. src/window.c (Fset_window_configuration): Use run-time tests of the frame type instead of compile-time conditionals, when menu-bar lines are considered. src/w32term.h (w32con_hide_cursor, w32con_show_cursor) (w32_popup_dialog): New prototypes. src/w32menu.c (Fx_popup_dialog): Function deleted. (w32_popup_dialog): New function, with w32 specific bits of popup dialogs. Block input here. src/w32inevt.c (w32_console_read_socket): Minor change to add debugging TTY events. src/w32fns.c (show_hourglass): If returning early because the frame is not a GUI frame, unblock input. src/w32console.c (w32con_hide_cursor, w32con_show_cursor, cursorX) (cursorY): New functions. src/termhooks.h (cursorX, cursorY): Prototypes of functions on WINDOWSNT, macros that call curX and curY elsewhere. src/termchar.h (struct tty_display_info) <showing_menu>: New flag. src/term.c (tty_hide_cursor, tty_show_cursor) [WINDOWSNT]: Call w32 specific function to hide and show cursor on a text-mode terminal. (tty_menu_struct, struct tty_menu_state): New structures. (tty_menu_create, tty_menu_make_room, tty_menu_search_pane) (tty_menu_calc_size, mouse_get_xy, tty_menu_display) (have_menus_p, tty_menu_add_pane, tty_menu_add_selection) (tty_menu_locate, save_and_enable_current_matrix) (restore_desired_matrix, screen_update, read_menu_input) (tty_menu_activate, tty_menu_destroy, tty_menu_help_callback) (tty_pop_down_menu, tty_menu_last_menubar_item) (tty_menu_new_item_coords, tty_menu_show): New functions. (syms_of_term): New DEFSYMs for tty-menu-* symbols. src/nsterm.h (ns_popup_dialog): Adjust prototype. src/nsmenu.m (ns_menu_show): Block and unblock input here, instead of in x-popup-menu. (ns_popup_dialog): Adapt order of arguments to the other *_menu_show implementations. (Fx_popup_dialog): Function deleted. src/msdos.c (x_set_menu_bar_lines): Delete unused function. src/menu.h (tty_menu_show, menu_item_width): provide prototypes. src/menu.c (have_boxes): New function. (single_keymap_panes): Use it instead of a compile-time conditional. (single_menu_item): Use run-time tests of the frame type instead of compile-time conditionals. (encode_menu_string): New function. (list_of_items, list_of_panes): Use it instead of ENCODE_STRING the macro, since different types of frame need different encoding of menu items. (digest_single_submenu): Use run-time tests of frame type instead of, or in addition to, compile-time conditionals. (menu_item_width, Fmenu_bar_menu_at_x_y): New functions. (Fx_popup_menu): Detect when the function is called from keyboard on a TTY. Don't barf when invoked on a text-mode frame. Check frame type at run time, instead of compile-time conditionals for invoking terminal-specific menu-show functions. Call tty_menu_show on text-mode frames. (Fx_popup_dialog): Moved here from xmenu.c. Test frame types at run time to determine which alternative to invoke; support dialogs on TTYs. src/keyboard.h <Qmouse_movement>: Declare. src/keyboard.c <Qmouse_movement>: Now extern. <Qecho_keystrokes>: New static variable. (read_key_sequence): Accept an additional argument, a flag to prevent redisplay during reading of the key sequence. All callers changed. (read_menu_command): New function. (read_char): When COMMANDFLAG is -2, do not redisplay and do not autosave. (toolkit_menubar_in_use): New function. (make_lispy_event): Use it instead of a compile-time test. src/fns.c (Fyes_or_no_p) [HAVE_MENUS]: Don't condition on window-system being available. src/editfns.c (Fmessage_box) [HAVE_MENUS]: Don't condition the call to x-popup-dialog on the frame type, they all now support popup dialogs. src/dispnew.c (save_current_matrix): Save the margin areas. (restore_current_matrix): Restore margin areas. (update_frame_with_menu): New function. src/dispextern.h (display_tty_menu_item, update_frame_with_menu): Add prototypes. src/alloc.c (make_save_ptr): Now compiled unconditionally. lisp/tmm.el (tmm-menubar): Adapt doc string to TTY menus functionality. lisp/tooltip.el (tooltip-mode): Don't error out on TTYs. lisp/menu-bar.el (popup-menu, popup-menu-normalize-position): Moved here from mouse.el. (popup-menu): Support menu-bar navigation on TTYs using C-f/C-b and arrow keys. (tty-menu-navigation-map): New map for TTY menu navigation. lisp/loadup.el ("tooltip"): Load even if x-show-tip is not available. lisp/frame.el (display-mouse-p): Report text-mode mouse as available on w32. (display-popup-menus-p): Report availability if mouse is available; don't condition on window-system. lisp/faces.el (tty-menu-enabled-face, tty-menu-disabled-face) (tty-menu-selected-face): New faces. configure.ac (HAVE_MENUS): Define unconditionally. doc/emacs/screen.texi (Menu Bar): Adapt to TTY menus. doc/emacs/frames.texi (Frames): Mention menu support on text terminals. doc/emacs/files.texi (Visiting): Mention the "File" menu-bar menu. doc/emacs/display.texi (Standard Faces): Mention TTY faces for menus. doc/lispref/keymaps.texi (Defining Menus, Mouse Menus, Menu Bar): Modify wording to the effect that menus are supported on TTYs. doc/lisprefframes.texi (Pop-Up Menus, Dialog Boxes) (Display Feature Testing): Update for menu support on TTYs. etc/NEWS: Mention the new features.
| * Fix message-box and avoid compilation warnings.Eli Zaretskii2013-09-301-3/+0
| |
* | * frame.h (struct frame): Drop has_minibuffer member because...Dmitry Antipov2013-10-021-7/+5
|/ | | | | (FRAME_HAS_MINIBUF_P): ...this macro can be implemented without it. * frame.c (make_frame, make_minibuffer_frame): Adjust users.
* * dispnew.c (frame_garbaged, selected_frame, last_nonminibuf_frame):Dmitry Antipov2013-09-231-6/+1
| | | | | | | | | | | Move to... * frame.c (frame_garbaged, selected_frame, last_nonminibuf_frame): ...this file and convert the latter to static. Adjust comment. (make_initial_frame): * window.c (init_window_once): Adjust user. * frame.h (last_nonminibuf_frame): Remove declaration. * lisp.h (selected_frame): Likewise. * msdos.c (the_only_display_info): Adjust comment.
* A simpler, centralized INLINE.Paul Eggert2013-09-201-27/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib-src/profile.c (INLINE): New macro. (SYSTIME_INLINE): Remove. * src/conf_post.h (INLINE): Define only if not already defined. This allows us to use a single INLINE, defined by one file per executable. * src/emacs.c (INLINE): Define it. Also, include category.h, charset.h, composite.h, dispextern.h, syntax.h, systime.h, so that their INLINE definitions are expanded properly for Emacs. * src/blockinput.h, src/keyboard.c (BLOCKINPUT_INLINE): * src/buffer.h, src/buffer.c (BUFFER_INLINE): * src/category.h, src/category.c (CATEGORY_INLINE): * src/character.h, src/character.c (CHARACTER_INLINE): * src/charset.h, src/charset.c (CHARSET_INLINE): * src/composite.h, src/composite.c (COMPOSITE_INLINE): * src/dispextern.h, src/dispnew.c (DISPEXTERN_INLINE): * src/frame.h, src/frame.c (FRAME_INLINE): * src/intervals.h, src/intervals.c (INTERVALS_INLINE): * src/keyboard.h, src/keyboard.c (KEYBOARD_INLINE): * src/lisp.h, src/alloc.c (LISP_INLINE): * src/process.h, src/process.c (PROCESS_INLINE): * src/syntax.h, src/syntax.c (SYNTAX_INLINE): * src/systime.h, src/sysdep.c (SYSTIME_INLINE): * src/termhooks.h, src/terminal.h (TERMHOOKS_INLINE): * src/window.h, src/window.c (WINDOW_INLINE): Remove. All uses replaced with INLINE.
* * frame.h (x_set_bitmap_icon) [!HAVE_NS]: New function.Dmitry Antipov2013-09-171-4/+17
| | | | | | | | | (x_icon_type): Remove prototype. (x_bitmap_icon) [!HAVE_NS]: Declare as such. * frame.c (x_icon_type): Remove. * w32term.c (x_make_frame_visible, x_iconify_frame): * xterm.c (x_make_frame_visible, x_iconify_frame): Use x_set_bitmap_icon to factor out common code.
* Fix X event waiting to handle multiple frames.Dmitry Antipov2013-09-161-0/+5
| | | | | | | | | * frame.h (struct frame) [HAVE_X_WINDOWS]: New member wait_event_type. * xterm.c (pending_event_wait): Remove. Adjust users. (x_detect_focus_change): Pass frame arg. (handle_one_xevent): Find related frame early and clear per-frame wait_event_type only if this is an event for the relevant frame. (x_wait_for_event): Use per-frame wait_event_type.
* * frame.h (FRAME_SMALLEST_CHAR_WIDTH, FRAME_SMALLEST_FONT_HEIGHT):Dmitry Antipov2013-09-151-0/+9
| | | | | Define once here... * nsterm.h, w32term.h, xterm.h: ...and not here.
* Unify Fx_focus_frame between all ports.Dmitry Antipov2013-09-131-0/+1
| | | | | | | | | | | | | | | | | | | | * src/frame.h (x_focus_frame): New prototype. * src/xfns.c (Fx_focus_frame): Remove. (syms_of_xfns): Do not defsubr it. (x_focus_frame): X implementation. * src/nsfns.m (Fx_focus_frame): Remove. (syms_of_nsfns): Do not defsubr it. (x_focus_frame): NS implementation. * src/w32term.c (Fx_focus_frame): Remove. (x_focus_on_frame): Rename to... (x_focus_frame): W32 implementation. * src/w32term.h (x_focus_on_frame): Remove prototype. * src/w32fns.c (Fx_focus_frame): Remove. (syms_of_w32fns): Do not defsubr it. * src/frame.c (Fx_focus_frame): Define here. (syms_of_frame): Defsubr here. * src/gtkutil.c (xg_tool_bar_callback): Use x_focus_frame. * lisp/frame.el (x-focus-frame): Mark as declared in frame.c.
* Unify FRAME_window_system_DISPLAY_INFO macros between all ports.Dmitry Antipov2013-09-131-32/+20
| | | | | | | | | | | | | | | | All of them are replaced with FRAME_DISPLAY_INFO, defined in each port to reference the port-specific window system data. * msdos.h (FRAME_X_DISPLAY_INFO): Remove. (FRAME_DISPLAY_INFO): Define. * w32term.h (FRAME_W32_DISPLAY_INFO, FRAME_X_DISPLAY_INFO): Remove. (FRAME_DISPLAY_INFO): Define. Adjust users. * xterm.h (FRAME_X_DISPLAY_INFO): Remove. (FRAME_DISPLAY_INFO): Define. Adjust users. * frame.h (FRAME_RES_X, FRAME_RES_Y): Unify. * font.c, frame.c, gtkutil.c, image.c, menu.c, msdos.c, nsfns.m: * nsfont.m, nsterm.m, w32fns.c, w32font.c, w32menu.c, w32term.c: * w32xfns.c, widget.c, xdisp.c, xfaces.c, xfns.c, xfont.c, xmenu.c: * xselect.c, xterm.c: All related users changed.
* Ifdef away frame tool bar code when it is not really used.Dmitry Antipov2013-09-111-14/+20
| | | | | | | | | | | | | | | | | | | | | | * frame.h (struct frame) [HAVE_WINDOW_SYSTEM && !USE_GTK && !HAVE_NS]: Move tool_bar_window, desired_tool_bar_string, current_tool_bar_string and minimize_tool_bar_window_p under the above. (fset_current_tool_bar_string, fset_desired_tool_bar_string) (fset_tool_bar_window): Likewise. * dispnew.c (clear_current_matrices, clear_desired_matrices) (adjust_frame_glyphs_for_window_redisplay, free_glyphs, update_frame) (change_frame_size_1): * window.c (window_from_coordinates, Frecenter): Adjust users. * window.h (WINDOW_TOOL_BAR_P): Define to zero when frame tool bar code is not really used. * xdisp.c (build_desired_tool_bar_string, display_tool_bar_line) (tool_bar_lines_needed, MAX_FRAME_TOOL_BAR_HEIGHT, tool_bar_item_info) (get_tool_bar_item, handle_tool_bar_click, note_tool_bar_highlight) [!USE_GTK && !HAVE_NS]: Define as such. (Ftool_bar_lines_needed, redisplay_tool_bar, show_mouse_face) (note_mouse_highlight, expose_frame): * xfns.c (x_set_tool_bar_lines): * xterm.c (handle_one_xevent): Adjust users.
* Review and drop old frame resize hack.Dmitry Antipov2013-09-091-4/+0
| | | | | | | | | | * frame.h (struct frame): Remove force_flush_display_p. * dispnew.c (update_frame): Adjust user and don't call flush_frame here. The comment has said that there was an issues with redisplaying fringes, but I don't see any differences with and without this hack. Hopefully we can continue without it. * xdisp.c (clear_garbaged_frames): Adjust user and do not clear current frame matrices twice if resized_p is set.
* Do not populate pure Xism x_sync to other ports.Dmitry Antipov2013-09-091-2/+2
| | | | | | | * frame.h (x_sync): Move under HAVE_X_WINDOWS. * frame.c (other_visible_frames) [HAVE_X_WINDOWS]: Use as such. * nsfns.m, w32xfns.c (x_sync): Remove no-op. * w32term.h (x_sync): Remove prototype.
* Cleanup frame flushing.Dmitry Antipov2013-09-091-0/+10
| | | | | | | | | | | | | | | | | | | | * dispextern.h (struct redisplay_interface): Drop flush_display_optional because flush_display is enough for X and flushing via RIF is just a no-op for others. * frame.h (flush_frame): New function. * dispnew.c (update_frame): * minibuf.c (read_minibuf): * xdisp.c (echo_area_display, redisplay_preserve_echo_area): Use it. * keyboard.c (detect_input_pending_run_timers): Do not flush all frames but selected one in redisplay_preserve_echo_area. * nsterm.m (ns_flush): Remove no-op. (ns_redisplay_interface): Adjust user. * w32term.h (x_flush): Remove no-op. (w32_redisplay_interface): Adjust user. * xterm.c (x_flush): Simplify because we do not flush all frames at once any more. Adjust comment. (x_redisplay_interface): Adjust user.
* Attempt to make redisplay more selective when changing cursor type.Dmitry Antipov2013-09-061-0/+3
| | | | | | | | | | | | * frame.h (struct frame): New bitfield cursor_type_changed. * xdisp.c (cursor_type_changed): Remove. (try_cursor_movement, redisplay_window, try_window_id) (set_frame_cursor_types, try_window_reusing_current_matrix): Adjust to use per-frame bitfield. (redisplay_internal): Look for cursor type change on each visible frame and consider all frames if cursor type has been changed on the frame other than selected. If cursor type has been changed on selected frame only, do not use fast update.
* Attempt to make redisplay more selective when changing fonts.Dmitry Antipov2013-09-061-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * frame.h (struct frame): New bitfield fonts_changed. * dispextern.h (fonts_changed_p, adjust_glyphs): Remove declaration. (adjust_frame_glyphs): Add prototype. * dispnew.c (fonts_changed_p): Remove. (adjust_glyphs): Remove becase we do not adjust matrices on all frames at once any more. (adjust_frame_glyphs): Block and unblock input here. (adjust_glyph_matrix): Use fonts_changed. (change_frame_size_1): Use adjust_frame_glyphs. * font.c (font_open_entity): Use fonts_changed. * frame.c (set_menu_bar_lines, Fmake_terminal_frame): * w32fns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_show_tip): * window.c (Fdelete_other_windows_internal, Fwindow_resize_apply) (Fsplit_window_internal, Fdelete_window_internal, grow_mini_window) (shrink_mini_window, Fresize_mini_window_internal) (window_scroll_pixel_based, Fset_window_configuration) (apply_window_adjustment, Fset_window_vscroll): * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_show_tip): Use adjust_frame_glyphs. * xdisp.c (redisplay_tool_bar, redisplay_window, try_window) (try_window_reusing_current_matrix, try_window_id, display_line) (IT_EXPAND_MATRIX_WIDTH): Use fonts_changed. (redisplay_internal): Consider fonts_changed and adjust frame matrices for each frame only if the frame is visible. If font has been changed on some frame during full redisplay, retry only visible frames where the font has been actually changed.
* Minor cleanup to avoid forward declarations.Dmitry Antipov2013-08-301-23/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | * coding.h (struct ccl_spec): Remove forward declaration. * composite.h (toplevel): Include font.h. (struct composition_it, struct face, struct font_metrics): Remove forward declaration. * dispextern.h (struct image, struct atimer): Likewise. * emacsgtkfixed.h (struct frame): Likewise. * emacsgtkfixed.c (toplevel): Reorder headers and drop stdio.h. * font.h (struct font_driver, struct font, struct glyph_string) (struct face): Remove forward declaration. * fontset.h (struct face, struct font): Likewise. * frame.h (toplevel): Style cleanup. (enum output_method): Move to... * termhooks.h (enum output_method): ...here. (struct glyph, struct frame, struct ns_display_info) (struct x_display_info, struct w32_display_info): Remove forward declaration. * xterm.h (toplevel): Include termhooks.h. (struct font, struct window, struct glyph_matrix, struct frame) (struct input_event, struct face, struct image): Remove forward declaration. * gtkutil.h (struct _widget_value): Likewise. * keyboard.h (toplevel): Include termhooks.h. (struct input_event): Remove forward declaration.
* Minor cleanup for redisplay interface and few related functions.Dmitry Antipov2013-08-231-10/+0
| | | | | | | | | | | | | | | * frame.h (enum text_cursor_kinds): Move from here... * dispextern.h (enum text_cursor_kinds): ...to here. (toplevel): Drop unnecessary declarations. (struct redisplay_interface): Use bool and enum text_cursor_kinds in update_window_end_hook and draw_window_cursor functions. (display_and_set_cursor, x_update_cursor): Adjust prototypes. * nsterm.m (ns_update_window_end, ns_draw_window_cursor): * w32term.c (x_update_window_end,w32_draw_window_cursor): * xterm.c (x_update_window_end, x_draw_window_cursor): * xdisp.c (display_and_set_cursor, update_window_cursor) (update_cursor_in_window_tree, x_update_cursor): Use bool and enum text_cursor_kinds where appropriate.
* Avoid looping over all frame windows to freeze and unfreeze.Dmitry Antipov2013-08-121-0/+8
| | | | | | | | | | | | | * window.h (struct window): Drop frozen_window_start_p. (freeze_window_starts): Drop prototype. * frame.h (struct frame): New frozen_window_starts flag. (FRAME_WINDOWS_FROZEN): New macro. * window.c (freeze_window_start, freeze_window_starts): Remove. (select_window, replace_window): Adjust users. * xdisp.c (resize_mini_window): Use FRAME_WINDOWS_FROZEN. (window_frozen_p): New function. (redisplay_window): Use it.
* Drop FRAME_PTR typedef.Dmitry Antipov2013-08-031-3/+1
| | | | | | | | | | | * composite.c, font.c, font.h, fontset.c, fontset.h, frame.c, frame.h: * ftfont.c, ftxfont.c, gtkutil.c, gtkutil.h, image.c, keyboard.c: * menu.c, menu.h, msdos.c, nsfns.m, nsfont.m, nsmenu.m, nsterm.h: * nsterm.m, scroll.c, term.c, w32fns.c, w32font.c, w32font.h: * w32inevt.c, w32inevt.h, w32menu.c, w32notify.c, w32term.c, w32term.h: * w32uniscribe.c, w32xfns.c, widget.c, window.c, xdisp.c, xfaces.c: * xfns.c, xfont.c, xftfont.c, xmenu.c, xselect.c, xterm.c: All related users changed.
* * frame.h (FRAME_MOUSE_UPDATE):Dmitry Antipov2013-08-011-4/+3
| | | | | * nsterm.m (ns_frame_up_to_date): Omit redundant check whether hlinfo->mouse_face_mouse_frame is non-NULL.
* Do not use pure Xism x_wm_set_icon_position in non-X ports.Dmitry Antipov2013-08-011-2/+4
| | | | | | | | | * frame.c (x_set_frame_parameters): Call to x_wm_set_icon_position only if HAVE_X_WINDOWS is in use. * frame.h (x_set_frame_parameters): Move under HAVE_X_WINDOWS. * nsterm.m (x_wm_set_icon_position): Remove no-op. * w32term.c (x_wm_set_icon_position): Likewise. * w32fns.c (x_icon): Adjust user.
* Drop unnecessary functions that deals with frame pixel size.Dmitry Antipov2013-07-311-2/+0
| | | | | | | | | | | | * frame.h, msdos.h, w32term.h, xterm.h (x_pixel_width) (x_pixel_height): Drop prototypes. * msdos.c, nsfns.m, w32fns.c, xfns.c (x_pixel_width) (x_pixel_height): Drop implementations. * frame.c (Fframe_pixel_height): Use FRAME_PIXEL_HEIGHT which should be always valid for window frame. (Frame_pixel_width): Likewise with FRAME_PIXEL_WIDTH. * w32menu.c (Fx_popup_dialog): * xmenu.c (Fx_popup_dialog): Likewise for both.
* * frame.c (make_frame, x_set_frame_parameters): Use bool for boolean.Dmitry Antipov2013-07-311-3/+3
| | | | | | | | | | | (x_figure_window_size): Likewise. Adjust to return long. (syms_of_frame): Do not DEFSYM Qterminal_live_p. (toplevel): Move Qterminal_live_p to... * terminal.c (toplevel): ...here, make it static, and... (syms_of_terminal): ...DEFSYM here. * frame.h (Qterminal_live_p): Remove declaration. (make_frame, x_figure_window_size): Adjust prototype. * nsfns.m (Fx_create_frame): Use long for window flags.
* Fix minor problems found by static checking.Paul Eggert2013-06-031-2/+0
| | | | | | | | | | | | | | | | | | | | | * data.c (pure_write_error): Use xsignal2, not Fsignal, as Fsignal might return. * eval.c (set_backtrace_debug_on_exit): Now static. (backtrace_p, backtrace_top, backtrace_next, record_in_backtrace): No longer inline. EXTERN_INLINE is needed only for functions defined in .h files. Reindent function header as per GNU style. (backtrace_p, backtrace_top, backtrace_next): Mark EXTERNALLY_VISIBLE so they don't get optimized away by the compiler or linker. Add extern decls to pacify gcc -Wall. * frame.c, frame.h (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Now static. * frame.c (free_monitors): Define only on platforms that need it. * nsterm.m (ns_term_init): * process.c (catch_child_signal): Don't worry about whether SIGCHLD is defined, as SIGCHLD is defined on all porting targets these days. * process.c, process.h (catch_child_signal): Make it extern only if NS_IMPL_GNUSTEP is defined.
* Factor out common code for multimonitors, for Gtk+, non-Gtk+ X11 and NS.Jan Djärv2013-05-251-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | * frame.c (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): New Lisp_Object:s. (free_monitors, make_monitor_attribute_list): New functions. (syms_of_frame): DEFSYM Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource. * frame.h (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Declare. (struct MonitorInfo): New struct. (free_monitors, make_monitor_attribute_list): Declare. * nsfns.m (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Remove. (struct MonitorInfo, free_monitors): Remove. (ns_screen_name): Make static. (ns_make_monitor_attribute_list): Call make_monitor_attribute_list. (syms_of_nsfns): Remove DEFSYM for Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource. * xfns.c (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Remove. (struct MonitorInfo, free_monitors): Remove. (x_make_monitor_attribute_list): Call make_monitor_attribute_list. (Fx_display_monitor_attributes_list): Call make_monitor_attribute_list. (syms_of_xfns): Remove DEFSYM for Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource.
* More debugging code to investigate bug #14062.Eli Zaretskii2013-04-151-1/+1
| | | | | | | | | | | src/w32fns.c (w32_wnd_proc): Add more assertions to investigate bug#14062. src/frame.h (WINDOW_FRAME): Protect macro and its argument with parentheses. src/dispextern.h (CURRENT_MODE_LINE_HEIGHT) (CURRENT_HEADER_LINE_HEIGHT, WINDOW_WANTS_MODELINE_P) (WINDOW_WANTS_HEADER_LINE_P): Protect macro arguments with parentheses where appropriate.
* Get rid of some platform-specific functions examining windowDmitry Antipov2013-04-071-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | system and its capabilities. This is a partial rework of the 2013-04-05 change. * lisp.h (have_menus_p): Remove prototype. This function is replaced with platform-independent window_system_available. (check_window_system): Move to... * frame.h (decode_window_system_frame, window_system_available): ...here, add new prototypes. * frame.c (window_system_available, decode_window_system_frame): New functions. (check_window_system): Platform-independent now. * xterm.h (x_in_use): Remove declaration. (check_x_frame): * w32term.h (check_x_frame): * nsterm.h (check_x_frame): Remove prototypes. This function is replaced with platform-independent decode_window_system_frame. * msdos.c (have_menus_p): Remove. * nsfns.m (check_window_system, have_menus_p, check_ns_frame): Remove platform-specific functions. Use check_window_system, decode_window_system_frame and check_ns_display_info where appropriate. Minor style and comment tweaks. * w32fns.c (w32_in_use, check_window_system, have_menus_p) (check_x_frame): Likewise. * xfns.c (x_in_use, check_window_system, have_menus_p, check_x_frame): Likewise. * fileio.c, fns.c, font.c, fontset.c, image.c, menu.c, nsmenu.m: * nsselect.m, nsterm.m, w32font.c, w32menu.c, xfaces.c, xgselect.c: * xmenu.c, xselect.c: All related users changed.
* * frame.h (struct frame): Drop scroll_bottom_vposDmitry Antipov2013-03-311-5/+0
| | | | | | member becaue all real users are dead long ago. (FRAME_SCROLL_BOTTOM_VPOS): Remove. * xdisp.c (redisplay_internal): Adjust user.
* * frame.h (struct frame): Put menu_bar_window under #ifdefDmitry Antipov2013-03-221-0/+4
| | | | | | | | | | | because this member is not needed when X toolkit is in use. (fset_menu_bar_window): * dispnew.c (clear_current_matrices, clear_desired_matrices) (free_glyphs, update_frame): * xdisp.c (expose_frame): Likewise. (display_menu_bar): Likewise. Remove redundant eassert. * window.h (WINDOW_MENU_BAR_P): Always define to 0 if X toolkit is in use.
* * frame.h (struct frame): Drop resx and resy because the same data isDmitry Antipov2013-03-201-3/+51
| | | | | | | | | | | | | | | available from window system-specific output context. Adjust users. (default_pixesls_per_inch_x, default_pixesls_per_inch_y): New functions to provide defaults when no window system available. (FRAME_RES_X, FRAME_RES_Y): New macros. (NUMVAL): Moved from xdisp.c. * font.c (font_pixel_size, font_find_for_lface, font_open_for_lface) (Ffont_face_attributes, Fopen_font): * image.c (gs_load): * w32font.c (fill_in_logfont): * xdisp.c (calc_pixel_width_or_height): * xfaces.c (Fx_family_fonts, set_lface_from_font): Use them. * xsettings.c (apply_xft_settings): Drop frame loop and adjust comment.
* Drop async_visible and async_iconified fields of struct frame.Dmitry Antipov2013-01-241-65/+29
| | | | | | | | | | | | | | | | | | | | This is possible because async input is gone; for details, see http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00734.html. * frame.h (struct frame): Remove async_visible and async_iconified members, convert garbaged to unsigned bitfield. Adjust comments. (FRAME_SAMPLE_VISIBILITY): Remove. Adjust all users. (SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED): New macros. * frame.c, gtkutil.c, term.c, w32fns.c, window.c, xdisp.c: Consistently use SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED, FRAME_VISIBLE_P and FRAME_ICONIFIED_P macros where appropriate. * w32term.c: Ditto. (w32_read_socket): Save iconified state to generate DEICONIFY_EVENT properly. Likewise for obscured. * xterm.c: Ditto. (handle_one_xevent): Save visible state go generate ICONIFY_EVENT properly. * nsterm.m: Ditto. (windowDidDeminiaturize): Generate DEICONIFY_EVENT.
* * src/xdisp.c (message2, message2_nolog): Remove functions.Stefan Monnier2013-01-231-7/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (message3, message3_nolog): Extract nbytes and multibyteness directly from the string. Change all callers. (message3_nolog): Don't set message_enable_multibyte since set_message will reset it anyway. (message1, message1_nolog): Use message3. (vmessage): Use a stack allocated buffer rather than f->message_buf. (with_echo_area_buffer): Remove last two arguments. Update all callers. (set_message): Drop all but the second arg, which has to be a string. (set_message_1): Simplify now that we know that a1 is NULL and the second arg is a string. * src/frame.h (struct frame): Remove `message_buf' field. Use glyphs_initialized_p instead. (FRAME_MESSAGE_BUF): Remove macro. * src/w16select.c (Fw16_set_clipboard_data): Prefer message3 to message2. * src/lisp.h (message2, message2_nolog): Remove declarations. (message3, message3_nolog): Update declarations. * src/keyboard.c (read_char_minibuf_menu_text) (read_char_minibuf_menu_width): Remove vars. (read_char_minibuf_menu_prompt): Rewrite the menu's construction so as to correctly handle multibyte strings. * src/frame.c (delete_frame): Don't free message_buf any more. * src/editfns.c (message_text, message_length): Remove vars. (Fmessage_box): Don't copy the Lisp string's bytes any longer. * src/fileio.c (auto_save_error): Use message3 instead of message2. * src/dispnew.c (adjust_frame_message_buffer): Remove function.
* Merge from emacs-24; up to 2012-12-06T01:39:03Z!monnier@iro.umontreal.caPaul Eggert2013-01-021-1/+1
|\
| * Update copyright notices for 2013.Paul Eggert2013-01-011-1/+1
| |
* | * keyboard.c (record_asynch_buffer_change): Initialize an eventDmitry Antipov2012-12-261-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | only if it's really needed. * frame.h (enum output_method): Remove output_mac member since it's a leftover from the deleted code. * frame.c (Fframep): Adjust user here ... * terminal.c (Fterminal_live_p): ... and here. * coding.c (Qmac): Now here because it's only used to denote end-of-line encoding type. (syms_of_coding): DEFSYM it. * frame.h (Qmac): Remove duplicated declaration.
* | * frame.h (x_char_width, x_char_height): Remove prototypes.Dmitry Antipov2012-12-061-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | * w32term.h (x_char_width, x_char_height): Likewise. * xfns.c (x_char_width, x_char_height): Remove. * w32fns.c (x_char_width, x_char_height): Likewise. * nsfns.c (x_char_width, x_char_height): Likewise. * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for all window frames. (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT. * keyboard.c (command_loop_1): Remove prototype. (command_loop_2, top_level_1): Add static to match prototype.
* | * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_stateDmitry Antipov2012-12-041-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | member. Adjust users. Convert mouse_face_past_end, mouse_face_defer and mouse_face_hidden members to a bitfields. * frame.h (struct frame): Remove set-but-not-used space_width member. (FRAME_SPACE_WIDTH): Remove. * nsterm.m, w32term.c, xterm.c: Adjust users. * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so member. Adjust users. Convert term_initted, delete_in_insert_mode, costs_set, insert_mode, standout_mode, cursor_hidden and flow_control members to a bitfields.
* | * frame.h (struct frame): Remove display_preempted memberDmitry Antipov2012-11-231-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | since all users are dead long ago. * nsterm.h (struct x_output): Use the only dummy member. * w32menu.c (pending_menu_activation): Remove since not really used. (set_frame_menubar): Adjust user. * w32term.h (struct x_output): Drop outdated #if 0 code. (struct w32_output): Use bitfields for explicit_parent, asked_for_visible and menubar_active members. Drop unused pending_menu_activation member. * xterm.h (struct x_output): Drop outdated #if 0 code. Use bitfields for explicit_parent, asked_for_visible, has_been_visible and net_wm_state_hidden_seen members.
* | * alloc.c (Fgarbage_collect): Unblock input after clearingDmitry Antipov2012-11-221-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | gc_in_progress to avoid note_mouse_highlight glitch with GC. * frame.h (FRAME_MOUSE_UPDATE): New macro. * msdos.c (IT_frame_up_to_date): Use it here... * w32term.c (w32_frame_up_to_date): ...here... * xterm.c (XTframe_up_to_date): ...and here... * nsterm.m (ns_frame_up_to_date): ...but not here. * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member. Adjust users. * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight): Do not check whether GC is in progress.
* | * frame.h (struct frame): Convert external_tool_bar member toDmitry Antipov2012-11-121-1/+1
| | | | | | | | | | | | 1-bit unsigned bitfield. * termhooks.h (struct terminal): Remove mouse_moved member since all users are long dead. Adjust comment on mouse_position_hook.