This is the substance of a patch I want to apply later in the week. I'm
posting it now to see if there are any vetos or suggestions. I think its
pretty neat so I'm hoping that any vetos can be worked around. There are a
number of display glitches and crashes in the current patch, so use at your
own risk.
The idea is that with widgets you often want to put them on some screen
real estate that isn't a buffer, vis-a-vis menubars or toolbars. This patch
allows you do to that, providing space below (or wherever depending on the
gutter and toolbar orientation) the toolbar and allowing you to display
anything you can display in a buffer. The patch uses all the generic
redisplay routines so there are no device-dependencies, but I have had to
cons up some new generation routines to cope with strings rather than
buffers. Eventually I would like to use these routines in the modeline code
as they eliminate a number of problems that the modeline has with
non-printable characters, variable fonts and glyphs etc.
Gutter specs are implemented as specifiers and so you can have global as
well as buffer, window or otherwise specific ones.
andy
1999-07-12 Andy Piper <andy(a)xemacs.org>
* gutter.c: new file - implements gutters. All new functions are
semantically equivalent to the toolbar functions.
(gutter_was_visible): new function.
(get_gutter_coords): ditto.
(output_gutter): ditto.
(clear_gutter): ditto.
(update_frame_gutters): ditto.
(redraw_exposed_gutter): ditto.
(redraw_exposed_gutters): ditto.
(free_frame_gutters): ditto.
(init_frame_gutters): ditto.
(decode_gutter_position): ditto.
(Fset_default_gutter_position): ditto.
(Fset_default_gutter_position): ditto.
(Fdefault_gutter_position): ditto.
(gutter_after_change): ditto.
(Fgutter_specifier_p): ditto.
(recompute_overlaying_specifier): ditto.
(gutter_specs_changed): ditto.
(default_gutter_specs_changed): ditto.
(gutter_geometry_changed_in_window): ditto.
(default_gutter_size_changed_in_window): ditto.
(default_gutter_border_width_changed_in_window): ditto.
(default_gutter_visible_p_changed_in_window): ditto.
(syms_of_gutter): ditto.
(vars_of_gutter): ditto.
(specifier_type_create_gutter): ditto.
(specifier_vars_of_gutter): ditto.
* gutter.h: new file. Contains gutter constants and sizing macros
similar to those for the toolbar.
* winslots.h: add gutter variables.
* window.h: declare window_is_* functions.
* window.c (window_is_lowest): make non-static.
(window_is_highest): ditto.
(window_top_toolbar_height): deleted.
(window_bottom_toolbar_height): deleted.
(window_left_toolbar_width): deleted.
(window_right_toolbar_width): deleted.
(window_top_gutter_height): add gutter sizing.
(window_bottom_gutter_height): ditto.
(window_left_gutter_width): ditto.
(window_right_gutter_width): ditto.
* symsinit.h: declarations for gutters vars etc.
* search.c (bi_find_next_emchar_in_string): new function.
* scrollbar.c (update_scrollbar_instance): remove reference to
window_bottom_toolbar_height which did nothing.
* redisplay.h (struct display_line): add face indices for
overriding defaults in output_display_line.
Add gutter_changed flags and declarations.
* redisplay.c (create_string_text_block): new function, similar to
create_text_block but for strings. Display tables etc are used
from the currently selected window.
(generate_string_display_line): ditto. Similar to
generate_display_line.
(generate_displayable_area): generate display lines for a given
area on a frame. Input is the string, with associated extents, to
display.
(redisplay_frame): add gutter_changed check.
(redisplay_device): ditto.
(redisplay_without_hooks): ditto.
* redisplay-x.c (bevel_modeline): moved to redisplay.c.
(x_redraw_exposed_area): redraw exposed gutters.
(x_bevel_area): new redisplay device method.
(x_type_create_redisplay_mswindows): add bevel_area device method.
(x_output_display_block): fiddly Martin-style cleanup.
(x_output_vertical_divider): use bevel_area.
* redisplay-output.c (output_display_line): check display_lines
for face information before using defaults.
(bevel_modeline): new function, calls bevel_area with appropriate
values.
* redisplay-msw.c (bevel_modeline): moved to redisplay.c.
(mswindows_redraw_exposed_area): redraw exposed gutters.
(mswindows_bevel_area): new redisplay device method.
(console_type_create_redisplay_mswindows): add bevel_area device
method.
* indent.c (string_column_at_point): add column_at_point but for
strings.
* glyphs-x.c (image_instantiator_format_create_glyphs_x): only
instantiate widgets that we have a toolkit for.
* general.c: add Qgutter.
* frame.h (struct frame): add display lines for gutters and
visibility flags.
* frame.c (set_frame_selected_window): mark gutters changed.
* emacs.c (main_1): add gutter initialisation.
* device.h (struct device): add gutter_changed flag and macros to
manipulate it.
* console.h (struct console_methods): new bevel area redisplay
method.
* buffer.h (REAL_INC_CHARBYTIND): new macro for strings as
REAL_INC_BYTIND is for buffers.
(INC_CHARPTR): ditto.
* Makefile.in.in (objs): add gutter.o
--------------------------------------------------------------
Dr Andy Piper
Senior Consultant Architect, BEA Systems Ltd
Show replies by date