1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-16 09:50:25 +00:00
Commit Graph

42 Commits

Author SHA1 Message Date
Paul Eggert
8c1fe1e5ef Update copyright year to 2021
Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
2021-01-01 00:32:32 -08:00
Juri Linkov
6eb18a950d Move tab-bar and tab-line faces to faces.el (part of bug#41200)
These are basic faces, so they need to be defined in
faces.el, otherwise (get 'tab-line 'face) returns 0.

* lisp/faces.el (tab-bar, tab-line): Move faces here
from tab-bar.el and tab-line.el.

* lisp/tab-bar.el (tab-bar): Move face to faces.el.
(tab-bar-faces): Add '((tab-bar custom-face))
to the second arg MEMBERS of 'defgroup'.

* lisp/tab-line.el (tab-line): Move face to faces.el.
(tab-line-faces): Add '((tab-line custom-face))
to the second arg MEMBERS of 'defgroup'.
2020-06-08 03:21:42 +03:00
Juri Linkov
f0e1bf56f0 Fix bugs in tab-bar and tab-line and mention remaining features in manual.
* doc/emacs/frames.texi (Tab Bars): Mention tab-bar-new-tab-to,
tab-bar-close-last-tab-choice, tab-bar-close-tab-select, tab-undo,
tab-select, tab-bar-history-mode.

* doc/emacs/windows.texi (Tab Line): Mention tab-line-tabs-function.

* lisp/tab-bar.el (tab-bar-select-tab-modifiers): Mention
tab-bar-tab-hints in docstring.
(tab-bar-tab-hints): Mention tab-bar-select-tab-modifiers
in docstring.
(tab-bar-select-tab): Mention tab-bar-select-tab-modifiers
in docstring.
(tab-bar-switch-to-tab): Expand the docstring.
(tab-bar-new-tab-to): Fix bug in handling 'left' value.
(tab-bar-close-tab): Fix bug in handling 'left' value.
(tab-bar-undo-close-tab): Use funcall tab-bar-tabs-function
instead of direct call to tab-bar-tabs.
(tab-bar-history-back, tab-bar-history-forward): Add docstrings.
(tab-bar-history-mode): Expand docstring.

* lisp/tab-line.el (tab-line-format): Fix bug for handling window
switching that should set face 'tab-line-tab-current'.
2020-04-27 01:28:36 +03:00
Juri Linkov
7515252cce * lisp/tab-line.el (tab-line-new-button-show): New defcustom.
* lisp/tab-line.el (tab-line-format-template): Use tab-line-new-button-show.
(tab-line-new-tab-choice): Remove choice 'nil' with "No button".
(tab-line-separator): Add docstring.
2020-03-20 01:21:57 +02:00
Juri Linkov
a2dd8c4234 * lisp/tab-line.el: Fix tab-line-format and tab-line-format-template.
* lisp/tab-line.el (tab-line-format): Use buffer-name in the cache key
instead of just buffer object to invalidate the cache on buffer renaming.
(tab-line-format-template): Always leave the separator after the last tab
like tab-bar.el already does.
2020-03-17 01:11:27 +02:00
Juri Linkov
6b48aedb6b * lisp/tab-line.el: Fix auto-hscrolling (bug#39649)
Distinguish offsets between manual-vs-automatic scrolling
as integers-vs-floats instead of positive-vs-negative integers.

* lisp/tab-line.el (tab-line-format-template): Use 'numberp'
instead of 'integerp', and 'truncate' instead of 'abs'.
(tab-line-format): When the window-buffer was updated, set window-parameter
to float to enable auto-hscroll after it was disabled on manual scrolling.
(tab-line-auto-hscroll-buffer): New variable with internal buffer.
(tab-line-auto-hscroll): Erase in tab-line-auto-hscroll-buffer.
Use 'numberp' instead of 'integerp', 'truncate' instead of 'abs',
and 'float' instead of '-'.
(tab-line-hscroll): Use 'numberp' instead of 'integerp',
and 'truncate' instead of 'abs'.
2020-02-29 23:49:17 +02:00
Juri Linkov
ef5fba9f40 Fix faces tab-bar and tab-line.
* lisp/tab-bar.el (tab-bar) <defface>:
* lisp/tab-line.el (tab-line) <defface>:
Check for min-colors 88 instead of type x.
2020-02-05 01:27:30 +02:00
Juri Linkov
92f080dda8 Tab-bar related finishing touches.
* lisp/tab-bar.el (tab-bar-tab-name-ellipsis): Use shorter name
instead of tab-bar-tab-name-truncated-ellipsis.
(tab-bar-new-tab-to) <defcustom>: Add 'function' option.
(tab-bar-new-tab-to) <function>: Use it.

* lisp/tab-line.el (tab-line-close-tab): Add missing arg 'tab' to
tab-line-close-tab-function funcall.
2020-01-23 01:23:17 +02:00
Juri Linkov
3ba0db41e3 Allow optional truncation of tab names in tab-bar and tab-line (bug#38693)
* lisp/tab-line.el (tab-line-tab-name-truncated-max): New defcustom.
(tab-line-tab-name-truncated-buffer): Use tab-line-tab-name-truncated-max
consistently with similar options in tab-bar.el.
(tab-line-tabs-limit): Remove variable.
(tab-line-tabs-window-buffers): Remove use of tab-line-tabs-limit
that was an experimental feature before horizontal scrolling was implemented.
(tab-line-close-tab-function): Rename from tab-line-close-tab-action
and allow a customizaed function as option.
(tab-line-close-tab): Call function if tab-line-close-tab-function
is customized to a function.

* lisp/tab-bar.el (tab-bar-tab-name-function): Add option
tab-bar-tab-name-truncated.
(tab-bar-tab-name-truncated-max): New defcustom.
(tab-bar-tab-name-truncated-ellipsis): New variable.
(tab-bar-tab-name-truncated): New function.
2020-01-21 01:03:37 +02:00
Juri Linkov
92f30d62c0 * lisp/tab-line.el (tab-line-auto-hscroll): Fix for long tab names.
Check for nil value returned by previous-single-property-change that
happens when tab name is longer than window width.
2020-01-20 02:35:53 +02:00
Juri Linkov
d47b157969 Handle tab-bar clicks on a GPM-capable console.
* src/term.c (handle_one_term_event): Call tty_handle_tab_bar_click.

* src/xdisp.c (tty_handle_tab_bar_click): Force reset of up_modifier bit
from the event modifiers.

* lisp/tab-line.el (tab-line-tab-current): No need to use inverse-video
on console/xterm because the selected tab already uses inverse-video.
2020-01-13 01:23:12 +02:00
Paul Eggert
365e01cc9f Update copyright year to 2020
Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
2020-01-01 00:59:52 +00:00
Juri Linkov
1d52883047 * lisp/tab-line.el (tab-line-auto-hscroll): Improve.
Better handling of tabs scrolled to the left.
Don't scroll tabs that are already visible.

Remove setq of buffer-undo-list because undo is disabled
anyway in internal buffers with name " *temp*".
2019-12-16 01:14:02 +02:00
Juri Linkov
fe7ae74c0b * lisp/tab-line.el (tab-line-format): Use composite cache key (bug#38522) 2019-12-09 00:08:53 +02:00
Juri Linkov
bd95d66ae9 * lisp/tab-line.el: Cache the tab-line-format template.
(tab-line-format): Cache the result of tab-line-format-template in window.
(tab-line-format-template): New function that returns the value to cache.
2019-12-05 01:08:24 +02:00
Juri Linkov
dfbbbf319e * lisp/tab-line.el (tab-line-auto-hscroll): Don't let-bind buffer-local values
Use setq to set buffer-local values of truncate-lines and buffer-undo-list.
This will prevent leaking of let-bound values to buffer-local values
of the minibuffer.
2019-11-30 23:42:37 +02:00
Juri Linkov
da00577793 * lisp/tab-line.el (tab-line-auto-hscroll): New defcustom (bug#37667)
(tab-line-auto-hscroll): Use this option in the function.
2019-11-18 23:57:16 +02:00
Juri Linkov
a8f2ee424c Auto-scrolling in tab-line (bug#37667)
* lisp/tab-line.el (tab-line-auto-hscroll): New function.
(tab-line-format): Use tab-line-auto-hscroll.
2019-11-17 23:43:28 +02:00
Juri Linkov
ea73c66423 * lisp/tab-line.el (tab-line-tabs-buffer-list): Use window-prev-buffers too.
* lisp/tab-line.el (tab-line-tabs-buffer-list): Move window-prev-buffers here
from tab-line-tabs-buffer-groups.
2019-11-14 00:09:06 +02:00
Juri Linkov
0a492e4dfa * lisp/tab-line.el (tab-line-tabs-buffer-list-function): New variable.
(tab-line-tabs-buffer-list): New function.
(tab-line-tabs-mode-buffers, tab-line-tabs-buffer-groups):
Call tab-line-tabs-mode-buffers.
(tab-line-tabs-buffer-groups): Add 'close' function that uses
kill-buffer instead of bury-buffer that makes no sense here.
(tab-line-format): Don't show the close button when a tab
has no 'close' function or buffer.
(tab-line-switch-to-prev-tab, tab-line-switch-to-next-tab):
Support tabs with 'buffer' properties.
(tab-line-close-tab): Call 'close' function when defined.
2019-11-12 23:31:12 +02:00
Juri Linkov
f5f40af1da * lisp/tab-line.el: More configurability for tab buffer groups.
* lisp/tab-line.el (tab-line-tabs-buffer-group-function)
(tab-line-tabs-buffer-group-sort-function)
(tab-line-tabs-buffer-groups-sort-function): New defvars.
(tab-line-tabs-buffer-group-name): Rename from
tab-line-tabs-buffer-groups--name and use tab-line-tabs-buffer-group-function.
(tab-line-tabs-buffer-groups): Use tab-line-tabs-buffer-groups-sort-function
and tab-line-tabs-buffer-group-sort-function.
(tab-line-new-tab): Let bind tab-line-tabs-buffer-groups to
mouse-buffer-menu-mode-groups.
2019-11-07 00:59:28 +02:00
Juri Linkov
e4f49e87e7 * lisp/tab-line.el: New option for tabs where buffers are grouped by mode.
* lisp/tab-line.el (tab-line-tabs-function): Add option
tab-line-tabs-buffer-groups.
(tab-line-tabs-buffer-groups): New defvar defaulted to
mouse-buffer-menu-mode-groups.
(tab-line-tabs-buffer-groups--name, tab-line-tabs-buffer-groups):
New functions.
(tab-line-format): Support tabs in the format '(tab (name . "name") ...)'.
(tab-line-select-tab): Move part of code to tab-line-select-tab-buffer.
(tab-line-select-tab-buffer): New function.
(tab-line-tab-current): Rename from tab-line-tab-selected.
2019-11-06 01:21:57 +02:00
Juri Linkov
0b9dc0a8fe * lisp/tab-line.el (tab-line-tab-selected): New face.
(tab-line-format): Use new face tab-line-tab-selected.
([tab-line]): Move tab-switching mouse wheel commands to S-keys.
2019-11-02 23:39:15 +02:00
Juri Linkov
1660f5875c Customizable tab-line-tabs-function and new buffer-local tab-line-mode.
* lisp/tab-line.el (tab-line-tabs-function): Turn defvar into defcustom
with default of tab-line-tabs-window-buffers.
(tab-line-tabs-mode-buffers): New function.
(tab-line-tabs-window-buffers): Rename from tab-line-tabs.
(tab-line-select-tab, tab-line-switch-to-prev-tab)
(tab-line-switch-to-next-tab): Handle the value tab-line-tabs-window-buffers
of tab-line-tabs-function specially.
(tab-line-mode): Rename from global-tab-line-mode and change scope
to buffer-local.
(global-tab-line-mode): New globalized-minor-mode.
(tab-line-mode--turn-on): New function.
(tab-line-exclude-modes): New defcustom.
(tab-line-exclude): New buffer-local variable.
https://lists.gnu.org/archive/html/emacs-devel/2019-10/msg00988.html

* lisp/dired.el (dired-mark-pop-up): Set tab-line-exclude to nil.
Don't set tab-line-format.   (Bug#37699)
* lisp/speedbar.el (speedbar-mode): Set tab-line-exclude to nil.
Don't set tab-line-format.
2019-10-27 01:38:32 +03:00
Juri Linkov
095908aec4 Tab-line horizontal scrolling with UI buttons and commands (bug#37667)
* etc/images/tabs/left-arrow.xpm:
* etc/images/tabs/right-arrow.xpm: New images.

* lisp/tab-line.el (tab-line-left-map, tab-line-right-map): New keymaps.
(tab-line-left-button, tab-line-right-button): New variables.
(tab-line-tab-name-function): Turn defvar into defcustom.
(tab-line-tab-name-buffer): New function.
(tab-line-tab-name-truncated-buffer): Rename from tab-line-tab-name.
(tab-line-tabs-limit): Default to nil.
(tab-line-tabs): Behavior depends on tab-line-tabs-limit.
(tab-line-format): Use window-parameter tab-line-hscroll.
Add left/right buttons.
(tab-line-hscroll): New function.
(tab-line-hscroll-right, tab-line-hscroll-left): New commands
bound to mouse-wheel.  Rebind tab-switching commands to	mouse-wheel
with Ctrl-modifier.
2019-10-23 00:17:27 +03:00
Juri Linkov
30deac84c4 * lisp/tab-line.el: Bind mouse commands to [tab-line].
* lisp/tab-line.el: Bind mouse-4/mouse-5, wheel-up/wheel-down
globally to [tab-line].
(tab-line-tab-map): Remove local bindings of mouse-4/mouse-5.
(tab-line-new-tab, tab-line-switch-to-prev-tab)
(tab-line-switch-to-next-tab, tab-line-close-tab):
Turn commands into mouse-free (can be used without mouse).
2019-10-21 01:37:39 +03:00
Juri Linkov
ffa9054698 Don't use expand-file-name to find images for tabs.
* lisp/tab-bar.el (tab-bar-mode):
* lisp/tab-line.el (tab-line-new-button, tab-line-close-button):
Remove expand-file-name with data-directory.
2019-10-15 22:44:10 +03:00
Juri Linkov
cb29a38164 Set tab-line face height to 0.9.
* lisp/tab-line.el (tab-line): Set :height to 0.9.
* lisp/tab-bar.el (tab-bar): Remove :height.
2019-10-15 00:50:24 +03:00
Juri Linkov
674515dd75 Use variable-pitch fonts in tab-bar and tab-line faces
* lisp/tab-bar.el (tab-bar):
* lisp/tab-line.el (tab-line):
Inherit face from variable-pitch.
2019-10-14 23:07:23 +03:00
Juri Linkov
52ab948510 * lisp/tab-bar.el (tab-bar-show): New defcustom.
* lisp/tab-bar.el (tab-bar-close-current-tab, tab-bar-close-tab):
(tab-bar-new-tab): Use tab-bar-show.

* doc/emacs/frames.texi (Tab Bars): Add tab-bar-show.

* lisp/speedbar.el (speedbar-mode): Set buffer-local tab-bar-mode
and tab-line-format to nil to not show in dedicated speedbar frame.
2019-10-02 23:18:01 +03:00
Juri Linkov
edf48d1d70 * lisp/tab-line.el: Add new defcustom tab-line-close-tab-action. 2019-09-28 22:48:48 +03:00
Juri Linkov
e47c389cfd Improve customization.
* lisp/tab-bar.el (tab-bar-new-tab-choice)
(tab-bar-close-button-show): New defcustoms.
(tab-bar-tab-name-function): New defvar.

* lisp/tab-line.el (tab-line-new-tab-choice)
(tab-line-close-button-show): New defcustoms.
2019-09-25 23:21:37 +03:00
Juri Linkov
848e21b049 Small fixes. Bind [tab-line mouse-1] to mouse-select-window. 2019-09-25 00:54:36 +03:00
Juri Linkov
39255b9b4d Improve customizability and better tab separators.
* lisp/tab-bar.el (tab-bar-tabs-function): New defvar.

* lisp/tab-line.el (tab-line-tab-name-function)
(tab-line-tabs-function): New defvars.
2019-09-22 23:40:04 +03:00
Juri Linkov
6474abc363 Use images for new/close buttons in tab-bar and tab-line.
* etc/images/tabs/new.xpm:
* etc/images/tabs/close.xpm:
New files.

* lisp/tab-bar.el (tab-bar-separator): New face.
(tab-bar-separator, tab-bar-button-new, tab-bar-button-close):
Use display property with images in default values.

* lisp/tab-line.el (tab-line-button-new, tab-line-button-close):
Use display property with images in default values.

* src/xdisp.c (tab_bar_item_info): Add new arg close_p and set it
to the value of property `close' at charpos.
(get_tab_bar_item): Add new arg close_p.
(handle_tab_bar_click): Add ctrl_modifier when close_p is non-nil.
(Fdump_tab_bar_row): Fix crash for non-X builds.
2019-09-15 23:52:22 +03:00
Juri Linkov
89ef791c07 Small fixes for tty and w32.
* lisp/menu-bar.el (showhide-tab-bar): Visible on tty too.
* lisp/tab-bar.el (tab-bar-mode): Add binding [(control shift tab)] for w32.
* lisp/tab-line.el (tab-line-add-tab): Use tmm-prompt for buffer-menu on tty.
* src/w32term.c (w32_read_socket): Fix tool-bar clicks.
2019-09-08 23:18:45 +03:00
Juri Linkov
a7289c0488 * lisp/tab-bar.el (tab-bar-make-keymap-1): Don't use fixed "Current tab".
* lisp/tab-bar.el (tab-bar-make-keymap-1):
* lisp/tab-line.el (tab-line-tab-name-add):
Add space after Unicode char to avoid char clobbering on terminals.
2019-09-07 23:04:24 +03:00
Juri Linkov
2a01647534 Don't use hook pre-redisplay-functions. Set buffer-local tab-line-format.
* lisp/tab-line.el (tab-line-format): Move to C.
(tab-line-update-window-parameter): Remove function.
(global-tab-line-mode): Set the default value of tab-line-format.

* src/buffer.c (syms_of_buffer): Define buffer-local variable
tab-line-format.

* src/buffer.h (struct buffer): Add tab_line_format_.

* src/window.c (window_wants_tab_line):
* src/xdisp.c (pos_visible_p, display_mode_lines):
Check for buffer-local tab_line_format.
2019-09-05 22:27:42 +03:00
Juri Linkov
1598de6ef2 * lisp/tab-line.el (tab-line-tab-name): Try to use truncate-string-to-width. 2019-09-03 23:47:46 +03:00
Juri Linkov
c2ab5e8cf3 * lisp/tab-line.el: Limit the number of window tabs to tab-line-tabs-limit. 2019-09-03 01:29:07 +03:00
Juri Linkov
f458ca28cb * lisp/tab-line.el: Display truncated tab name in the tooltip. 2019-09-02 23:27:32 +03:00
Juri Linkov
3e0ad29a60 Frame-local tab-bar and window-local tab-line.
* etc/NEWS: Add 'tab-bar-mode' and 'global-tab-line-mode'.

* etc/TODO: Remove tab-related items.

* lisp/cus-start.el: Add tab-bar-mode, tab-bar-max-label-size.

* lisp/frame.el (frame-notice-user-settings): handle tab-bar-lines.

* lisp/loadup.el: Load "tab-bar".

* lisp/menu-bar.el (menu-bar-options-save): Add tab-bar-mode.
(menu-bar-showhide-menu): Define showhide-tab-bar.

* lisp/startup.el (tab-bar-images-pixel-height): New defconst.
(command-line): Reset tab-bar-mode.
(x-apply-session-resources): Add "tabBar", "TabBar".

* lisp/subr.el (read-key): Add tab-bar.

* lisp/tab-bar.el: New file.
* lisp/tab-line.el: New file.

* lisp/window.el (window--dump-frame): Add tab-bar-height.

* src/dispextern.h (enum window_part): Add ON_TAB_LINE.
(struct glyph_matrix): Add tab_line_p.
(struct glyph_row): Add tab_line_p.
(MATRIX_TAB_LINE_ROW): New macro.
(MATRIX_FIRST_TEXT_ROW): Handle more mode lines.
(MR_PARTIALLY_VISIBLE_AT_TOP): Add WINDOW_TAB_LINE_HEIGHT.
(MATRIX_TAB_LINE_HEIGHT, CURRENT_TAB_LINE_HEIGHT)
(DESIRED_TAB_LINE_HEIGHT): New macros.
(enum face_id): Add TAB_BAR_FACE_ID and TAB_LINE_FACE_ID.
(struct it): Add tab_line_p.
(tab_bar_item_idx, tab_bar_item_image): New enums.
(DEFAULT_TAB_BAR_LABEL_SIZE, DEFAULT_TAB_BAR_BUTTON_MARGIN)
(DEFAULT_TAB_BAR_BUTTON_RELIEF, DEFAULT_TAB_BAR_IMAGE_HEIGHT):
New constants.

* src/dispnew.c (adjust_glyph_matrix): Use window_wants_tab_line.
(shift_glyph_matrix): Add WINDOW_TAB_LINE_HEIGHT.
(clear_current_matrices, clear_desired_matrices):
Call clear_glyph_matrix on tab_bar_window.
(blank_row): Add WINDOW_TAB_LINE_HEIGHT.
(required_matrix_height): Change 2 to 3.
(fake_current_matrices): Reset tab_line_p.
(adjust_frame_glyphs_for_window_redisplay): Handle tab_bar_window.
Add FRAME_TAB_BAR_HEIGHT and FRAME_TAB_BAR_LINES.
(free_glyphs): Handle tab_bar_window.
(update_frame): Handle tab_bar_window.
(update_window): Handle row->tab_line_p.
(scrolling_window): Change arg type from bool to int.
Change header_line_p to tab_line_p.
(buffer_posn_from_coords): Add window_wants_tab_line.
(mode_line_string): Use MATRIX_TAB_LINE_ROW for part ON_TAB_LINE.

* src/frame.c (frame_default_tab_bar_height): New internal variable.
(adjust_frame_size): Handle tab_bar_window.
(make_frame): Reset tab_bar_redisplayed, tab_bar_resized and
last_tab_bar_item.
(Ftab_bar_pixel_width): New function.
(frame_parms): Add tab-bar-lines.
(gui_figure_window_size): Add new arg tabbar_p.
(syms_of_frame): Add Qtab_bar_size, Qupdate_frame_tab_bar,
Qfree_frame_tab_bar, Qtab_bar_lines, Stab_bar_pixel_width.
Add Qtab_bar_lines to frame_inhibit_implied_resize.
(tab-bar-mode): New variable.

* src/frame.h (GCALIGNED_STRUCT): Add tab_bar_window,
desired_tab_bar_string, current_tab_bar_string.
(GCALIGNED_STRUCT): Add tab_bar_items, last_tab_bar_item,
minimize_tab_bar_window_p, tab_bar_redisplayed, tab_bar_resized,
tab_bar_lines, tab_bar_height, n_tab_bar_rows, n_tab_bar_items.
(fset_tab_bar_items, fset_tab_bar_window)
(fset_current_tab_bar_string, fset_desired_tab_bar_string):
New inlines.
(FRAME_TAB_BAR_LINES, FRAME_TAB_BAR_HEIGHT): New macros.
(FRAME_TOP_MARGIN, FRAME_TOP_MARGIN_HEIGHT):
Use FRAME_TAB_BAR_LINES.

* src/fringe.c (draw_fringe_bitmap_1, update_window_fringes):
Add WINDOW_TAB_LINE_HEIGHT.

* src/gtkutil.c (xg_frame_set_char_size): Add FRAME_TABBAR_WIDTH.
(x_wm_set_size_hint): Add FRAME_TABBAR_WIDTH.

* src/keyboard.c (read_char): Handle Qtab_bar.
(kbd_buffer_get_event): Handle TAB_BAR_EVENT.
(make_lispy_position): Add WINDOW_TAB_LINE_HEIGHT.
Handle TAB_BAR_EVENT.
(tab_bar_items_vector, tab_bar_item_properties, ntab_bar_items):
New internal variables.
(tab_bar_items, process_tab_bar_item, set_prop_tab_bar)
(parse_tab_bar_item, init_tab_bar_items, append_tab_bar_item):
New functions.
(read_char_x_menu_prompt, read_key_sequence): Handle Qtab_bar.
(tab-bar-separator-image-expression): New variable.

* src/keymap.c (syms_of_keymap): Add Qtab_bar and Qtab_line.

* src/menu.c (x_popup_menu_1, Fx_popup_dialog): Handle Qtab_bar.

* src/termhooks.h (enum event_kind): Add TAB_BAR_EVENT.
(GCALIGNED_STRUCT): Add change_tab_bar_height_hook.

* src/w32fns.c (w32_frame_parm_handlers): Add w32_set_tab_bar_lines.

* src/w32term.c (w32_draw_window_cursor): Add WINDOW_TAB_LINE_HEIGHT.

* src/window.c (window_body_height): Add WINDOW_TAB_LINE_HEIGHT.
(Fwindow_tab_line_height): New function.
(coordinates_in_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(window_relative_x_coord): Add ON_TAB_LINE.
(Fcoordinates_in_window_p): Add ON_TAB_LINE.
(window_from_coordinates): Add new arg tab_bar_p.
(Fwindow_line_height): Use window_wants_tab_line with
WINDOW_TAB_LINE_HEIGHT.
(Fwindow_lines_pixel_dimensions): Add WINDOW_TAB_LINE_HEIGHT.
(make_window): Set tab_line_height to -1.
(window_wants_tab_line): New function.
(window_internal_height): Use window_wants_tab_line.
(window_scroll_pixel_based): Add WINDOW_TAB_LINE_HEIGHT.
(Frecenter): Set minimize_tab_bar_window_p to 1.
(GCALIGNED_STRUCT): Add frame_tab_bar_lines and frame_tab_bar_height.
(Fcurrent_window_configuration): Set frame_tab_bar_lines and
frame_tab_bar_height.
(set_window_scroll_bars): Add WINDOW_TAB_LINE_HEIGHT.
(syms_of_window): Add Qtab_line_format and Swindow_tab_line_height.

* src/window.h (GCALIGNED_STRUCT): Add tab_line_height.
(WINDOW_TAB_BAR_P, WINDOW_TAB_LINE_HEIGHT, WINDOW_TAB_LINE_LINES):
New macros.
(WINDOW_TOP_EDGE_Y, WINDOW_BOTTOM_EDGE_Y, WINDOW_TAB_LINE_HEIGHT):
Add WINDOW_TAB_BAR_P.

* src/xdisp.c (window_box_height): Add window_wants_tab_line with
MATRIX_TAB_LINE_ROW and CURRENT_TAB_LINE_HEIGHT.
(pos_visible_p): Use window_wants_tab_line.
Add WINDOW_TAB_LINE_HEIGHT.
(get_glyph_string_clip_rects): Add WINDOW_TAB_LINE_HEIGHT.
(get_phys_cursor_geometry): Add WINDOW_TAB_LINE_HEIGHT.
(remember_mouse_glyph): Use MATRIX_TAB_LINE_ROW for part
ON_TAB_LINE.
(init_iterator): Use MATRIX_TAB_LINE_ROW for TAB_LINE_FACE_ID.
Add WINDOW_TAB_LINE_HEIGHT.  Add window_wants_tab_line.
(Fwindow_text_pixel_size): Add WINDOW_TAB_LINE_HEIGHT.
(prepare_menu_bars): Call update_tab_bar.
(update_tab_bar, build_desired_tab_bar_string)
(display_tab_bar_line, tab_bar_height, Ftab_bar_height)
(redisplay_tab_bar, tab_bar_item_info, get_tab_bar_item)
(handle_tab_bar_click, note_tab_bar_highlight): New functions.
(compute_window_start_on_continuation_line): Use window_wants_tab_line.
(try_cursor_movement): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(redisplay_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(try_window_reusing_current_matrix): Use window_wants_tab_line
with WINDOW_TAB_LINE_HEIGHT.
(Fdump_tab_bar_row): New function.
(compute_line_metrics): Add WINDOW_TAB_LINE_HEIGHT.
(display_line): Use window_wants_tab_line.
(display_mode_line): Set tab_line_p to true if face_id is
TAB_LINE_FACE_ID.
(Fformat_mode_line): Handle Qtab_line and Qtab_bar.
(gui_clear_end_of_line): Add WINDOW_TAB_LINE_HEIGHT.
(erase_phys_cursor): Use WINDOW_TAB_LINE_HEIGHT.
(show_mouse_face): Use tab_bar_window.
(note_mode_line_or_margin_highlight): Use MATRIX_TAB_LINE_ROW for
area ON_TAB_LINE.
(note_mouse_highlight): Call note_tab_bar_highlight,
(expose_frame): Handle tab_bar_window.
(syms_of_xdisp): Add Sdump_tab_bar_row and Stab_bar_height.
(auto-resize-tab-bars, auto-raise-tab-bar-buttons)
(tab-bar-border, tab-bar-button-margin, tab-bar-button-relief)
(tab-bar-max-label-size): New variables.

* src/xfaces.c (lookup_basic_face): Add TAB_LINE_FACE_ID and
TAB_BAR_FACE_ID.
(syms_of_xfaces): Define Qtab_bar and Qtab_line.

* src/xfns.c (x_set_tab_bar_lines, x_change_tab_bar_height):
New functions.
(xic_set_statusarea): Add FRAME_TABBAR_TOP_HEIGHT.
(frame_geometry): Add FRAME_TAB_BAR_HEIGHT and Qtab_bar_size.

* src/xterm.c (x_draw_image_relief): Use tab_bar_button_relief.
(x_draw_image_relief): Use TAB_BAR_FACE_ID.
(handle_one_xevent): Handle tab_bar_window.
(x_set_window_size_1): Add FRAME_TABBAR_WIDTH.
(x_create_terminal): Set change_tab_bar_height_hook.

* src/xterm.h (struct x_output): Add tabbar_top_height,
tabbar_bottom_height, tabbar_left_width, tabbar_right_width
tabbar_widget, tabbar_in_hbox, tabbar_is_packed.
(FRAME_TABBAR_TOP_HEIGHT): Add FRAME_TABBAR_TOP_HEIGHT,
FRAME_TABBAR_BOTTOM_HEIGHT, FRAME_TABBAR_HEIGHT,
FRAME_TABBAR_LEFT_WIDTH, FRAME_TABBAR_RIGHT_WIDTH,
FRAME_TABBAR_WIDTH.
2019-08-31 23:40:07 +03:00