This patch changes geometry calculation of widgets to be dynamic, this has
a number of desirable side-effects including making widget updates more
asynchronous. part #2 will be actually fixing the layout widget to lay out
its children dynamically and intelligently.
I will apply this tomorrow.
andy
2000-01-08 Andy Piper <andy(a)xemacs.org>
* event-msw.c (mswindows_wnd_proc): don't need to check for widget
face anymore.
* frame.c (change_frame_size_1): use new glyph_* signatures.
(frame_conversion_internal): ditto.
* toolbar-x.c (x_get_button_size): Use modified glyph_*
signatures.
* redisplay.c (add_glyph_rune): Use modified glyph_* signatures.
(add_glyph_rune): dittto.
(add_margin_runes): ditto.
(create_left_glyph_block): ditto.
(create_right_glyph_block): ditto.
(redisplay_window): ditto.
* redisplay-output.c (redisplay_output_layout): Use modified
glyph_* signatures.
* glyphs.h: (struct image_instantiator_methods): change signature
of query_geometry and layout.
(struct Lisp_Image_Instance): Clean up fields for dynamic geometry
calculations.
(struct expose_ignore): change field types.
(struct subwindow_cachel): ditto. declare new functions and
accessor macros.
* glyphs.c: (instantiate_image_instantiator): assign glyph when
creating the image instance.
(image_instance_hash): fixup for new and deleted fields.
(image_instance_equal): ditto.
(mark_image_instance): ditto.
(print_image_instance): ditto.
(allocate_image_instance): zero width and height. assign attached
glyph. mark as dirty for future layout.
(make_image_instance_1): pass Qnil as the glyph its attached to.
(Fimage_instance_height): simply return the height.
(Fimage_instance_width): simply return the width.
(image_instance_query_geometry): new function. query the image
instance's geometry by wiring through to format and device
specific methods. fallback on the existing geometry.
(image_instance_layout): new function. layout the image instance
by querying its geometry and then wiring through to format and
device specific methods.
(query_string_geometry): new function to decide the bounding box
of a string. text glyph geometry calculations moved here.
(query_string_font): new function. find out the font for a given
string in a given face.
(text_query_geometry): return geometry based on
quert_string_geometry.
(formatted_string_instantiate): call string_instantiate.
(image_instantiate): put strings in the per-window cache. Feed the
glyph to the instantiated image instance.
(glyph_height_internal): deleted.
(glyph_width): simply return the required dimension. re-layout if
the instance is dirty. Remove references to face_index and
frame_face which were only used for strings.
(glyph_ascent): ditto.
(glyph_descent): ditto.
(glyph_height): ditto.
(Fglyph_width): use new glyph_width function.
(Fglyph_ascent): use new glyph_ascent function.
(Fglyph_descent): use new glyph_descent function.
(Fglyph_height): use new glyph_height function.
(glyph_property_was_changed):
(glyph_image_instance_maybe): new function to possible create an
image instance from a glyph if we don't have one already.
(glyph_dirty_p): use it.
(glyph_layout): new function for laying out a glyph.
(glyph_query_geometry): new function for finding out the desired
geometry of a glyph.
(update_glyph_cachel_data): use new glyph_* signatures.
(update_subwindow): call resize_subwindow.
(map_subwindow): call update_subwindow if the image is dirty.
(subwindow_instantiate): add comment.
(Fresize_subwindow): don't actually resize the window, just record
the values and let update_subwindow handle it.
(Fglyph_animated_timeout_handler): use
MARK_IMAGE_INSTANCE_CHANGED.
(image_instantiator_format_create): declare things with
query_geometry and layout functions.
* glyphs-x.c: (x_update_subwindow): remove widget sizing.
(update_widget_face): use query_string_font.
(x_widget_set_property): don't return Qt when setting is
succesful.
(x_combo_box_instantiate): call widget_instantiate rather than
widget_instantiate_1.
* glyphs-widget.c: (widget_face_font_info): deleted.
(widget_text_to_pixel_conversion): deleted.
(widget_set_property): make sure the new text gets propagated to
the image instance.
(widget_layout): new function. wire through to device and format
specific methods.
(widget_query_geometry): new function. wire through to device and
format specific methods. fallback on geometry of widget text.
(initialize_widget_image_instance): fixup new fields.
(widget_instantiate_1): deleted.
(tree_view_instantiate): deleted.
(tree_view_query_geometry): new function. returns desired sizing
of tree view.
(tab_control_instantiate): deleted.
(tab_control_query_geometry): new function. returns desired sizing
of tab.
(widget_instantiate): subsume widget_instantiate_1. Fixup geometry
things in the light of dynamic layout.
(static_instantiate): deleted.
(layout_instantiate): use new glyph_* signatures.
(image_instantiator_format_create_glyphs_widget): fixup
query_geometry and layout declarations for various widgets.
* glyphs-msw.c: (mswindows_widget_instantiate): add comment.
(mswindows_button_instantiate): use query_string_font for geometry
calculations.
(mswindows_update_subwindow): ditto.
(mswindows_combo_box_instantiate): fixup for new geometry
management.
(mswindows_widget_set_property): Don't return Qt so that other
methods can be called.
* gutter-items.el (update-tab-in-gutter): remove resize-subwindow
calls.
(remove-buffer-from-gutter-tab): ditto.
--------------------------------------------------------------
Dr Andy Piper
Senior Consultant Architect, BEA Systems Ltd