2000-03-27  Ettore Perazzoli  <ettore@helixcode.com>

	* testgtkhtml.c: Removed unused (global) variables.

	* htmltextarea.c
	(html_textarea_init): Removed unused variable.

	* htmlentity.c
	(html_entity_prepare): Made const-safe.

	* htmlentity.h
	(html_entity_prepare): Make prototype const-safe.

	* htmlgdkpainter.c: #include "htmlentity.h".

2000-03-27  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlclueh.c
	(calc_size): Set the ascent even for `HTML_VALIGN_TOP'.  This is
	*not* the correct fix, but it looks better, at least on Slashdot.
	Anyway, we should not be putting images into HTMLClueH's when they
	are aligned; this simply makes it impossible to align them
	properly, because we don't know where the baseline is!  Instead,
	we should probably have an `alignment' attribute in `HTMLObject'
	`and HTMLClueFlow's flowing code should respect it.

2000-03-26  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlcluev.c
	(check_point): Check that the point expressed by the @x, @y
	coordinates is actually in the object.

2000-03-26  Ettore Perazzoli  <ettore@helixcode.com>

	* htmldrawqueue.c
	(draw_obj): If the object is transparent, draw the background too.

	* htmltablecell.c
	(draw_background_helper): New helper function.
	(draw): Use it.
	(draw_background): New function, implementation of
	`HTMLObject::draw_background()'.
	(html_table_cell_class_init): Install the `draw_background'
	implementation.

	* htmlobject.c
	(is_transparent): New function, default implementation for
	`HTMLObject::is_transparent()'.
	(draw_background): New function, default implementation for
	`HTMLObject::draw_background'.
	(html_object_class_init): Install them.
	(html_object_is_transparent): New function.
	(html_object_draw_background): New function.

	* htmlobject.h: New virtual methods `is_transparent',
	`draw_background'.

2000-03-36  Jonas Borgstrm  <jonas_b@bitsmart.com>

	* htmltextarea.c (on_button_press_event): New function.
	It returns TRUE, so the events don't get passed to the parent widget.
	This makes it possible to enter text in textareas.

	* gtkhtml.c (motion_notify_event): Check if the cursor is over a form element.
	If so, don't try to select it.
	This makes the engine not selecting text when you scroll a listbox.

2000-03-26  Radek Doulik  <rodo@helixcode.com>

	* htmlclueflow.c (calc_preferred_width): remove trailing space
	width at end of line(s)
	(calc_size): same as above

	* htmltextslave.c (html_text_slave_trail_space_width): like bellow

	* htmltextmaster.c (html_text_master_trail_space_width): new
	function, returns trailing space width if it is here, otherwise 0

	* gtkhtmldebug.c (gtk_html_debug_dump_tree): also print TextSlave
	text

2000-03-26  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlengine.c (insert_text): Reverted previous change, as it
	breaks spaces between normal text and links, among other things.

2000-03-26  Radek Doulik  <rodo@helixcode.com>

	* htmlcluev.c (find_free_area): choose rmargin as MAX(max_width,
	width) so centering works happily now - like on helixcode page
	(get_right_margin): the same

	* htmlobject.c (get_right_margin): same as above

	* htmlengine.c (insert_text): added trailing space eating, so we
	have no problems with longer texts later (there was problem, when
	sometimes we count them and sometimes not (Master::min_width and
	others)) */

2000-03-25  Radek Doulik  <rodo@helixcode.com>

	* gtkhtmldebug.c (gtk_html_debug_dump_tree): added width,
	max_width to HTMLObject dump and HAlign, VAlign to HTMLClue
	descendants

2000-03-25  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlcluev.c
	(do_layout): Use `html_object_get_left_margin()' instead of
	`html_clue_get_left_margin()'.
	(get_left_margin): Get an `HTMLObject *' instead of an `HTMLClue
	*'.
	(get_right_margin): Likewise.

	* htmlclueh.c
	(calc_size): Use `html_object_get_left_margin()' instead of
	`html_clue_get_left_margin()'.

	* htmlclueflow.c
	(calc_size): Use `html_object_get_left_margin()' and
	`html_object_get_right_margin()' instead of
	`html_clue_get_left_margin()' and `html_clue_get_right_margin()'.

	* gtkhtml-keybinding.c: #include "gtkhtmldebug.h".

	* htmlobject.c
	(get_left_margin): New function.
	(get_right_margin): New function.
	(html_object_class_init): Install them as the default
	implementations of `get_left_margin' and `get_right_margin'.

	* htmlobject.h: Moved here.  This is not very nice, but we need to
	make it work.

	* htmlclue.c
	(get_left_margin): Removed.
	(get_right_margin): Removed.
	(html_clue_class_init): Do not install them anymore.
	(html_clue_get_left_margin): Removed.
	(html_clue_get_right_margin): Removed.

	* htmlclue.h: Removed `get_left_margin', `get_right_margin'
	methods.

	* htmltable.c
	(check_point): Do not reset `offset_return'.  (Why would you ever
	want to do that!?!?!?)
	(forall): New function, implementation of `HTMLObject::forall()'.
	(html_table_class_init): Install it.
	(set_cells): Set the cell's parent pointer.

2000-03-24  Ettore Perazzoli  <ettore@helixcode.com>

	* Makefile.am [! LIBWWW]: Do not build `testgtkhtml'.

2000-03-24  Radek Doulik  <rodo@helixcode.com>

	* htmlimage.c (html_image_factory_frame_done): I have started work
	on gif animations using gdk-pixbuf, but it seems to me, that
	progressive loading of animated gifs is still unimplemented

	* htmlcluev.c (do_layout): change width, if o->width <
	o->max_width instead of o->width > o->max_width - this made cells
	shorter than they actually was - this one fixes also moved bg
	pixmap on www.helixcode.com page and surely another ones

2000-03-23  Radek Doulik  <rodo@helixcode.com>

	* htmlclueflow.c (should_break): fixed case, when obj is on the
	beginning of clue list (it returned TRUE before, which was bad)

2000-03-23  Radek Doulik  <rodo@ucw.cz>

	* htmlclueflow.c (calc_min_width): fill HTMLObject::nb_width
	(calc_size): use HTMLObject::nb_width

	* htmlobject.h: added nb_width - width of following non-breaking
	list of objects

	* htmltextmaster.c (calc_min_width): removed run_width +=
	space_width as we don't want add spaces to minimal width

	* htmlclueflow.c (should_break): new function, decides if line
	should be broken before obj
	(calc_min_width): uses should_break function
	(calc_size):  uses should_break function

	* htmlgdkpainter.c (draw_text): uses html_entity_prepare
	(calc_text_width):  uses html_entity_prepare

	* htmlentity.c (html_entity_prepare): prepares text to
	draw/get_width - now it only replaces &nbsp; with ' '

2000-03-22  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlclueflow.c (add_pre_padding): Also increment the `y' value
	if we add padding.
	(add_post_padding): Likewise.

	* htmlobject.c (relayout): Subtract `ascent + descent' from the y
	position to make the HTMLClueFlow::calc_size() code happy.  Sigh.
	This code is so ugly.

2000-03-20  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlengine.c (parse_m): When parsing `content=', spaces are
	valid separators.

2000-03-20  Ettore Perazzoli  <ettore@helixcode.com>

	* gtkhtml.c (focus_out_event): Removed annoying debugging message.
	(focus_in_event): Likewise.

2000-03-18  Jonas Borgstrm  <jonas_b@bitsmart.com>

	* testgtkhtml.c (url_requested): Only use redirect filters on the
	first file requested on each page load (the main html file).

2000-03-18  Jonas Borgstrm  <jonas_b@bitsmart.com>

	This is quite a big change to htmlclueflow. Hope I didn't break anything.
	I have tested it quite some time now and I think it works great.
	And the text reflows great around the aligned topic images on slashdot.

	But don't hesitate to back out my changes if it breaks something.
	
	* htmlclueflow.c (calc_size): Use lmargin and rmargin correct. And some other
	changes to make right aligned items to reflow correctly.

	* htmlcluev.c (get_right_margin): Corrected the margin calculation.
	(find_free_area): Corrected the boundary checking.
	(append_right_aligned): Made it behave more like append_left_aligned ().
	
	* tests/bugs.html: Removed www.slashdot.org entry, it looks great now.

2000-03-17  Jonas Borgstrm  <jonas_b@bitsmart.com>

	Second attempt of fixing <br> sorry about this.
	
	* htmlengine.c (add_line_break): Only insert create_empty_text (); when
	the clue is empty.
	(new_flow): Only do html_clue_append if firstobject is non NULL.

	* tests/bugs.html: Removed www.gimp.org entry, it looks great now.

2000-03-17  Jonas Borgstrm  <jonas_b@bitsmart.com>

	* htmltextslave.c (calc_size): Backed out my previous checkin.
	It didn't handle multiple <br> after each other very well

	* tests/bugs.html: Added www.gimp.org again. With better bug desciption.

2000-03-17  Ettore Perazzoli  <ettore@helixcode.com>

	* gtkhtml.c: s/char/gchar/.
	* gtkhtml.h: Likewise.

2000-03-17  Ettore Perazzoli  <ettore@helixcode.com>

	* gtkhtml.c
	(gtk_html_get_title): New function.

2000-03-17  Ettore Perazzoli  <ettore@helixcode.com>

	* testgtkhtml.c
	(title_changed_cb): New param `title'.  Use `g_strconcat()'
	instead of `g_strdup_printf()'.

	* gtkhtml.c
	(html_engine_title_changed_cb): Updated to set the new `new_title'
	parameter in "title_changed".
	(class_init): Set up "title_changed" with a new `GTK_TYPE_STRING'
	param.

	* gtkhtml.h: Parameter `new_title' added to signal "title_changed".

2000-03-17  Jonas Borgstrm  <jonas_b@bitsmart.com>

	* htmltextslave.c (calc_size): Set ascent and descent
	to zero if the width also is zero. This helps <br> not make to much space.

	* tests/bugs.html: Removed www.gimp.org entry, it looks great now.

2000-03-17  Jonas Borgstrm  <jonas_b@bitsmart.com>

	* htmlengine.c (parse_p): Handle <p align=xxx>.
	
	* tests/bugs.html: Removed gtk.themes.org entry, it looks great now.
	  Removed www.gnome.org entry, it looks ok now.

2000-03-13  Dan Winship  <danw@helixcode.com>

	* htmlengine.c (html_engine_end): don't call gtk_timeout_remove if
	no timer is set.

2000-03-13  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlengine-edit-paste.c
	(remove_slaves_at_cursor): New helper function.
	(html_engine_paste): Call it before manipulating the text.

	* htmlclueflow.c
	(html_clueflow_remove_text_slaves): New function.

	* htmlengine-edit-paste.c
	(merge_possibly): New helper function.
	(html_engine_paste): Use it to merge the first and last pasted
	objects with their neighbours.

	* gtkhtml-keybinding.c
	(handle_none): Cause `GDK_F12' to dump the tree.

	* htmlengine-edit-cut.c
	(cursor_at_end_of_region): New function to detect if the cursor is
	at the end or the beginning of the selected region.
	(html_engine_cut): Use `cursor_at_end_of_region' to find out if we
	actually need to move the cursor back; if not, don't move the
	cursor.

	* htmlengine.c
	(add_line_break): Just create a new flow.  I hope this won't break
	anything.

	* htmlclueflow.c
	(halign_to_string): New helper function.
	(save): Use it to write a `DIV' tag to align the paragraph
	properly.

2000-03-13  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlengine-save.c
	(write_header): Do not write a `<title>' tag
	if there is no title.  This also prevents a segfault.

2000-03-12  Ettore Perazzoli  <ettore@helixcode.com>

	* htmltextmaster.c
	(get_selection): Use the `size_return' parameter properly.

	* htmlobject.c
	(get_selection): New parameter `size_return'.  Set `*size_return'
	to 1 before returning.
	(html_object_get_selection): New parameter `size_return'.

	* htmlobject.h: New parameter `size_return' in
	`HTMLObject::get_selection'.

	* htmlengine-edit-cut.c
	(html_engine_cut): Implemented, by means of
	`html_engine_move_cursor()' and `html_engine_delete()'.

	* htmlengine-edit-copy.c
	(copy): New helper function.
	(html_engine_copy): Return value changed to `guint': return the
	length of the cut buffer.  Rewritten to use the `copy' helper
	function.
	(html_engine_copy_to_buffer): New function.

2000-03-12  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlengine-edit-delete.c
	(html_engine_delete): Prevent bogus deletion of `destroy_orig'
	caused by using `->next' instead of `html_object_next_not_slave()'.

	* htmlengine-edit-insert.c
	(do_insert_different_style): Use `html_object_prev_not_slave()'.

	* htmlengine-edit-delete.c
	(delete_same_parent): Use `html_object_next_not_slave()'.
	(delete_different_parent): Likewise.
	(merge_text_at_cursor): Likewise.
	(html_engine_delete): Likewise.

	* htmlcursor.c
	(forward): Use `html_object_next_not_slave()' instead of
	`next_not_slave'.
	(next_not_slave): Removed.
	(html_cursor_get_current_char): Likewise.

	* htmlobject.c
	(html_object_is_text): Added precondition (@object != NULL).
	(html_object_next_not_slave): New function.
	(html_object_prev_not_slave): New function.

	* htmlcursor.c
	(normalize): New helper function.
	(html_cursor_normalize): Rewritten by means of it.
	(html_cursor_jump_to): Use it to normalize @object and @offset.
	(html_cursor_get_current_char): Get the next non-`HTMLTextSlave'
	element instead of just the next element.

	* gtkhtml.c
	(init): Initialize `ibeam_cursor'.
	(destroy): Destroy `ibeam_cursor'.
	(motion_notify_event): Change the cursor to the ibeam on text
	elements, or if we are on a link text element and editing is
	enabled.

	* gtkhtml.h: New member `ibeam_cursor' in `GtkHTML'.

2000-03-12  Ettore Perazzoli  <ettore@helixcode.com>

	* gtkhtml.c
	(size_allocate): Recalculate size and toolbars only if the size
	has changed.

	* htmlclueflow.c
	(check_point): Fix clicking in the blank area on top/left of the
	HTMLClueFlow.

2000-03-12  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlengine-edit-cursor.c
	(html_engine_hide_cursor): Draw the cursor only if the engine is
	editable.
	(html_engine_show_cursor): Likewise.

	* htmldrawqueue.c
	(draw_obj): Draw the cursor only if the engine is editable.
	(clear): Likewise.

2000-03-12  Ettore Perazzoli  <ettore@helixcode.com>

	* htmltextmaster.c
	(check_point): Do not make the offset be greater than the string's
	length.

	* htmlclueflow.c
	(check_point): New function, implementation of
	`HTMLObject::check_point'.
	(html_clueflow_class_init): Install it.

	* htmltextmaster.c
	(check_point): Consider an object to be on a new line by comparing
	the y coordinate too.

	* htmlengine.c
	(html_engine_get_object_at): If `for_cursor', clip the coordinates
	to the cluev's area.

2000-03-09  Ettore Perazzoli  <ettore@helixcode.com>

	* gtkhtml.c
	(focus_in_event): Give the engine the focus with
	`html_engine_set_focus()'.
	(focus_out_event): Remove the focus from the engine with
	`html_engine_set_focus()'.

	* htmlengine.c
	(html_engine_set_focus): New function.

	* htmlengine.h: New member `have_focus' in `HTMLEngine'.

	* gtkhtml.c
	(destroy): Argh!  Destroy the `HTMLEngine'!

	* gtkhtml-keybinding.c
	(gtk_html_handle_key_event): If the key event is handled, reset
	the blinking cursor with `html_engine_reset_blinking_cursor()'.

	* htmlengine.c
	(html_engine_init): Initialize `blinking_timer_id'.
	(html_engine_destroy): If `blinking_timer_id' is nonzero, remove
	the corresponding timeout.
	(html_engine_set_editable): If the engine becomes editable, call
	`html_engine_setup_blinking_cursor()'.  If it beomes non editable,
	call `html_engine_stop_blinking_cursor()'.

	* htmlengine-edit-cursor.c
	(html_engine_setup_blinking_cursor): New function.
	(html_engine_stop_blinking_cursor): New function.
	(html_engine_reset_blinking_cursor): New function.
	(blink_timeout_cb): New static function that implements cursor
	blinking.

	* htmlengine.h: New members `blinking_timer_id', `blinking_status'
	in `HTMLEngine'.

	* htmldrawqueue.c
	(draw_obj): Don't draw objects whose width and/or height is zero.

	* htmlengine.c
	(html_engine_draw_cursor): Removed.
	(html_engine_flush_draw_queue): Don't call it anymore.  Added
	precondition: `e' must be an HTMLEngine.
	(html_engine_queue_draw): Added precondition: `e' must be an
	HTMLEngine.

	* htmlengine-edit-movement.c
	(html_engine_move_cursor): Use `html_engine_{hide,show}_cursor()'
	instead of `html_engine_draw_cursor()'.
	(html_engine_jump_to_object): Likewise.
	(html_engine_beginning_of_document): Likewise.
	(html_engine_end_of_document): Likewise.
	(html_engine_beginning_of_line): Likewise.
	(html_engine_end_of_line): Likewise.
	(html_engine_scroll_down): Likewise.
	(html_engine_scroll_up): Likewise.
	(html_engine_forward_word): Likewise.
	(html_engine_backward_word): Likewise.

	* htmlengine-edit-delete.c
	(html_engine_delete): Use `html_engine_{hide,show}_cursor()'
	instead of `html_engine_draw_cursor()'.

	* htmlengine-edit-insert.c
	(html_engine_insert_para): Use `html_engine_{hide,show}_cursor()'
	instead of `html_engine_draw_cursor()'.

	* htmlengine-edit-inster.c
	(html_engine_insert): Use `html_engine_{hide,show}_cursor()'
	instead of `html_engine_draw_cursor()'.

	* htmlengine-edit-cursor.c
	(html_engine_draw_cursor_in_area): Moved here from `htmlengine.c'.
	Do not draw anything if `cursor_hide_count' is greater than zero.
	(html_engine_show_cursor): New function.
	(html_engine_hide_cursor): New function.

	* htmlengine-edit-cursor.h: New file.
	* htmlengine-edit-cursor.c: New file.

	* htmlengine.c
	(html_engine_draw_cursor_in_area): Removed.
	(html_engine_init): Initialize `cursor_hide_count' to zero.

	* htmlengine.h: New member `cursor_hide_count' in `HTMLEngine'.

	* htmldrawqueue.c
	(clear): Draw the cursor in the cleared area.
	(draw_obj): Likewise.

2000-03-08  Ettore Perazzoli  <ettore@helixcode.com>

	* htmldrawqueue.c
	(html_draw_queue_flush): Flush the clearing queue before the
	drawing one.

	* htmlclueflow.c
	(relayout_and_draw): Removed.
	(relayout_for_level_change): New helper function.
	(html_clueflow_indent): Just return if `indentation' is zero.
	Avoid doing a relayout if indentation does not change.  Use
	`relayout_for_level_change'.
	(html_clueflow_set_style): Use `html_object_relayout ()' instead
	of `relayout_and_draw()'.
	(html_clueflow_set_halignment): Likewise.
	(html_clueflow_set_properties): Likewise.

	* htmlcluev.c
	(do_layout): New parameter `engine'.  New parameter `relayout'.  If
	true, use `html_object_relayout()' instead of
	`html_object_calc_size()'.
	(relayout): If `child' is NULL, use `head'.

2000-03-08  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlengine.c
	(block_end_quote): Use `HTMLEngine' member `indent_level' instead
	of `list_level', `quote_level'.
	(block_end_list): Likewise.
	(parse_table): Likewise.
	(parse_b): Likewise.
	(parse_d): Likewise.
	(parse_l): Likewise.
	(parse_o): Likewise.
	(parse_u): Likewise.
	(html_engine_init): Likewise.
	(ensure_editable): Updated for `html_clueflow_new()'.

	* htmlengine-edit-clueflowstyle.c: Removed members `quote_level',
	`list_level' in `OriginalClueFlowProps'; replaced them with a
	single `level' member.
	(get_props): Updated accordingly.
	(set_props): Likewise.
	(html_engine_get_current_clueflow_indentation): Just use the
	`level' member in `HTMLClueFlow' instead of the old `list_level'
	and `quote_level'.

	* gtkhtmldebug.c
	(gtk_html_debug_dump_tree): Print `level' instead of `quote_level'
	and `list_level' that do not exist anymore.

	* htmlclueflow.c
	(copy): Copy `level'.  Don't copy `list_level' and `quote_level'
	anymore as they are gone.
	(add_pre_padding): Updated to use `level' instead of
	`list_level'/`quote_level'.
	(add_post_padding): Likewise.
	(draw): Use `level' instead of `list_level'.
	(write_indentation_tags): Use `last_level' in
	`HTMLEngineSaveState' instead of `last_quote_level',
	`last_list_level'.
	(html_clueflow_init): Removed parameters `quote_level',
	`indent_level'.  Only get a generic `level' parameter instead.
	(html_clueflow_new): Likewise.
	(html_clueflow_set_properties): Likewise.
	(html_clueflow_get_properties): Likewise for `list_level_return'
	and `quote_level_return'.
	(html_clueflow_split): Updated accordingly.
	(html_clueflow_indent): Simply increase/decrease `level'.

	* htmlengine-save.c
	(html_engine_save): Initialize `last_level' instead of
	`last_quote_level' and `last_list_level', that don't exist
	anymore.

	* htmlengine-save.h: Members `last_quote_level',
	`last_list_level' in `HTMLEngineSaveState' removed.  New member
	`last_level'.

	* htmlclueflow.h: Members `quote_level' and `list_level' removed
	from `HTMLClueFlow'.  New member `level' which is used for both
	lists and blockquotes.

	* gtkhtml.c
	(update_styles): Use `html_engine_get_editable' instead of the
	`editable' member that does not exist anymore.
	(key_press_event): Likewise.
	(motion_notify_event): Likewise.
	(button_press_event): Likewise.
	(gtk_html_get_editable): Likewise.
	(init): Do not init `editable' anymore.
	(gtk_html_end): Do not call `html_engine_set_editable()' anymore.
	(gtk_html_set_editable): Inconditionally call
	`html_engine_set_editable()'.
	(gtk_html_begin): Do not make the engine non-editable anymore.

	* gtkhtml.h: Removed member `editable'.

	* htmlengine.c
	(html_engine_set_editable): Added preconditions.
	(html_engine_get_editable): New function.
	(html_engine_end): Make sure the thing is editable if `editable'
	is true, by calling `ensure_editable()'.

	* htmlengine.c
	(html_engine_end): Just before emitting the "load_done" signal,
	call `html_engine_timer_event()' repeatedly, until it returns
	FALSE: this way, we make sure all the pending text is parsed.
	Then remove the timeout, as it is not necessary anymore.
	(html_engine_stop_parser): Reset `timerId'.

	* htmlengine-edit-movement.c
	(html_engine_jump_to_object): Normalize cursor after changing it.

	* htmlengine.c
	(html_engine_unselect_all): Do not traverse the whole tree if we
	are sure there is no current selection [`active_selection' is
	FALSE].

2000-03-07  Elliot Lee  <sopwith@redhat.com>
	
	* htmlbutton.c, htmlcheckbox.c, htmlengine-save.c,
	 htmlgdkfontmanager.c, htmlgdkpainter.c htmlhidden.c,
	 htmlprintfontmanager.c, htmlradio.c, htmltext.c, htmltextinput.c,
	 htmltextmaster.c: #include <string.h>

2000-03-07  Ettore Perazzoli  <ettore@helixcode.com>

	* gtkhtml.c
	(gtk_html_calc_scrollbars): Do not set lower/upper limits for the
	toolbars explicitly anymore. Also, do not use
	`gtk_layout_set_size()' if the size has not actually changed.

	* gtkhtml-keybinding.c
	(page_up): Unselect all.
	(page_down): Likewise.
	(forward_word): Likewise.
	(backward_word): Likewise.
	(beginning_of_document): New function.
	(end_of_document): New function.
	(gtk_html_handle_key_event): Do not care about the shift status
	when dispatching to `handle_ctrl()' or `handle_alt()'.
	(handle_ctrl): Map `GDK_Home' to `beginning_of_document()',
	`GDK_End' to `end_of_document()'.
	(handle_alt): Map `<' to `beginning_of_document()' and `>' to
	`end_of_document()'.

	* htmlcursor.c
	(html_cursor_beginning_of_document): New function.
	(html_cursor_end_of_document): New function.

	* htmlengine-edit-movement.c
	(html_engine_beginning_of_document): New function.
	(html_engine_end_of_document): New function.

	* htmlengine-edit-insert.c
	(do_insert_different_style): Don't crash if there is no previous
	non-HTMLTextSlave element.

	* htmlengine.c
	(ensure_editable): New helper function.
	(html_engine_load_empty): Use it.  Basically, we now start/stop
	the parser and call `ensure_editable()' to make sure the resulting
	thing is editable correctly.
	(html_engine_set_editable): If the engine is now editable, make
	sure it can actually be edited with `ensure_editable()'.
	(html_engine_set_base_url): Removed.
	(parse_b): Emit signal directly, instead of using
	`html_engine_set_base_url()'.

	* htmlcluev.c
	(relayout): Always queue a clear when needed, even if we have no
	parents.

	* htmlobject.c
	(relayout): Always queue a clear when needed, even if we have no
	parents, as the new relayout logic requires this.

2000-03-06  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlengine-edit-delete.c (html_engine_delete): Call
	`html_cursor_normalize()' on exit.

	* htmlcursor.c (html_cursor_normalize): New function.  If the
	cursor points to an object's zero offset and there is an object
	before this one, we change the pointer to point to the object
	before it, and the offset to the size of the object.

	* htmlengine-edit-delete.c (html_engine_delete): Argh.  Initialize
	`orig_object' and `orig_offset' at the right time.

2000-03-03  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlengine-edit-delete.c (html_engine_delete): Move to the next
	object without changing the actual position if we are at the very
	end of a text object, and this is not the last object.

	* htmlcursor.c (forward): When choosing between an object and the
	next one, choose the first one.
	(backward): Likewise.

	* htmlengine-edit-insert.c (do_insert): Play with the cursor
	pointer so that it points to an adiacent text object if possible.
	Otherwise, just call `do_insert_not_text()'.
	(do_insert_not_text): Implemented.

	* gtkhtml.c (update_styles): Do nothing if the widget is not
	editable.

	* htmlengine.c (html_engine_init): Initialize `editable' to be
	FALSE.

	* testgtkhtml.c (main): After creating the HTMLwidget, invoke
	`gtk_html_load_empty' on it.

	* gtkhtml.c (gtk_html_load_empty): New function.

	* htmlengine.c (html_engine_load_empty): New function.

2000-03-01  Ettore Perazzoli  <ettore@helixcode.com>

	* gtkhtml-keybinding.c
	(forward_word): New private function.
	(backward_word): New private function.
	(handle_alt): Map `M-f' and `M-b' to `forward_word' and
	`backward_word', respectively.
	(handle_ctrl): Map `C-Right' and `C-Left' to `forward_word' and
	`backward_word', respectively.

	* htmlengine-edit-movement.c
	(html_engine_forward_word): New function.
	(html_engine_backward_word): New function.

	* htmlcursor.c
	(html_cursor_goto_zero): More preconditions.
	(html_cursor_get_current_char): New function.

	* htmlengine-edit-fontstyle.c (merge_safely): Update the cursor
	offset if the cursor is in the object we are merging and we are
	prepending.

	* htmltextmaster.c (merge): Ooops.

	* htmlengine-edit-movement.c
	(html_engine_scroll_down): New function.
	(html_engine_scroll_up): New function.

2000-02-28  Paolo Molaro  <lupus@linuxcare.com>

	* gtkhtml.c: use GTK_TYPE_OBJECT instead of GTK_TYPE_POINTER
	  in signal creation for args that are objects.

2000-02-28  Larry Ewing  <lewing@helixcode.com>

	* htmlengine.c (parse_table): parse <th> correctly so that we
	don't end up with spurious blocks which cause cells to grow.

2000-02-27  Larry Ewing  <lewing@helixcode.com>

	* htmlimage.c (calc_preferred_width): return the width we calculate not
	the pixel_size.

	* htmltextslave.c (fit_line): eat up space we find at the start of lines.

2000-02-27  Ettore Perazzoli  <ettore@helixcode.com>

	* gtkhtml-keybinding.c (beginning_of_line): New function.
	(end_of_line): New function.
	(handle_ctrl): `C-a' moves to the beginning of the current line;
	`C-e' to the end.
	(handle_none): `GDK_Home' moves to the beginning of the current line;
	`GDK_End' to the end.

	* htmlengine-edit-movement.c (html_engine_end_of_line): New function.
	(html_engine_beginning_of_line): New function.

	* htmlengine-edit-movement.c: New file.
	* htmlengine-edit-movement.h: New file.

	* htmlcursor.c (html_cursor_end_of_line): New function.
	(html_cursor_beginning_of_line): New function.

	* htmlengine-edit.c (html_engine_jump_to_object): Removed.
	(html_engine_move_cursor): Removed.
	(html_engine_jump_at): Removed.

	* gtkhtml.c (key_press_event): Use `gtk_html_handle_key_event()'
	from `gtkhtml-keybinding.c'.

	* gtkhtml-keybinding.c: New file.
	* gtkhtml-keybinding.h: New file.

	* htmlengine-edit-delete.c: New file.
	* htmlengine-edit-delete.h: New file.

	* htmlengine-edit.c (html_engine_delete): Removed.

	* htmlengine-edit-fontstyle.c (split_safely): New helper function.
	This splits text and makes sure that the cursor's object pointer
	and offset are still valid after the split.
	(set_font_style_in_selection_forall): Use it.
	(set_font_style_in_selection_forall): Likewise.

	* htmlengine-edit-insert.c (html_engine_insert_para): Calc size on
	the two halves of the paragraph that gets splitted.

	* htmlcluev.c (do_layout): New helper function.
	(calc_size): Use it.
	(relayout): New function, implementation of
	`HTMLObject::relayout'.  It uses `do_layout', and relayouts
	objects in the clue without recalculating the size for each of
	them.
	(html_cluev_class_init): Install the new `relayout'
	implementation.

2000-02-26  Larry Ewing  <lewing@helixcode.com>

	* htmlclueh.c (calc_size): for HTML_VALIGN_TOP the clue->descent
	should be incremented rather than the clue->ascent to get the
	correct flow in the the remaining items.

2000-02-26  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlengine-edit-paste.c (html_engine_paste) [! PARANOID_DEBUG]:
	Removed ultra-verbose debugging messages.

	* gtkhtml.c (class_init): Setup
	"current_paragraph_alignment_changed".
	(update_styles): Emit it if the current paragraph alignment is
	changed.
	(init): Initialize `paragraph_alignment' to
	`GTK_HTML_PARAGRAPH_ALIGNMENT_LEFT'.
	(gtk_html_align_paragraph): New function.
	(paragraph_alignment_to_html): New helper function.
	(html_alignment_to_paragraph): New helper function.
	(gtk_html_cut): New function.
	(gtk_html_copy): New function.
	(gtk_html_paste): New function.
	(gtk_html_undo): New function.
	(gtk_html_redo): New function.
	(key_press_event): Use `gtk_html_{cut,copy,paste,undo,redo}'
	instead of `html_engine_{cut,copy,paste,undo,redo}'.

	* gtkhtml.h: New enum `GtkHTMLParagraphAlignment'. New signal
	"current_paragraph_alignment_changed".  New member
	`paragraph_alignment' in `GtkHTML'.

	* htmlengine-edit-clueflowstyle.c
	(html_engine_get_current_clueflow_alignment): New function.

	* gtkhtml.h: New enum `GtkHTMLParagraphAlignment'.

	* gtkhtml.c (update_styles): Emit "paragraph_indentation_changed"
	if the indentation changes.
	(class_init): Setup "paragraph_indentation_changed".
	(init): Initialize `paragraph_indentation' to 0.
	(gtk_html_indent): New functon.

	* gtkhtml.h: New signal "paragraph_indentation_changed".  New
	member `paragraph_indentation' in `GtkHTML'.

	* htmlengine-edit-clueflowstyle.c
	(html_engine_set_clueflow_style): New parameters `indentation',
	`alignment', `mask'.
	(set_clueflow_style_in_region_redo): Likewise.
	(set_clueflow_style): Likewise.  Handle indentation.
	(html_engine_get_current_clueflow_indentation): New function.

	* htmlclueflow.c (html_clueflow_indent): New function.
	(html_clueflow_set_halignment): New function.
	(html_clueflow_set_properties): New function.
	(html_clueflow_get_properties): New function.

	* htmlclueflow.c (write_indentation_tags_helper): New helper
	function.
	(write_indentation_tags): New helper function.
	(save): Use it to write the proper indentation tags.  Also, output
	a BR for everything except headers and paragraphs containting
	rulers.

	* htmlengine-save.c (html_engine_save): Initialize
	`last_quote_level' and `last_list_level' in the
	`HTMLEngineSaveState' struct to zero.

	* htmlengine-save.h: New members `last_quote_level' and
	`last_list_level' in `HTMLEngineSaveState'.

	* htmltextmaster.c (split): Set `select_length' and `select_start'
	to zero in the new element.

2000-02-25  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlengine-edit-insert (html_engine_insert_para): Removed some
	bogocode.

	* htmltext.c (split): Do return empty text elements if cutting at
	the very beginning or the very end of the object.
	* htmltextmaster.c (split): Likewise.

	* htmlengine-edit-fontstyle.c (set_font_style_in_selection) [!
	PARANOID_DEBUG]: Disabled debugging messages.

	* htmlobject.c (relayout): Do not relayout everything if the size
	did not change.

	* gtkhtml.c (update_styles): Use
	`html_engine_update_insertion_font_style()'.
	(key_press_event): Don't update the style when inserting text.

	* htmlengine-edit-fontstyle.c
	(html_engine_get_current_insertion_font_style): Removed.
	(html_engine_update_insertion_font_style): New function.

2000-02-24  Ettore Perazzoli  <ettore@helixcode.com>

	* gtkhtml.c (cleanup_selection_and_style): New helper function.
	(key_press_event): Use it when moving the cursor around.

	* htmlengine-edit-insert.c (do_insert_different_style): Handle the
	`offset == 0' case correctly.

	* htmlvspace.c (calc_size): Updated to return the boolean value.

	* htmltextmaster.c (calc_size): Always return FALSE.

	* htmltext.c (calc_size): Updated to return the boolean value.

	* htmltable.c (calc_size): Updated to return the boolean value.

	* htmlcluev.c (calc_size): Updated to return the boolean value.

	* htmlclueh.c (calc_size): Updated to return the boolean value.

	* htmlclueflow.c (calc_size): Updated to return the boolean value.

	* htmlcluealigned.c (calc_size): Updated to return the boolean
	value.

	* htmlclue.c (calc_size): Updated to return the boolean value.

	* htmlobject.c (relayout): Use the return value from
	`html_object_calc_size()' to decide if the element needs to be
	redrawn.
	(calc_size): Updated to return the boolean value.

	* htmlobject.h: Make `HTMLObject::calc_size' return a gboolean.
	If true, it means that the object has changed and needs to be re
	laid out and redrawn for interactive editing.

2000-02-24  Larry Ewing  <lewing@helixcode.com>

	* htmltable.c (calc_column_widths): fix a typo by replacing
	cell->padding with cell->spacing in the original calculation.
	
	* htmlgdkpainter.c (draw_pixmap): rewrite the clipping code to use
	irect_intersect.
	(draw_background_pixmap): use gdk_pixbuf_render_to_drawable_alpha
	to get proper alpha clipping.
	(create_temporary_pixbuf): remove x and y args and the associated
	checking because they are no longer needed.
	
	* htmltablecell.c (draw): properly discount cell->padding for the
	background color and pixmap.  If a background color is set paint
	it even if a background pixmap is set so that we have the correct
	background for the transparent regions.

2000-02-24  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlclue.c (html_clue_append_after): Added preconditions.

	* htmltext.c (insert_text): Do not relayout the parent if it's
	NULL.

	* htmlengine-edit.c (html_engine_insert_para): Removed.
	(html_engine_insert): Removed.
	* htmlengine-edit-insert.c: Moved here, with the related helper
	functions.

	* htmlengine-edit-insert.h: New file.
	* htmlengine-edit-insert.c: New file.

	* gtkhtml.c (button_release_event): If ending a selection, update
	the style status.

	* htmlengine-edit-fontstyle.c
	(get_font_style_from_selection_forall): New helper function.
	(get_font_style_from_selection): New helper function; it
	calculates the attributes to display in the editor when a region
	is selected.
	(html_engine_get_current_insertion_font_style): Use it when we
	have an active selection.

	* gtkhtml.c (key_press_event): Unselect all when moving, inserting
	or deleting stuff.
	(motion_notify_event): Move the insertion cursor where the pointer
	is if the engine is editable.

	* htmlengine-edit-fontstyle.c (merge_safely): New function to
	merge, destroy and update the cursor if necessary.
	(merge_backward): Use it.
	(merge_forward): Likewise.

	* htmlengine-edit-fontstyle.c (merge_backward): Merge with
	`prepend' set to TRUE so that we don't destroy the current object.

	* htmltextmaster.c (merge): Match the new `HTMLText::merge'.

	* htmltext.c (html_text_merge): Match the new `HTMLText::merge'.
	(merge): Likewise.  Added precondition: the two objects must have
	the same type.

	* htmltext.h: New arg `prepend' to `HTMLText::merge'.  Take a
	single object instead of a list as a parameter.

2000-02-23  Ettore Perazzoli  <ettore@helixcode.com>

	* htmllinktextmaster.c (split): Rewritten to use
	`html_text_split()'.

	* htmltextmaster.c (split): Rewritten to use `html_text_split()'.

	* htmltext.c (split): Instead of creating the new item with
	`html_text_master_new()', use `g_malloc()' and the `size' member
	in the class description struct; then initialize with
	`html_text_master_init()'.  This way, it's easier to derive the
	method in the subclass.

2000-02-22  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlengine-edit-fontstyle.c (merge_forward): Do not to attempt
	to merge with elements that are not of the same type.
	(merge_backward): Likewise.

2000-02-22 Elliot Lee  <sopwith@redhat.com>

	* htmlimageinput.c, htmllinktext.c, htmlselect.c, htmlsettings.c,
	  htmltable.c, htmltextarea.c: #include <string.h>

2000-02-22  Ettore Perazzoli  <ettore@helixcode.com>

	* gtkhtml.c (key_press_event): Do not update styles if the
	keypress was not handled.
	(update_styles): Kick me.

	* htmlengine-edit-fontstyle.c
	(html_engine_get_current_insertion_font_style): A
	`GTK_HTML_FONT_STYLE_DEFAULT' is always overridden by the
	element's font style.

	* gtkhtml.c (class_init): Set up signal
	"insertion_font_style_changed".
	(update_styles): Deal with the font style too.

	* gtkhtml.h: New signal "insertion_font_style_changed".  New
	member `insertion_font_style'.

2000-02-21  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlengine.c (html_engine_update_event): Do not draw if the
	painter is not realized.  This is a quick and dirty fix, I am not
	sure what is going on in here.

	* htmlgdkpainter.c (html_gdk_painter_realized): New function.

	* htmltext.c (check_merge): New function, implementation of
	`HTMLText::check_merge'.
	(html_text_class_init): Install it.

	* htmltext.h: New virtual method `HTMLText::check_merge'.

	* htmlengine-edit-fontstyle.c (html_engine_set_font_style):
	Changed parameters: get an AND mask and an OR mask for modifying
	the style.
	(set_font_style_in_selection_forall): Use a SetFontStyleForallData
	closure, so that we can store both masks.
	(set_font_style_in_selection): Likewise.
	* gtkhtml.c (gtk_html_set_font_style): Likewise.

	* htmltextmaster.c (merge): Completed code to preserve selection
	when merging.
	(split): Preserve selection here too.

	* htmlengine-edit-fontstyle.c
	(set_font_style_in_selection_forall): Make it work.

	* htmlembedded.c (html_embedded_grab_cursor): Removed spurious
	debugging message.

	* gtkhtml.c (gtk_html_allow_selection): New function.
	(init): Initialize `allow_selection' to TRUE.
	(button_press_event): Do not grab the pointer if `allow_selection'
	is FALSE.
	(realize): Removed spurious `g_message()'.

	* gtkhtml.h: New member `allow_selection'.

	* htmllinktext.c (html_link_text_new): Get rid of some
	ultra-verbose debugging messages.

	* All files: use the new `gtk_html_debug_log()' call instead of
	plain `g_print()'.

	* htmlcursor.c (debug_location): Always compile this in,
	unconditionally.  At least for now.  Also, new parameter `html':
	use `gtk_html_debug_log()'.

2000-02-20  Ettore Perazzoli  <ettore@helixcode.com>

	* debug.h: Renamed to `gtkhtmldebug.h'.
	* debug.c: Renamed to `gtkhtmldebug.c'.

	* gtkhtml.c (gtk_html_enable_debug): New function.

	* gtkhtml.h: New member `debug' in `GtkHTML'.

2000-02-19  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlfontstyle.h, htmlfontstyle.c: Removed.
	* gtkhtmlfontstyle.h, gtkhtmlfontstyle.c: New replacements.  We
	now use `GtkHTMLFontStyle' instead of `HTMLFontStyle' throughout,
	so that the values can be exposed to the API.

	* gtkhtml.c (font_style_to_internal): New helper function.
	(gtk_html_set_font_style): New function.

	* gtkhtml.h: New enum `GtkHTMLFontStyle'.

	* htmlengine-edit-fontstyle.c: New file.
	* htmlengine-edit-fontstyle.h: New file.

	* htmlengine-edit-paste.c: #include "debug.h".

2000-02-20  Jonas Borgstrm  <jonas_b@bitsmart.com>

	* htmlclueflow.c (calc_min_width): Don't do any wrapping with the 
	HTML_CLUEFLOW_STYLE_NOWRAP style.

	* htmlclueflow.h: Added new style HTML_CLUEFLOW_STYLE_NOWRAP.

	* htmlengine.c (parse_table): Use style HTML_CLUEFLOW_STYLE_NOWRAP on
	tablecells with the "nowrap" keyword.

	* htmltextmaster.c (calc_min_width): Don't do any wrapping with the 
	HTML_CLUEFLOW_STYLE_NOWRAP style.

	* testgtkhtml.c: Added tests/test11.html.

	* tests/test1.html: New testcase for tables with the "nowrap" keyword.	
	
2000-02-20  Jonas Borgstrm  <jonas_b@bitsmart.com>
	
	* htmlcheckbox.c (encode): New function.
	(html_checkbox_init): Set value to "on" if it's NULL.
	Use ftk_check_button instead of gtk_toggle_button.
	
	* htmlengine.c (parse_input): Pass &e->form->radio_group to html_radio_new ().
	
	* htmlform.c (html_form_new): Initialize form->radio_group to ZERO.
	
	* htmlform.h: (GSList *radio_group) new member, it is used by the radio 
	buttons on the form.

	* htmlradio.c (encode): New function.
	(html_radio_new, html_radio_init): New argument: GSList **radio_group.
	(html_checkbox_init): Set value to "on" if it's NULL.

	* htmlradio.h: Changed the arguments for html_radio_new and html_radio_init.

	* tests/test9.html: Added <imput type=radio> Testcase.


2000-02-19  Ettore Perazzoli  <ettore@helixcode.com>

	* htmltext.c (html_text_set_font_style): New function.
	(html_text_set_color): New function.
	(set_font_style): New function, implementation of
	`HTMLText::set_font_style'.
	(set_color): New function, implementation of
	`HTMLText::set_color'.
	(html_text_class_init): Install implementations.

	* htmltext.h: New virtual methods `HTMLText::set_color' and
	`HTMLText::set_font_style'.

	* htmltextmaster.c (merge): New function, implementation of
	`HTMLText::merge'.

	* htmltext.c (merge): New function, default (non) implementation
	of `HTMLText::merge()'.
	(html_text_class_init): Install it.

	* htmltext.h: New virtual method `HTMLText::merge'.

	* htmlengine.h: New member `insertion_font_style'.

	* htmlengine-edit-styles.c: Renamed to `htmlengine-edit-styles.c'.
	* htmlengine-edit-styles.h: Renamed to `htmlengine-edit-styles.h'.

2000-02-16  Ettore Perazzoli  <ettore@helixcode.com>

	* gtkhtml.c (key_press_event): Temporarily bind `GDK_F3' to
	"cut", `GDK_F4' to "copy" and `GDK_F5' to "paste".

	* htmlengine-edit-paste.c: New file.
	* htmlengine-edit-paste.h: New file.

	* htmltextmaster.c (get_selection): New function, implementation
	of `HTMLObject::get_selection'.
	(html_text_master_class_init): Install the implementation.

	* htmlclue.c (forall): Call the function on self after calling
	it on all the objects, instead of doing it before.

	* htmltextslave.c (select_range): New function, implementation of
	`HTMLObject::select_range'.  Do nothing and always return FALSE,
	so that the object can never be selected in any way.
	(html_text_slave_class_init): Install implementation.

	* htmlengine-edit-copy.c (html_engine_copy): New function.

	* htmltextslave.c (calc_size): Removed newline stuff.
	(draw_newline_highlight): Removed.
	(draw_highlighted): Removed newline stuff.
	(draw): Removed newline stuff.
	(check_newline): Removed.

	* htmltextmaster.c (select_range): Removed newline stuff.

	* htmltext.c (calc_size): Removed newline stuff.
	(have_newline): Removed.
	(html_text_have_newline): Removed.

	* htmltext.h: Removed virtual method `have_newline'.

2000-02-15  Ettore Perazzoli  <ettore@helixcode.com>

	* htmltextinput.c: `parent_class' should be `HTMLEmbeddedClass *',
	not `HTMLEmbedded *'.

	* htmlobject.c (html_object_get_selection): New function.
	(get_selection): New function, default implementation of
	`HTMLObject::get_selection'.
	(html_object_class_init): Install it.

	* htmlobject.h: New virtual method `HTMLObject::get_selection'.

	* All object implementations: implement `HTMLObject::copy'.  Also,
	keep track of the parent's class where not done already.

	* htmlobject.c (copy): New function, default implementation of
	`HTMLObject::copy'.
	(html_object_class_init): Install it.
	(html_object_copy): New function.
	(html_object_dup): New function.

	* htmlobject.h: New virtual method `HTMLObject::copy'.

	* htmlembedded.c (html_embedded_type_init): Use
	`HTML_TYPE_EMBEDDED', not `HTML_TYPE_ELEMENT'.

	* htmltype.h: s/HTML_TYPE_ELEMENT/HTML_TYPE_EMBEDDED/.
	* htmltype.c (html_type_name): Updated accordingly.

	* All object implementations: Use the `object_size' parameter.

	* htmlobject.c (html_object_class_init): New parameter
	`object_size'.

	* htmlobject.h: New member `object_size' in `HTMLObjectClass'.

	* htmlobject.h: New virtual methods `HTMLObject::copy',
	`HTMLObject::get_selection'.

	* htmlengine-edit-cut.c: New file.
	* htmlengine-edit-cut.h: New file.

	* htmlengine-edit-copy.c: New file.
	* htmlengine-edit-copy.h: New file.

2000-02-14  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlengine.c (html_engine_init): Initialize `cut_buffer' as
	NULL.
	(html_engine_destroy): Destroy the cut buffer, if any.

	* htmlengine.h: New member `cut_buffer'.

	* htmlengine-edit.c (html_engine_undo): Freeze before undoing,
	thaw afterwards.
	(html_engine_redo): Freeze before redoing, thaw afterwards.

	* htmlobject.c (relayout): Do nothing if the engine is frozen.

	* htmlengine.c (html_engine_init): Initialize `freeze_count'.
	(html_engine_freeze): New function.
	(html_engine_thaw): New function.
	(html_engine_frozen): New function.
	(html_engine_queue_draw): Actually queue only if the engine is not
	frozen.
	(html_engine_queue_clear): Likewise.

	* htmlengine.h: New member `freeze_count' in `HTMLEngine'.

	* htmlengine-cutbuffer.c: New file.
	* htmlengine-cutbuffer.h: New file.

	* htmlengine-edit-styles.c: Implemented paragraph style selection
	in a region, with undo/redo support.

	* htmlengine.c: New member `active_selection' in
	`SelectRegionData'.
	(html_engine_init): Initialize `active_selection' to FALSE.
	(html_engine_unselect_all): Set `active_selection' to FALSE.
	(select_region_forall): Set `active_selection' in the selection
	data to TRUE as soon as at least an item is selected.
	(html_engine_select_region): Copy `active_selection' from the
	selection data to the engine.

	* htmlengine.h: New member `active_selection' in `HTMLEngine'.

2000-02-13  Miguel de Icaza  <miguel@gnu.org>

	* htmlengine.c (html_engine_draw): Do not paint if the width or
	the height are zero.  Fixes crash (as this case is also window == NULL).

2000-02-12  Joe Shaw <joe@helixcode.com>

	* gtkhtml-embedded.c (gtk_html_set_parameter): g_strdup the parameter
	name because we cannot assume that it won't be freed during the life
	of the application.
	* gtkhtml-embedded.c (free_param): Added freeing of the key.

2000-02-12  Joe Shaw <joe@helixcode.com>

	* gtkhtml.c (expose): Did the same thing as I did with the draw
	method; see below.

2000-02-11  Joe Shaw <joe@helixcode.com>

	* gtkhtml.c (draw): Fixed a bug where embedded widgets were not being
	repainted correctly; the widget was updating all of its child widgets 
	and then painting over them. The order has been switched; thus, the 
	widget repaints itself first and then its child widgets are redrawn.
	
	* htmlembedded.c (html_embedded_new_widget): Connected the 
	button_press_event signal to a new handler, html_embedded_grab_cursor,
	that does not propagate up the tree so that embedded text widgets, 
	such as GtkEntry, retain the cursor.

2000-02-10  Ettore Perazzoli  <ettore@helixcode.com>

	* gtkhtml.c (gtk_html_set_paragraph_style): New function.
	(button_press_event): Update styles when moving the cursor
	position at a mouse click.

	* htmlengine-edit-styles.c
	(html_engine_set_clueflow_style): New function.

	* htmlclueflow.c (html_clueflow_set_style): New function.

	* gtkhtml.c (update_styles): New helper function.
	(clueflow_style_to_paragraph_style): New helper function.
	(class_init): Install new signal
	`current_paragraph_style_changed'.
	(init): Initialize `paragraph_style' to
	`GTK_HTML_PARAGRAPH_STYLE_NORMAL'.

	* gtkhtml.h: New enum `GtkHTMLParagraphStyle'.  New signal
	`current_paragraph_style_changed'.  New member
	`GtkHTMLParagraphStyle'.

	* htmlengine-edit-styles.c: New file.
	* htmlengine-edit-styles.h: New file.

	* htmlengine-edit.c (html_engine_insert): Avoid inserting anything
	if the current object is NULL.

	* htmlundo.c (html_undo_add_undo_action): Update the stack size
	value when removing an element.

2000-02-09  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlengine-edit.c (html_engine_insert): Support undo.

	* gtkhtml.c (key_press_event): (Temporarily) bind F1 to "undo", F2
	to "redo".

	* htmlengine-edit.c (html_engine_undo): New function.
	(html_engine_redo): New function.

	* htmlengine.c (html_engine_init): Initialize `undo'.
	(html_engine_destroy): Destroy it.

	* htmlengine.h: New member `undo' in `HTMLEngine'.

	* htmlundo-action.c: New file.
	* htmlundo-action.h: New file.

	* htmlundo.c: New file.
	* htmlundo.h: New file.

	* htmlcursor.c (html_cursor_goto_zero): New function.

	* htmlengine-edit.c (html_engine_jump_to_object): Use
	`html_cursor_jump_to()'.

	* htmlcursor.c (html_cursor_copy): New function.
	(html_cursor_dup): Use it.
	(html_cursor_up): Use it instead of doing direct C assignments
	between the structs.
	(html_cursor_down): Likewise.
	(html_cursor_jump_to): New function.  It is necessary to jump to a
	position while keeping the relative position value intact.
	(html_cursor_home): Reset relative position.

	* htmlcursor.c (html_cursor_new): Initialize `relative_position'.
	(html_cursor_get_relative): New function.
	(html_cursor_reset_relative): New function.
	(html_cursor_home): Set relative position to zero.
	(forward): Increment relative position if successfull.
	(backward): Decrement relative position if successfull.
	(html_cursor_up): Update relative position.
	(html_cursor_down): Likewise.
	(debug_location): Print relative position too.
	(_HTML_CURSOR_DEBUG): Enable.

	* htmlcursor.h: New member `relative_position'.

2000-02-08  Ettore Perazzoli  <ettore@helixcode.com>

	* htmltable.c (calc_min_width): Call `calc_col_info()' before
	returning the value.
	(calc_preferred_width): Likewise.

	* htmlprinter.c (draw_panel): Implemented.  It does actually just
	draws a rectangle for now.
	(class_init): Install it.
	(PIXEL_SIZE): Changed to .5.

	* htmlengine-print.c (html_engine_print): When you call
	`html_engine_calc_size()', it uses `html_object_calc_min_size()'
	to decide the layout width, but the minimum HTMLTable width does
	not really change before you call `html_object_calc_size()' on it.
	So, we have to add an extra call to `html_engine_calc_size()'
	here, to make sure the minimum width is correct when we go back
	from the GnomePrint painter to the GDK one.

	* htmlengine.c (parse_h): Optimize and make more readable the
	H[1-6] checks.

2000-02-07  Ettore Perazzoli  <ettore@helixcode.com>

	* htmltable.c (calc_preferred_width): Do not calc_size.
	(calc_min_width): Likewise.

2000-02-04  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlimage.c (calc_min_width): Fixed brainos.

	* htmltablecell.c (html_table_cell_new): Removed parameters `x'
	and `y'.  Renamed `max_width' to `specified_width'
	(html_table_cell_init): Likewise.

	* htmlimage.c (get_actual_width): New param `painter'.  The
	returned value is now expressed in painter units, instead of image
	pixel units.
	(get_actual_height): Likewise.
	(calc_preferred_width): Updated accordingly.
	(calc_min_width): Updated accordingly.
	(calc_size): Updated accordingly.
	(draw): Updated accordingly.

	* htmlimage.c (draw): Draw an highlighted pixmap when selected.

	* htmlgdkpainter.c (draw_pixmap): Fixed to handle the composition
	color more nicely.

2000-02-03  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlprinter.c (draw_text): Use `gnome_font_get_underline_position()'
	and `gnome_font_get_underline_thickness()' to get the
	strikeout/underline line right.

	* htmlprintfontmanager.c (load_font): Changed default font size
	from 12 pt. to 10 pt.

	* htmlprinter.c (begin): Do a gsave and setup a clip region.
	Also, paint a rectangle around the clip region to make debugging
	easier.
	(end): Do a grestore.
	(draw_line): Added missing `gnome_print_newpath()' call.
	(draw_rect): Likewise.
	(fill_rect): Likewise.
	(draw_text): Likewise.

	* htmlclueflow.c (check_page_split): New function, implementation
	of `HTMLObject::check_page_split'.
	(html_clueflow_class_init): Install it.

	* htmlcluev.c (check_page_split): New function, implementation of
	`HTMLObject::check_page_split()'.
	(html_cluev_class_init): Install it.

	* htmlobject.c (html_object_check_page_split): New function.
	(check_page_split): New function, default implementation for
	`HTMLObject::check_split'.
	(html_object_class_init): Install it.

	* htmlprinter.c (html_printer_get_page_height): New function.

	* htmlobject.h: New virtual method `HTMLObject::check_split'.

	* htmlprinter.c (draw_pixmap): Convert RGBA into RGB if necessary.

	* htmlobject.c (calc_min_width): Calc size before returning the
	width.
	(calc_preferred_width): Likewise.
	* htmlrule.c (calc_min_width): Likewise.
	* htmltable.c (calc_min_width): Likewise.
	(calc_preferred_width): Likewise.

	* htmlimage.c (draw): Multiply scaled width/height by the pixel
	size.

	* htmlprinter.c (draw_pixmap): Implemented.

	* htmlimage.c (draw): Take advantage of `scale_width',
	`scale_height', `color' in `html_painter_draw_pixmap()'.
	(html_image_update_scaled_pixbuf): Removed.
	(html_image_setup): Removed.
	(html_image_factory_area_updated): Removed.
	(html_image_factory_register): Do not connect "area_updated"
	anymore.
	(html_image_factory_end_pixbuf): Don't do any scaled-related stuff
	anymore.
	(html_image_factory_area_prepared): Always schedule an update.

	* htmlgdkpainter.c (draw_pixmap): Updated to use the new
	parameters.
	* htmlprinter.c (draw_pixmap): Likewise.

	* htmlpainter.c (html_painter_draw_pixmap): New params
	`scale_width', `scale_height', `color'.  Removed clipping params.

	* htmlpainter.h: New params `scale_width', `scale_height', `color'
	and removed clipping params in virtual method
	`HTMLPainter::draw_pixmap'.

	* htmlimage.c: Cleaned up the mess.
	(html_image_init): Removed arg `max_width'.  Simplified to just do
	what it should do.
	(html_image_new): Updated accordingly.
	(get_actual_width): New helper function.
	(get_actual_height): New helper function.
	(calc_size): Actually do what expected to.
	(calc_preferred_width): Likewise.
	(calc_min_width): Likewise.
	(set_max_width): Removed.
	(html_image_class_init): Do not install anymore.

	* htmlimage.h: Get rid of `predefinedWidth', `predefinedHeight',
	`engine', `scaled' and `scaled_pixbuf'.  New members
	`specified_width', `specified_height'.

2000-02-02  Ettore Perazzoli  <ettore@helixcode.com>

	* htmltablecell.c (html_table_cell_set_width): New arg
	`painter'.

	* htmlobject.h: New argument `painter' in virtual methods
	`set_max_ascent', `set_max_descent', `set_max_width'.

	* htmlclueflow.c: Removed hardcoded values `VERTICAL_PAD',
	`BULLET_SIZE', `BULLET_HPAD', `BULLET_VPAD', `INDENT_UNIT'.
	(add_pre_padding): Added arg `pad'.
	(add_post_padding): Likewise.
	(calc_padding): New function.
	(calc_size): Use it.
	(get_indent): New arg `painter'.
	(set_max_width): New arg `painter'.
	(calc_indent_unit): New function.
	(get_indent): Use it.
	(calc_bullet_size): New function.
	(get_indent): Use it.
	(draw): Use it.

	* htmlobject.h: Size-related members in `HTMLObject' changed to be
	`gint's instead of `gshort's.

2000-02-01  Ettore Perazzoli  <ettore@helixcode.com>

	* testgtkhtml.c: Added a "print preview" menu item.
	(print_preview_cb): Callback for the menu: it does the preview.

	* gtkhtml.c (gtk_html_print): New function.

	* htmlengine-print.c: New file, implementing printing for
	HTMLEngine.
	* htmlengine-print.h: Corresponding header file.

	* htmlprintfontmanager.c: New file, implementing the font manager
	for HTMLPrinter.
	* htmlprintfontmanager.h: Corresponding header file.

	* htmlprinter.c: New file, implementing a HTMLPainter suitable for
	printing.
	* htmlprinter.h: Corresponding header.

	* htmlclueflow.c (html_clueflow_init): Removed parameter `font'.
	(html_clueflow_new): Likewise.

	* htmlclueflow.h: Removed member `font'.

	* htmlgdkpainter.c: Use `htmlgdkfontmanager.c' instead of
	`htmlfontmanager.c'.

	* All files: updated to use `htmlfontstyle.c' and
	`htmlfontstyle.c' instead of `htmlfontmanager.c' and
	`htmlfontmanager.h' for HTMLFontStyle handling.

	* htmlfontstyle.h: New file.
	* htmlfontstyle.c: New file.

	* htmlgdkfontmanager.c: New file.
	* htmlgdkfontmanager.h: New file.

	* htmlfontmanager.c: Removed.
	* htmlfontmanager.h: Removed.

	* htmlengine.c: Updated to use `HTMLGdkPainter' instead of the
	old `HTMLPainter'.
	* htmlengine.h: Likewise.

	* htmlgdkpainter.c: New file, an HTMLPainter-derived class
	implementing a GDK-based painter.
	* htmlgdkpainter.h: Header for it.

	* htmlpainter.c: Rewritten as an abstract GTK+ class.
	* htmlpainter.h: Likewise.

	* htmlengine.c (html_engine_parse): No need to allocate the
	settings' colors anymore.

	* htmlpainter.c (html_painter_get_window): Removed.
	(html_painter_alloc_color): Updated to work without it.
	(html_painter_free_color): Likewise.

2000-01-30  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlengine.c (check_prev): Take account for the color too.
	(insert_text): Updated accordingly.
	(parse_b): Use `e->settings->vLinkColor' for vlink colors, instead of
	`e->settings->linkColor'.

2000-01-29  Ettore Perazzoli  <ettore@helixcode.com>

	* htmldrawqueue.c (clear_element_new_with_background): Use the
	return value from `gdk_pixbuf_ref()'.  It is not void anymore;
	please update to the latest gdk-pixbuf if you do GtkHTML
	development.
	* htmlimage.c (draw): Likewise.

2000-01-29  Jonas Borgstrm <jonas_b@bitsmart.com>

	* htmlengine.c (insert_text): Use e->settings->linkColor as the color
	for links.

	* htmldrawqueue.c (clear_element_new_with_background): gdk_pixbuf_ref ()
	returns void don't use the return value.

2000-01-28  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlengine.c (parse_color): New function to parse colors.  If
	`gdk_color_parse()' fails, it prepends a `#' and tries again.
	(parse_table): Use `parse_color()' instead of `gdk_color_parse()'.
	(parse_b): Likewise.
	(parse_f): Likewise.

	* htmltokenizer.c (html_tokenizer_new): Initialize all the members
	of the struct individually.

	* htmltextmaster.c (select_range): Take account for newline
	selection when deciding whether to redraw or now.

	* htmltextslave.c (draw): Consider a line that only has the
	newline highlighted as highlighted.

	* htmlengine.c (insert_text): Refuse to insert leading white space
	if we have no paragraph, if there is a pending paragraph or if the
	current clueflow is empty.
	(is_whitespace): Removed.

	* htmlengine.h: Made `avoid_para' and `pending_para' plain
	booleans (no longer 1 bit wide) because debugging is easier this
	way.

	* htmlengine.c (parse_d): Close the flow and set a pending
	paragraph instead of adding a newline.
	(insert_text): Skip all the leading whitespace if we are about to
	create a new paragraph. 

2000-01-28  NotZed  <notzed@zedzone.helixcode.com>

	* tests/test10.html: A simple test driver for embedded widgets.

2000-01-28  Ettore Perazzoli  <ettore@helixcode.com>

	* htmltextslave.c (calc_size): Inconditionally add the width of a
	space.

	* htmltextmaster.c (calc_min_width): Add the width of a space.

	* htmlengine.c (html_engine_parse): Initialize
	`pending_para_alignment' to `HTML_HALIGN_LEFT'.
	(insert_paragraph_break): New parameter `align'.

	* htmlengine.h: New member `pending_para_alignment' in
	`htmlengine.h'.

	* htmlengine.c (parse_table): Restore quote and list level and
	flow pointer before adding the table to the tree.

	* debug.c (debug_dump_tree): Also print the list/quote level for
	HTMLClueFlows.

	* testgtkhtml.c (object_timeout): Added `GTK_WIDGET()' cast.
	(object_requested_cmd): Likewise.  Also, added a `GtkFunction'
	cast.

	* htmlembedded.c (html_embedded_new_widget): Removed unused
	variables.

	* htmlengine.c (parse_o): Added a `GTK_WIDGET()' cast to placate
	the compiler.

	* htmlclue.c (destroy): Use an HTMLClue pointer instead of an
	HTMLObject one, to prevent a warning.

2000-01-27  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlengine-edit.c (html_engine_insert_para): Use both
	`list_level' and `quote_level'.

	* htmlengine.c (html_engine_init): Init `quote_level',
	`list_level'.
	(block_end_list): Renamed to `block_end_level'.  Set `list_level'
	and `quote_level'.
	(block_end_indent): Renamed to `block_end_quote'.  Use
	`quote_level'.
	(parse_table): Restore both `quote_level' and `list_level'.
	(parse_d): Increase `list_level' for `<dir>'.  (I am not sure how
	to handle this for now.)  Increase/decrease `quote_level' for
	`<dl>', `<dd>' and `<dt>'.
	(parse_l): Use `list_level' and `quote_level' when creating the
	new clueflow.
	(parse_o): Use `list_level' for `<ol>'.
	(parse_u): Use `quote_level' for `<ul>'.
	(parse_b): Use `quote_level' for `<blockquote>'.

	* htmlengine.h: `indent' replaced by `quote_level', `list_level'.

	* htmlclueflow.c (html_clueflow_new): New params `list_level',
	`quote_level'.
	(html_clueflow_init): Likewise.
	(add_pre_padding): A change in quote level always adds a space.  A
	change in list level works like before.
	(add_post_padding): Likewise.
	(draw): Updated to just use `list_level' for deciding the bullet's
	shape.
	(get_indent): Updated to use `list_level' and `quote_level'.

	* htmlclueflow.h: Member `level' replaced by `list_level',
	`quote_level'.

	* htmlengine.c (parse_u): Insert a paragraph break if a paragraph
	space is pending and the indentation level is greater than zero.
	(block_end_list): Only erase pending paragraph spaces and prohibit
	new paragraphs if the indentation level is equal to zero.

	* htmltextmaster.c (check_point): Select the newline.

	* htmltextslave.c (calc_size): Add the size of a space if this is
	the last slave of a newline'd text master.
	(draw_newline): New helper function.
	(draw_normal): Draw a space by using it, if we are before a new
	line.
	(draw_highlighted): Likewise.

	* htmltext.c (html_text_have_newline): New function.
	(have_new_line): New function, default implementation of
	`HTMLText::have_newline'.
	(html_text_class_init): Install it.
	(calc_size): If the object has a new line add the width of a space
	to it.

	* htmltext.h: New virtual method `HTMLText::have_newline'.

2000-01-26  Michael Zucchi  <notzed@zedzone.helixcode.com>

	* Makefile.am (libgtkhtml_HEADERS): Renamed htmlelement.h,
	to htmlembedded.h, added gtkhtml-embedded.h.

	* testgtkhtml.c (object_requested_cmd): Add a signal handler for
	testing custom widgets using the object specifier.

	* htmlengine.c (html_engine_class_init): Create object_requested
	signal.

	* gtkhtml.c (gtk_html_new): Link to object_requested signal of
	htmlengine to proxy the call.
	(class_init): Create the new object_requested signal.
	(html_engine_object_requested_cb): Implement the signal proxy.

	* htmlengine.c (html_engine_stop_parser): Clear timerID if we
	remove the timeout.
	(html_object_changed): Use schedule_update to update, dont update
	directly.

	* htmlembedded.c (html_embedded_size_recalc): Force a size
	recalculation of an embedded widget.
	(html_embedded_new_widget): Create a new html embedded element
	from a htmlembedded widget.

	* htmlelement.[ch]: Renamed to htmlembedded.[ch], should probably
	be somehting more different to gtkhtml-embedded, but its not that
	hard to change.
	
	* htmlengine.c (html_engine_init): Initialise the embeddedStack, a
	stack of gtkhtmlembedded widgets.
	(html_engine_destroy): Destroy the embeddedStack.

	* gtkhtml.h: Added object_requested signal, for embedding widgets.

	* htmlengine.h (HTMLEngine): Added embeddedStack for embedded
	widgets.
	(HTMLEngineClass): Added object_requested signal, for embedding
	object widgets.

	* htmlengine.c (html_object_changed): Called when an embedded
	changes, causes a re-layout.  This should probably be queued until
	an idle time.
	(parse_o): Added support for <OBJECT> element.  Returns a callback
	"object_requested" to application.  The semantic of having
	alternative text for non-instantiationable objects is not
	implemented.
	(parse_p): Added <PARAM> element, for object parameters.

	* gtkhtml-embedded.c/h: New object.  A container object for
	embeddeing custom widgets into gtk-html.  It basically notifies
	the caller when its content or layout information about it
	changes.

2000-01-26  Ettore Perazzoli  <ettore@helixcode.com>

	* htmllinktextmaster.c (save): New function, implementing
	`HTMLObject::save'.
	(html_link_text_master_class_init): Install it.

	* htmllinktext.c (save): New function, implementing
	`HTMLObject::save'.
	(html_link_text_class_init): Install it.

	* htmlrule.c (save): New function, implementing
	`HTMLObject::save'.
	(html_rule_class_init): Install it.

	* htmlengine-save.c (encode_entities): `&apos;' is not valid in
	HTML.  Removed (now) unused variable `html'.

	* htmlengine-save.c (write_header): Use uppercase tags for consistency.
	(write_end): Likewise.

	* htmltext.c (get_tags): New helper functions to get the font
	style tags associated with the text element.

	* htmlclueflow.c (save): New function, implementation of
	`HTMLObject::save'.  Add the proper start/end tags according to
	the clueflow's style.
	(html_clueflow_class_init): Install this method implementation.
	(get_tag_for_style): New helper function to get the tag associated
	with a specific style.

	* htmlclue.c (save): New function, implementation of
	`HTMLObject::save'.  It saves all the children.
	(html_clue_class_init): Install this method implementation.

	* htmlengine-save.c (write_header): New function to write the
	start of the HTML file.
	(write_end): New function to write the end of the HTML file.
	(html_engine_save): Use them.
	(save_forall): Removed.
	(html_engine_save): Just save the main (vertical) clue.

	* htmlengine-save.c (html_engine_save_output_string): New function
	to write a plain, unencoded string.

	* htmltext.c (save): Use `html_engine_save_encode()' to write the
	string encoded with entities.

	* htmlengine-save.c (encode_entities): New helper function to
	encode a string through entities.
	(html_engine_save_encode): New function to write an encoded
	buffer.
	(html_engine_save_encode_string): New to write an encoded
	zero-terminated string.

2000-01-25  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlclue.c (destroy): Always ensure the tree is in a valid state
	by removing the clue node before destroying it.

2000-01-25  Ettore Perazzoli  <ettore@helixcode.com>

	* gtkhtml.c (idle_handler): Call `gtk_html_calc_scrollbars' to
	update the scrollbars.

	* gtkhtml.c (gtk_html_save): New function.

	* htmltext.c (save): New function, implementation of
	`HTMLObject::save'.  For now, it just dumps the text.
	(html_text_class_init): Install it.

	* htmlcursor.c (html_cursor_home): Removed debugging message.

	* htmlobject.c (html_object_save): New function.
	(save): New function, default implementation of
	`HTMLObject::save'.
	(html_object_class_init): Install it.

	* htmlobject.h: New virtual method `HTMLObject::save'.

	* htmlengine-save.h: New file.
	* htmlengine-save.c: New file.

	* htmlengine.c (html_engine_set_editable): Move the cursor to the
	home if the widget becomes editable.  Also, if the editable state
	changes, redraw the whole thing.
	(html_engine_timer_event): Move the cursor home.
	(html_engine_update_event): Move the cursor home at the end of
	parsing.

	* testgtkhtml.c (goto_url): Do not call `gtk_html_parse()'
	anymore.

	* gtkhtml.c (init): Initialize `editable' to `FALSE'.
	(gtk_html_parse): Turned into a dummy.
	(gtk_html_begin): Call `html_engine_parse()' too.  Also set
	`load_in_progress' to `TRUE' and the engine's editable state to
	`FALSE'.
	(gtk_html_end): Set `load_in_progress' to `FALSE'.  Set the
	engine's editable state according to the value of the `editable'
	member.
	(gtk_html_set_editable): New function.
	(gtk_html_get_editable): New function.

	* gtkhtml.h: New members `editable', `load_in_progress' in
	`GtkHTML'.

	* Makefile.am (libgtkhtmldir): Never compile the HTML component.

	* htmlengine.c (html_engine_timer_event): No longer do the ugly
	font saving/restoring trick.  I actually don't understand why it
	was there.

	* htmldrawqueue.c (draw_obj): Don't draw the cursor here as the
	idle loop handler will take care of it.

	* gtkhtml.c (key_press_event): Don't move the cursor forward when
	inserting text, as `html_engine_insert()' now does this.

	* htmlengine-edit.c (html_engine_insert): Move the cursor forward.

2000-01-24  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlimage.c (accepts_cursor): New function, implementation of
	`HTMLObject::accepts_cursor'.  It always returns `TRUE', so that
	we can actually move the cursor to an image and edit it.
	(html_image_class_init): Install it.

	* htmlengine-edit.c (merge_text_at_cursor): Fix merging.

	* htmlcursor.c (html_cursor_dup): New function to duplicate a
	cursor.

	* gtkhtml.c (focus_in_event): New function, implementation for
	`GtkWidget::focus_in_event'.
	(focus_out_event): New function, implementation for
	`GtkWidget::focus_out_event'.
	(class_init): Install these.
	(button_press_event): Grab the focus.

	* htmlobject.c (relayout): If the object has no parent and has
	shrunk, queue a clear for the area that is not covered by the
	object anymore.

	* htmlengine.c (html_engine_queue_clear): New function.

	* htmldrawqueue.c (html_draw_queue_add_clear): New function.
	(html_draw_queue_add_clear_with_background): New function.
	(clear): New static function to clear an area specified by an
	HTMLClearElement.
	(html_draw_queue_flush): Flush the clear queue as well.
	(html_draw_queue_add): Emit the "draw_pending" signal only if the
	clear queue is empty too.
	(clear_element_new): New static function to create a clear element
	with a solid color background.
	(clear_element_new_with_background): New static function to create
	a clear element with a pixmap background.
	(clear_element_destroy): New static function to destroy a clear
	element.

	* htmldrawqueue.h: Added an HTMLClearElement queue for erasing
	parts of the window.

	* htmltextslave.c (fit_line): Do not chop the last word if there
	is enough space, even if there is another object after this one.

	* htmltextslave.c (html_text_slave_get_offset_for_pointer):
	Compare with the middle position of the character, not the
	leftmost border, so that it's easier to make selections.

	* htmltextslave.c (draw_highlighted): Fix off-by-one selection
	highlight.
	(html_text_slave_get_offset_for_pointer): Consider the last
	character too.

2000-01-24 Elliot Lee  <sopwith@redhat.com>

	* htmlform.c: Include string.h to eliminate warning.

2000-01-24  Ettore Perazzoli  <ettore@helixcode.com>

	* gtkhtml.c (expose): Return `TRUE'.
	(selection_idle_handler): Removed.
	(motion_notify_event): Do not use an idle handler anymore.

	* gtkhtml.h: Removed `selection_idle_handler_id', `selection_x2',
	`selection_y2'.

	* htmltextmaster.c (select_range): Fixed range comparisons.  I
	think I need to sleep.

	* htmldrawqueue.c (draw_obj): Do not paint the cursor if the
	engine is not editable.
	(html_draw_queue_flush): Removed debugging message.

	* htmlengine.c (html_engine_flush_draw_queue): Only draw the
	cursor if the engine is not editable.
	(html_engine_draw): Do not draw the cursor if not editable.
	(html_engine_draw_cursor_in_area): g_assert() that the widget is
	editable.

	* gtkhtml.c (selection_idle_handler): New function, to perform
	selection in the idle loop.
	(motion_notify_event): Set it up in the idle handler to perform
	selection.
	(destroy): Remove the selection idle, if any.
	(init): Initialize `selection_idle_handler_id' to zero.
	(gtk_html_end): Removed debugging message.

	* gtkhtml.h: New member `selection_idle_handler_id' in `GtkHTML'.

2000-01-23  Federico Mena Quintero  <federico@helixcode.com>

	* gtkhtml.c (realize): Set the background pixmap to NONE so that
	it does not flicker as much when scrolling.

2000-01-23  Ettore Perazzoli  <ettore@helixcode.com>

	* htmltextmaster.c (check_point): Fix selection for slaves after
	the first one.

	* htmlobject.c (check_point): Fix braino: `for_cursor' is a
	`gboolean', not a `gpointer'.

	* htmltextmaster.c (split): Set the selection on the new element
	by hand instead of calling `html_object_select_range()'.

	* gtkhtml.c (motion_notify_event): Call
	`html_engine_select_region' with `TRUE' as the `queue_draw'
	parameter.

	* htmlengine.c (html_engine_select_region): New param
	`queue_draw'.  When not FALSE, put all the objects that change
	selection state on the draw queue.
	(select_region_forall): Updated to do this.
	(html_engine_unselect_all): New param `queue_draw', honoured by
	using `SelectRegionData'.
	(unselect_forall): Updated accordingly.

	* htmlobject.h (select_range): Updated with the `engine' and
	`queue_draw' params.
	(html_object_select_range): Likewise.

	* htmlobject.h: New params `engine', `queue_draw' in
	`HTMLObject::select_range'.

	* htmltextmaster.c (check_point): Removed debugging message.

	* gtkhtml.c (button_press_event): Sum the X/Y offsets before
	passing the coordinates to `html_engine_jump_at'.
	(motion_notify_event): Sum the X/Y offsets before calling
	`html_engine_get_link_at' too.

	* htmlengine.c (html_engine_get_object_at): Do not add the X/Y
	offsets when calling the `check_point' method on the parent clue.

	* htmltextslave.c (fit_line) [HTML_TEXT_SLAVE_DEBUG]: Updated
	debugging code to use the new HTMLFitType values.

	* htmltextmaster.c (check_point): Added ugly kludges to make the
	mouse selection move the cursor and selected text as expected,
	when outside the bounds.

	* htmltextslave.c (check_point): New function, implementation for
	`HTMLObject::check_point'.  Always return NULL: this makes sure
	the object cannot be selected with the mouse.
	(html_text_slave_class_init): Install it.

	* htmlengine.c (html_engine_get_object_at): New param
	`for_cursor'.
	(html_engine_select_region): If any of the extremes is not in an
	object, unselect all.

	* htmlobject.h: New parameter `for_cursor' in
	`HTMLObject::check_point'.  All the method implementations updated.

	* htmltable.c (is_container): New function, implementation of
	`HTMLObject::is_container'.  It returns TRUE.
	(html_table_class_init): Install it.

	* htmlclue.c (is_container): New function, implementation of
	`HTMLObject::is_container'.  It returns TRUE.
	(html_clue_class_init): Install it.

	* htmlobject.c (is_container): New function, default
	implementation for `HTMLObject::is_container'.
	(html_object_class_init): Install it.
	(html_object_is_container): New function.

	* htmlobject.h: New virtual method `is_container'.

	* htmlengine.c: Added members `x1', `y1', `x2', `y2' to
	`SelectionRegionData'.
	(html_engine_select_region): Initialize them to the pointer x/y
	values relative to the objects that bound the selection.  Also,
	g_free() the data.

	* htmltextslave.c (draw_highlighted): Fix off-by-one error.

2000-01-22  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlengine.c (html_engine_select_region): New function.
	(html_engine_unselect_all): New function.

	* htmlclue.c (forall): New function, implementation of
	`HTMLObject::forall'.
	(html_clue_class_init): Install it.

	* htmlobject.c (html_object_forall): New function.
	(forall): New function, default implementation of
	`HTMLObject::forall'.
	(html_object_class_init): Install it.

	* htmlobject.h: New virtual method `forall'.

	* htmlcursor.c (html_cursor_backward_element): New function.

	* htmlcursor.c (debug_location): Made a non-op by default.

	* gtkhtml.c (init): Initialize the new GtkHTML member variables.
	(button_press_event): Return `TRUE' as we always handle the press.
	Do not emit `link_clicked' anymore.  Grab the pointer.  Set
	`in_selection' to TRUE, and initialize `selection_x1' and
	`selection_y1'.  Unselect all in the engine.
	(button_release_event): Remove the grab.  Don't emit the
	"link_clicked" signal if we are performing a selection.  Set
	`in_button' and `in_selection' to FALSE.
	(motion_notify_event): Handle the selection if button is pressed.

	* gtkhtml.h: New members `selection_x1', `selection_y1',
	`selection_x2', `selection_y2', `button_pressed' and
	`in_selection' in `GtkHTML'.

	* htmlobject.c (select_range): Braino fix.

	* htmltextmaster.c (select_range): If the lenght is negative,
	select the whole text.

2000-01-21  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlimage.c (generate_pixbuf_for_selection): New helper
	function.
	(draw): By using it, display a color-composed image, using the
	selection color.

	* htmlcolorset.c (html_color_set_new): I never learn: use 16-bit
	color values.  Also, make highlight foreground color different
	from the highlight color.

	* htmltextslave.c (draw_highlighted): New helper function.
	(draw_normal): New helper function.
	(draw): Draw highlighted text when appropriate, using the above
	two functions.

	* htmlpainter.c (html_painter_draw_text): Made param `text'
	const-safe.

	* htmltextmaster.c (html_text_master_init): Initialize
	`select_start', `select_length'.
	(select_range): New function, implementation of
	`HTMLObject::select_range()'.
	(split): Split the selection between self the newly created text
	master.
	(insert_text): New function, implementation of
	`HTMLText::insert_text'.  Used to update the selection after
	selection happens.
	(remove_text): New function, implementation of
	`HTMLText::remove_text'.  Used to update the selection after the
	removal happens.
	(html_text_master_class_init): Install these implementations.

	* htmltextmaster.h: New member `select_start', `select_length'.

	* htmlobject.c (html_object_select): Removed.
	(select_range): New function, default implementation of
	`HTMLObject::select_range()'.
	(html_object_select_range): New function.
	(html_object_class_init): Install it.

	* htmlobject.h: New virtual method `HTMLObject::select_range()'.

	* htmlengine.c (html_engine_init): Set the color set in the
	painter.

	* htmlpainter.c (html_painter_get_default_background_color): New
	function.
	(html_painter_get_default_foreground_color): Removed.
	(html_painter_get_default_link_color): Removed.
	(html_painter_get_default_highlight_color): Removed.
	(html_painter_get_default_highlight_foreground_color): Removed.
	(html_painter_draw_cursor): Removed.
	(html_painter_realize): Cleaned up a bit.
	(html_painter_new): Set `color_set' to NULL.
	(allocate_color_set): New helper function to allocate the
	HTMLColorSet colors.
	(html_painter_set_color_set): New function.
	(html_painter_realize): Allocate colors if `color_set' is not
	NULL.

	* htmlpainter.h: New member `color_set' in `HTMLPainter'.

	* htmlengine.c: Updated to use `htmlcolorset.c' instead of
	`htmlenginecolorset.c'.
	(html_engine_get_background_color): Removed.
	(html_engine_get_foreground_color): Removed.
	(html_engine_get_link_color): Removed.
	(html_engine_get_highlight_color): Removed.
	(html_engine_get_highlight_foreground_color): Removed.

	* htmlengine.h: Likewise.

	* htmlcolorset.c: New file.
	* htmlcolorset.h: New file.

	* htmlenginecolorset.c: Removed.
	* htmlenginecolorset.h: Removed.

2000-01-20  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlobject.c (draw): Removed param `cursor'.

	* htmlobject.h: Removed param `cursor' in `HTMLObject::draw'.  All
	the implementations fixed in all the classes.

	* htmlengine.c (html_engine_init): Initialize `color_set'.
	(html_engine_destroy): Destroy the color set.
	(html_engine_realize): Realize the color set.
	(html_engine_get_background_color): New function.
	(html_engine_get_foreground_color): New function.
	(html_engine_get_link_color): New function.
	(html_engine_get_highlight_color): New function.
	(html_engine_get_highlight_foreground_color): New function.

	* htmlengine.h: New member `color_set'.

	* htmlenginecolorset.h: New file.
	* htmlenginecolorset.c: New file.

	* htmlobject.c (html_object_init): Initialize `selected' to FALSE.
	(html_object_select): New function.

	* htmlobject.h: New flag `selected' in `HTMLObject'.

	* htmlengine-edit.c (merge_text_at_cursor): Changed so that slaves
	between the two elements are removed only if the two elements can
	actually be merged.

	* htmltextmaster.c (fit_line): Use `html_clue_append_after()'.
	* htmltextslave.c (split): Likewise.

	* htmlengine-edit.c (delete_different_parent): Avoid destroying
	the slaves after the first parent.
	(delete_same_parent): Likewise.

	* htmltextslave.c (fit_line): Remove the object from the parent
	before destroying it.
	(split): Split the assertion so that it's obvious to see what is
	wrong.
	(split_at_newline): Braino fix.  Get the owner's text, as we are
	no HTMLText-derived class.

	* htmlengine-edit.c (html_engine_insert_para): Remove the object
	from the parent before destroying it.

	* htmltextmaster.c (fit_line): Remove the object from the parent
	before destroying it.

	* debug.c (debug_dump_tree): Display the HTMLTextSlave intervals
	as [start, end] instead of [start, len].

	* gtkhtml.c (button_press_event): Implemented.

	* htmlengine-edit.c (html_engine_jump_to): Renamed to
	`html_engine_jump_to_object' and made void.
	(html_engine_jump_at): New function.

	* htmlengine.c (html_engine_get_object_at): New function.

2000-01-19  Ettore Perazzoli  <ettore@helixcode.com>

	* htmltable.c (mouse_event): Removed.
	(html_table_class_init): Do not install it.

	* htmlimageinput.c (mouse_event): Removed.
	(html_imageinput_class_init): Do not install it.

	* htmlengine.c (html_engine_mouse_event): Removed.

	* htmlcluev.c (mouse_event): Removed.
	(html_cluev_class_init): Do not install it.

	* htmlclue.c (mouse_event): Removed.
	(html_clue_class_init): Do not install it.

	* gtkhtml.c (button_press_event): Do not call
	`html_engine_mouse_event' anymore.  We are going to do this
	differently.
	(button_release_event): Likewise.

	* htmlobject.c (mouse_event): Removed.
	(html_object_class_init): Do not install it anymore.
	(html_object_mouse_event): Removed.

	* htmlobject.h: Removed `mouse_event' virtual method.

2000-01-19  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlcluev.c (check_point): Fixed to use the correct offsets.

	* htmlengine.c (html_engine_mouse_event): Make the cursor jump to
	the specified position if the engine is editable.

	* htmlengine-edit.c (html_engine_jump_to): New function.

	* htmltextmaster.c (check_point): New function, implementation of
	`HTMLObject::check_point()'.
	(html_text_master_class_init): Install it.

	* htmltextslave.c (html_text_slave_get_offset_for_pointer): New
	function.

	* htmlobject.h: New arg `painter' in `check_point'.  All the
	method implementations updated.
	* htmlobject.c (check_point): Updated accordingly.

	* htmltextslave.c (fit_line): Removed `#if 0'ed code.

	* htmlobject.h: New parameter `offset_return' in
	`HTMLObject::check_point'.  Through this, the object can also
	return a cursor offset.
	* htmlobject.c (html_object_check_point): Accordingly, new
	parameter `offset_return'.
	* htmlengine.c (html_engine_get_link_at): Updated accordingly.
	* htmlclue.c (check_point): Updated to get the extra parameter.
	* htmlcluev.c (check_point): Likewise.
	* htmlobject.c (check_point): Likewise.

	* htmlengine-edit.c (html_engine_delete): When a non-text, destroy
	the element.

	* htmlcursor.c (html_cursor_up): Use
	`html_object_get_cursor_base', not `html_object_get_cursor'.
	(html_cursor_down): Likewise.

	* htmltextmaster.c (get_cursor_base): New function, implementation
	of `HTMLObject::get_cursor_base'.
	(html_text_master_class_init): Install it.
	(get_cursor): Rewritten by means of `html_object_get_cursor_base'.

	* htmltext.c (get_cursor_base): New function, implementation of
	`HTMLObject::get_cursor_base'.
	(html_text_class_init): Install it.
	(get_cursor): Rewritten by means of `html_object_get_cursor_base'.

	* htmlobject.c (html_object_get_cursor_base): New function.
	(get_cursor_base): New function, default implementation of
	`HTMLObject::get_cursor_base'.
	(html_object_class_init): Install it.
	(get_cursor): Rewritten by means of `html_object_get_cursor_base'.

	* htmlobject.h: New virtual method `get_cursor_base'.

	* debug.c (debug_dump_tree): Print the object position.

	* htmlengine-edit.c (merge_text_at_cursor): Return the amount of
	characters added to the current element.
	(html_engine_delete): Sum it to the cursor's current offset.

	* htmlcursor.c (backward): Don't go beyond the last character if
	there is another element after it.

2000-01-18  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlengine-edit.c (merge_text_at_cursor): New function,
	attempting to merge the text element at the cursor with the
	previous text element, if any and if of the same type and with the
	same attributes.
	(html_engine_delete): Call it.

	* htmlengine-edit.c (delete_different_parent): New param
	`destroy_start'.  If `FALSE', do not destroy the `start_object'.
	(delete_same_parent): Likewise.
	(html_engine_delete): Do not destroy an empty text object if it's
	the last in the clue or it's followed by a vspace.

	* htmlrule.c (draw): Don't call the parent class' `draw' method.

	* htmlobject.c (draw): Don't draw the cursor.

	* htmldrawqueue.c (draw_obj): Draw the cursor in the area we have
	repainted.

	* htmlengine.c (draw_cursor): Removed.
	(html_engine_draw_cursor_in_area): Replaced by this one.
	(html_engine_draw): Updated to use this one.
	(html_engine_draw_cursor): Likewise.

	* htmltextslave.c (fit_line): Do not skip leading space anymore.

	* htmlengine.c (html_engine_make_cursor_visible): Argh.
	s/rightBorder/topBorder/.
	(draw_cursor): Fixed.

	* gtkhtml.c (key_press_event): Queue a draw if return value is
	`TRUE'.

2000-01-18  Jonas Borgstrm <jonas_b@bitsmart.com>

	* htmlengine.c (parse_input): Modified the forms code to work with the
	new htmlengine. Changed html_clue_append to append_element. And did some
	code cleanup.

2000-01-18  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlengine.c (append_element): Silly me.  Don't add the object
	to the flow twice when creating a new flow!

	* htmlcursor.c (forward): Fixed navigation at the end of the
	element so that it works with empty elements.
	(backward): Likewise.
	(next_not_slave): Fixed so that it starts from the object after
	`object', not `object' itself.

	* htmlengine.c (current_clueflow_style): If the stack is empty,
	return `HTML_CLUEFLOW_STYLE_NORMAL', not `HTML_CLUEFLOW_STYLE_P'.

	* htmlclueflow.c (get_default_font_style): Removed handling of
	`HTML_CLUEFLOW_STYLE_P'.

	* debug.c (clueflow_style_to_string): Removed handling of
	`HTML_CLUEFLOW_STYLE_P'.

	* htmlclueflow.h: Get rid of `HTML_CLUEFLOW_STYLE_P' as we don't
	need it.

	* htmlengine.c (html_engine_init): The default value for
	`editable' should be FALSE!

	* htmlengine.c (html_engine_flush_draw_queue): Draw cursor
	before/after flushing the queue.

	* htmlengine-edit.c (html_engine_insert_para): Draw cursor
	before/after doing the stuff.
	(html_engine_insert): Likewise.

	* htmlcursor.c (html_cursor_up): Rewritten by means of
	`html_object_get_cursor'.

	* htmltextmaster.c (calc_char_position): Removed.
	(get_cursor): New function, implementation of
	`HTMLObject::get_cursor'.
	(html_text_master_class_init): Install it.
	(get_cursor): When we encounter a non-HTMLTextSlave object, we
	should break the loop, not continue it.

	* htmltext.c (html_text_calc_char_position): Removed.
	(calc_char_position): Removed.
	(get_cursor): New function, implementation of
	`HTMLObject::get_cursor'.
	(html_text_class_init): Install it.

	* htmltext.h: Removed `calc_char_position' method.

	* htmlobject.c (html_object_get_cursor): New function.
	(accepts_cursor): Return TRUE by default.
	(get_cursor): New function, implementation of
	`HTMLObject::get_cursor'.
	(class_init): Install it.

	* htmlobject.h: New virtual method `get_cursor'.

	* htmlengine-edit.c (queue_draw_for_cursor): Removed.
	(html_engine_move_cursor): Use `html_draw_cursor' instead.

	* htmlengine.c (html_engine_init): Initialize `invert_gc' to
	`NULL'.
	(html_engine_destroy): Destroy `invert_gc' if not `NULL'.
	(html_engine_realize): Initialize `invert_gc' by creating a
	`GDK_INVERT' GC.
	(html_engine_draw_cursor): New function.

	* htmlengine.h: New member `invert_gc' in `HTMLEngine'.

2000-01-17  Ettore Perazzoli  <ettore@helixcode.com>

	* gtkhtml.c: Do not #include "htmlpainter.h" anymore.
	(realize): Call `html_engine_realize' instead of accessing the
	painter and calling `html_painter_realize' directly.

	* htmlengine.c (html_engine_init): Initialize member `window' to
	NULL.
	(html_engine_realize): New function.

	* htmlengine.h: New member `window' in `HTMLEngine'.

	* htmlengine.h (html_painter_set_background_color): Removed bogus
	proto.

	* htmlclueflow.c (draw): Use `html_painter_get_black' to set the
	pen color for the bullet.  I think we should be using the font
	color instead, but it's fine for now.

	* htmlpainter.c (html_painter_get_black): New function.

	* htmlclue.c (draw): Removed bogus code to draw rects around the
	clue and getting rid of corresponding variables.  This was not
	even that useful for debugging, as it was intrinsecally broken.

	* htmlclueflow.c (add_pre_padding): Add some padding for `<pre>'
	as well, if the previous element is not a `<pre>' one.
	(add_post_padding): Likewise, but checking with the next element
	instead of the previous one.

	* htmlengine.c (parse_body): Handle `\n' by inserting a line
	break.

	* htmltype.c: Do not call `html_bullet_type_init()' anymore.

	* htmlbullet.c: Removed.
	* htmlbullet.h: Removed.

	* htmlengine.c (html_engine_init): Initialize `avoid_para' to
	`TRUE', `pending_para' to FALSE.
	(html_engine_parse): Likewise.
	(all functions): Updated to use these new members.
	(block_end_list): Avoid adding empty paragraph breaks after this.
	(block_end_indent): Likewise.
	(parse_f): Fix relative font size.

	* htmlengine.h: New elements `avoid_para', `pending_para'.

	* htmlengine.c (close_flow): Added ugly hack to check if the flow
	ends with a vspace.  If it does, the vspace is killed.  Yes, I
	should do it differently, but let's just get it to work now.

2000-01-16  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlcluev.c (get_right_clear): New function, implementation of
	`HTMLClue::get_right_clear'.
	(get_left_clear): New function, implementation of
	`HTMLClue::get_left_clear'.
	(html_cluev_class_init): Install virtual methods.

	* htmlclueflow.c (add_post_padding): Add padding even if the next
	object is an header.

	* htmlfontmanager.c: Use a static array for calculating the real
	font size.  (Yes, this is just a temporary hack.)

	* htmlclueflow.c (calc_preferred_width): Use `get_indent()'
	correctly instead of simply multiplying the level by the indent
	size.

	* htmlrule.c (draw): Fix braino: `HTML_HALIGN_RIGHT' and
	`HTML_HALIGN_LEFT' were swapped.

2000-01-13  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlclueflow.c: Changed to display bullets correctly even if
	`level' is zero.  (Which should not happen according to the
	standard, but it does happen in practice.)

	* htmlengine.c (html_engine_init): Initialize `pending_vspace' to
	zero.
	(html_engine_insert_text): Removed.
	(insert_pending_vspace): New function.
	(insert_text): New function.
	(add_line_break): New function.
	(block_end_font): No longer insert a vspace.
	(block_end_list): Likewise.
	(parse_body): Do not set `vspace_inserted' anymore.  `\n' just
	causes `pending_vspace' to be inconditionally incremented.
	(All functions): Use `add_line_break' to force line breaks instead
	of `html_engine_insert_vspace()'.
	(parse_h): Set `pending_vspace' to 0 when opening/closing headers.
	Insert pending vspace before adding a rule.
	(parse_i): Insert pending vspace before adding the image.
	(parse_l): Insert pending vspace before creating the new clue.
	(html_engine_insert_vspace): Removed.
	(close_flow): New parameter `clue'.

	* htmlengine.h: `vspace_inserted' removed.  New member
	`pending_vspace'.

	* htmlvspace.c (html_vspace_new): Removed parameter `space'.
	(html_vspace_init): Removed parameter `space'.  Do not init
	`ascent', `descent' anymore.
	(calc_size): New function, implementation for
	`HTMLObject::calc_size'.
	(html_vspace_class_init): Install it.

2000-01-11  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlclueflow.c (calc_size): Add padding at the end only.

	* htmlstack.c (html_stack_pop): Added precondition.

	* htmlengine.c (parse_a): Do not force color and font for links
	anymore.

	* htmllinktextmaster.c (get_font_style): New function,
	implementing `HTMLText::get_font_style'.  It forces the font style
	to be underlined.
	(html_link_text_master_class_init): Install it.

	* htmllinktext.c (get_font_style): New function, implementing
	`HTMLText::get_font_style'.  It forces the font style to be
	underlined.
	(html_link_text_class_init): Install it.

	* htmltablecell.c (html_table_cell_init): Initialize
	`bg_allocated' to `FALSE'.
	(set_bg_color): Set `bg_allocated' to `FALSE' if the new color is
	different from the existing one.
	(draw): If `bg_allocated' is `FALSE', allocate the color and set
	`bg_allocated' to `TRUE'.

	* htmltablecell.h: New member `bg_allocated' in `HTMLTableCell'.

	* htmlengine.c (html_engine_init): Set `bgColor_allocated' to
	`FALSE'.
	(draw_background): If `bgColor_allocated' is `FALSE', allocate
	`bgColor' in the engine's painter.
	(parse_b): Set `bgColor_allocated' to FALSE when setting a new
	`bgColor'.
	(close_anchor): Do not pop color on links anymore.

	* htmlengine.h: New member `bgColor_allocated' in `HTMLEngine'.

2000-01-10  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlengine.c (current_color): New function.
	(html_engine_set_named_color): Removed.
	(push_color): New function.
	(pop_color): New function.
	(html_engine_stop_parser): Clear all the stacks except the
	list/glossary ones as I am still unsure how to handle them.
	(html_engine_pop_color): Removed.
	(All functions): Updated to use these new color stack functions.
	Also, use `gdk_color_parse()' instead of
	`html_engine_set_named_color'.

	* htmlengine.h (html_painter_set_background_color): Removed
	prototype (what the hell is this doing here!?).

	* htmllinktext.c (html_link_text_init): New parameter `color'.
	(html_link_text_new): New parameter `color'.

	* htmltextslave.c (draw): Set the color using
	`html_text_get_color()'.

	* htmltext.c (html_text_init): New parameter `color', to
	initialize the `color' member.  Alos, set `color_allocated' to
	FALSE.
	(html_text_new): New parameter `color'.
	(get_color): New function, default implementation for
	`HTMLText::get_color'.
	(html_text_get_color): New function.
	(draw): Use it.

	* htmltext.h: New members `color', `color_allocated'.  New virtual
	method `HTMLText::get_color'.

	* htmltable.c (draw): Removed stupid "nonono" message.  :-)

	* htmlengine.c (parse_t): Don't put the a new table in itw own
	HTMLClueFlow anymore: close the current flow, and append to the
	specified clue.

	* htmltextslave.c (calc_size): New function, implementation for
	`HTMLObject::calc_size'.
	(html_text_slave_class_init): Install it.

	* htmlclueflow.c (html_clueflow_get_default_font_style): New
	function.
	(get_default_font_style): Default implementation for
	`HTMLClueFlow::get_default_font_style'; just a stub for now.
	(html_clueflow_class_init): Install it.

	* htmlclueflow.h: New virtual method
	`HTMLClueFlow::get_default_font' to get the font associated with
	the HTMLClueFlow's style.

	* htmlclueflow.h (HTML_CLUEFLOW_CLASS): Fixed (do the correct
	cast).

	* htmltextmaster.c (calc_min_width): Implemented.
	(calc_preferred_width): Implemented.
	(calc_size): New function, implementing `HTMLObject::calc_size'.
	(html_text_master_class_init): Install it.

	* htmltext.c (calc_size): New function, implementation of
	`HTMLObject::calc_size()'.
	(html_text_class_init): Install it.

	* htmltext.c (html_text_get_font_style): New function.
	(get_font_style): Default implementation for
	`HTMLText::get_font_style'.
	(html_text_class_init): Install it.
	(draw): Use it.
	(calc_size): Use it.

	* htmltext.h: New virtual method `HTMLText::get_font_style'.

2000-01-09  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlobject.h: New arg `painter' in `HTMLObject::calc_size';
	removed arg `parent'.  New arg `painter' in
	`HTMLObject::calc_preferred_width', `HTMLObject::calc_min_width'
	and `HTMLObject::fit_line' as well.
	* htmlclue.c: Updated accordingly.
	* htmlclue.h: Updated accordingly.
	* htmlcluealigned.c: Updated accordingly.
	* htmlcluealigned.h: Updated accordingly.
	* htmlclueflow.c: Updated accordingly.
	* htmlclueflow.h: Updated accordingly.
	* htmlclueh.c: Updated accordingly.
	* htmlclueh.h: Updated accordingly.
	* htmlcluev.c: Updated accordingly.
	* htmlcluev.h: Updated accordingly.
	* htmlengine.c: Updated accordingly.
	* htmlimage.c: Updated accordingly.
	* htmlimage.h: Updated accordingly.
	* htmllinktext.c: Updated accordingly.
	* htmllinktext.h: Updated accordingly.
	* htmllinktextmaster.c: Updated accordingly.
	* htmllinktextmaster.h: Updated accordingly.
	* htmlobject.c: Updated accordingly.
	* htmlobject.h: Updated accordingly.
	* htmlrule.c: Updated accordingly.
	* htmlrule.h: Updated accordingly.
	* htmlstream.c: Updated accordingly.
	* htmltable.c: Updated accordingly.
	* htmltablecell.c: Updated accordingly.
	* htmltext.c: Updated accordingly.
	* htmltextmaster.c: Updated accordingly.
	* htmltextslave.c: Updated accordingly.
	* htmlvspace.c: Updated accordingly.
	* htmlvspace.h: Updated accordingly.

	* htmlpainter.c (html_painter_calc_ascent): New function.
	(html_painter_calc_descent): New function.
	(html_painter_calc_text_width): New function.

	* htmltable.c (find_anchor): Kill unused variable.

	* htmltype.c (html_types_init): Don't call `html_hspace_init()'
	anymore.

	* htmlhspace.c: Removed.
	* htmlhspace.h: Removed.

	* htmlengine.c: Updated to use `HTMLFontStyle' instead of
	`HTMLFont'.  Also, we do not hardcode the font and color all the
	time anymore: instead, we let the HTMLClueFlow specify the default
	font.
	(select_font_full): Removed.
	(select_font_relative): Removed.
	(current_font_style): New utility function.
	(push_font_style): New utility function.
	(pop_font_style): New utility function.
	(current_clueflow_style): New utility function.
	(push_clueflow_style): New utility function.
	(pop_clueflow_style): New utility function.
	(close_anchor): No longer pop the font.
	(html_engine_parse): Initialize the font stack with
	`HTML_FONT_STYLE_DEFAULT'.
	(html_engine_select_font): Removed.
	(html_engine_get_current_font): Removed.
	(html_engine_insert_text): Parameter `font' removed.  Always use
	the current font style.
	(new_flow): Removed parameter `style'.  Get the style from the top
	of the ClueFlow style stack using `current_clueflow_style'.
	(block_end_clueflow_style): New function.

	* htmlengine-edit.c (html_engine_insert_para): Use an empty
	HTMLTextMaster element instead of an hspace for the new clue.

	* htmlengine.h: New member `clueflow_style_stack' in `HTMLEngine'.

	* htmltextmaster.c (calc_min_width): Always return 0.
	(calc_preferred_width): Return bogus 100 for now.

	* htmltextmaster.h: Removed members `minWidth', `prefWidth'.

	* htmlclueflow.h: Updated to use `HTMLFontStyle' instead of
	`HTMLFont'.
	* htmlclueflow.c: Likewise.

	* htmllinktextmaster.h: Updated to use `HTMLFontStyle' instead of
	`HTMLFont'.
	* htmllinktextmaster.c: Likewise.

	* htmllinktext.h: Updated to use `HTMLFontStyle' instead of
	`HTMLFont'.
	* htmllnktext.c: Likewise.

	* htmltext.h: Updated to use `HTMLFontStyle' instead of
	`HTMLFont'.
	* htmltext.c: Likewise.

	* htmltextmaster.h: Updated to use `HTMLFontStyle' instead of
	`HTMLFont'.
	* htmltextmaster.c: Likewise.

2000-01-08  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlclueflow.c (draw): Temporarily disabled bullet painting
	code.

	* htmlpainter.c (html_painter_set_font): Removed.
	(html_painter_set_font_style): Replaced by this one.
	(html_painter_get_font): Removed.
	(html_painter_get_font_style): Replaced by this one.
	(html_painter_new): New arg `font_manager', to set the
	`font_manager' member.
	(html_painter_draw_text): Retrieve the font using
	`html_font_manager_get_gdk_font()'.  Also, handle underline and
	strikeout according to the value of the `style' member.

	* htmlpainter.h: Member `font' removed: replaced by `font_style'.
	New member `font_manager', pointer to an HTMLFontManager.

	* htmlfont.c: Removed.
	* htmlfont.h: Removed.

	* htmlengine.c (html_engine_init): Initialize member
	`font_manager'.
	(html_engine_destroy): Destroy the font manager.

	* htmlengine.h: New member `font_manager' in `HTMLEngine'.
	Members `fs', `cs' renamed to `font_stack' and `color_stack',
	respectively.  `bold', `underline', `fontsize' removedq.

	* htmlfontmanager.c: New file.
	* htmlfontmanager.h: New file.

	* htmlpainter.c: Moved some functions around to make the code
	cleaner.
	(html_painter_alloc_color): New function.
	(html_painter_free_color): New function.

2000-01-07  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlfont.c, htmlfont.h: Removed.

	* Makefile.am (libgtkhtml_HEADERS): Added `htmlurl.h'.

	* htmlengine.c (parse_body): Insert vspace instead of creating a
	new flow for every newline in the `<pre>' case.
	(html_engine_new_flow): Removed.
	(new_flow): New function, replaces `html_engine_new_flow'.  It has
	a `style' parameter to specify the HTMLClueFlowStyle for the new
	flow.  Callers updated.
	(parse_p): Inconditionally create a new `HTML_CLUEFLOW_STYLE_P'
	flow for the `<p>' tag.  Always close the current one when you get
	a `</p>' tag.  Likewise with `HTML_CLUEFLOW_STYLE_PRE' and
	`<pre>'/`</pre>'.
	(parse_h): Inconditionally create a new flow of the appropriate
	`HTML_CLUEFLOW_STYLE_H*' style.
	(parse_t): Inconditionally create a new flow.

	* debug.c (clueflow_style_to_string): New helper function.
	(debug_dump_tree): Print the ClueFlowStyle for HTMLClueFlow
	objects using it.  Also, print the text for `HTMLLinkText' and
	`HTMLLinkTextMaster' objects as well.

	* htmlclueflow.c (calc_size): Do not split lines if style is
	`HTML_CLUEFLOW_STYLE_PRE'.
	(calc_min_width): Handle HTML_CLUEFLOW_STYLE_PRE correctly.

	* htmlclueflow.h: Added `HTML_CLUEFLOW_STYLE_PRE'.

2000-01-06  Ettore Perazzoli  <ettore@helixcode.com>

	* gtkhtml.c (key_press_event): Move the cursor forward by the
	number of characters inserted.

	* htmlengine-edit.c (html_engine_insert): Return the number of
	characters actually inserted.

	* htmltextslave.c (draw): Updated to use `HTMLText::text_len'
	instead of `HTMLTextMaster::strLen'.
	(fit_line): Likewise.

	* htmltextmaster.c (fit_line): Updated to use `HTMLText::text_len'
	instead of `HTMLTextMaster::strLen'.
	(split): Likewise.
	(insert_text): Removed.
	(remove_text): Removed.
	(html_text_master_class_init): Updated accordingly.
	(html_text_master_init): Do not initialize `strLen' anymore.

	* htmllinktextmaster.c (split): Updated to use `HTMLText::text_len'
	instead of `HTMLTextMaster::strLen'.

	* htmltextmaster.h: Removed member `strLen'.

	* htmltext.c (insert_text): Return value changed from `void' to
	`guint': return the number of characters actually inserted.  Also,
	make sure there are never two consecutive spaces in the resulting
	string.
	(html_text_insert_text): Updated accordingly.
	(calc_actual_len): New helper function for `insert_text'.
	(copy_collapsing_spaces): New helper function for `insert_text'.
	(html_text_init): Initialize `text_len'.
	(remove_text): Update `text_len'.
	(insert_text): Update `text_len'.

	* htmltext.h: New member `text_len' for storing the text's length.

	* htmlengine.c (parse_h): Do not create a new flow for the rule,
	unless there is no current flow.

	* htmlrule.c (html_rule_new): New parameter `halign'.
	(html_rule_init): Likewise.
	(set_max_width): Always set `width' to `max_width'.
	(draw): Only draw the specified percent of the width, and align
	according to the `halign' value.

	* htmlrule.h: New member `halign'.

	* htmlengine-edit.c (html_engine_insert_para): Do not add an
	`HTMLHSpace' at the end of the paragraph anymore.

	* htmlclueflow.c (html_clueflow_split): Removed HTMLHSpace kludge.

	* htmlvspace.c (accepts_cursor): New function, implementation for
	`HTMLObject::accepts_cursor()'.  Always return `TRUE'.
	(html_vspace_class_init): Install it.

	* htmlclueflow.c: New constant `VERTICAL_PAD'.
	(calc_size): Add `VERTICAL_PAD' to the `ascent' value before the
	size computation and to the `descent' value after it, if the style
	is not that of an itemized list: this pads the HTMLClueFlow
	vertically.

	* htmlimage.c: #include <gdk-pixbuf/gdk-pixbuf.h>.

2000-01-05  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlengine.c (html_engine_insert_text): Rewritten to always
	create HTMLTextMasters and no HTMLHSpaces.
	(html_engine_insert_vspace): Do not create a new clueflow for the
	vspace: the vspace will just be at the end of the existing flow.
	(parse_h): Do not put the rule in a new HTMLClueFlow (that's a
	waste!).
	(close_flow): No longer append an hspace.
	(parse_p): Always create a new flow with `html_engine_new_flow()'.

	* htmlfont.c (html_font_equal): New function.

	* htmltextslave.c (split): New helper function.
	(split_at_newline): New helper function.
	(fit_line): Use them.  The TextSlave is now split at the first
	newline character before starting the fit process.

2000-01-06  Jonas Borgstrm <jonas_b@bitsmart.com>

	* Makefile.am : Moving htmlurl.c from libgtkhtml_SOURCES to testgtkhtml_SOURCES

	* gtkhtml.c : (gtk_html_set_base_url) : removed function, not needed.

	* gtkhtml.h : removed function gtk_html_set_base_url

	* htmlengine.c : Removed ALL use of HTMLURL from htmlengine.c. htmlengine shouldn't do any url handling.

	* htmlengine.h : Removed ALL HTMLURL variables

	* testgtkhtml.c : testgtkhtml.c is now doing ALL url handing, it shouldn't be in htmlengine.c
	
2000-01-06  Jonas Borgstrm <jonas_b@bitsmart.com>
 
	This adds support for scaling images.
	OBS! You need a fresh gdk_pixbuf from the CVS.

	* htmlimage.h : New members: gboolean scaled and GdkPixbuf *scaled_pixbuf;

	* htmlimage.c : (destroy) : unref scaled_pixbuf if used;
	(html_image_update_scaled_pixbuf) : New function updates the local
	scaled copy of image_ptr->pixbuf
	(html_image_setup) : Set scaled to TRUE if object->width !=
	image_ptr->pixbuf->art_pixbuf->width.
	(html_image_factory_area_updated) : Call
	html_image_update_scaled_pixbuf if scaled.
	(html_image_factory_end_pixbuf) : Call
	html_image_update_scaled_pixbuf if scaled.
	(html_image_factory_register) : Scale the image if necesary if it
	already is loaded.
	
2000-01-05  Jonas Borgstrm <jonas_b@bitsmart.com>

	[This adds support for references in urls.]
	
	* htmlanchor.c (find_anchor): New function.
	
	* htmlclue.c (find_anchor): New function.
	
	* htmltable.c (find_anchor): New function.

	* htmlengine.c (html_engine_begin): Check if the url wants to view
	a reference on the current page, if so don't load it again, just
	scroll.
	
	(html_engine_goto_anchor): New function. Searches for an anchor
	and scrolls the page.

	* htmlengine.h : Added new member, reference. It is the reference
	html_engine_goto_anchor searches for.

	* htmlimage.c (cleanup_images): Only destroy ptr->pixbuf if it's not NULL.

	* htmlurl.c (html_url_to_string): Add the reference to the string
	also.

	* testgtkhtml.c (entry_goto_url): g_strdup the string from the
	entry.
	(goto_url): Only call gtk_html_parse () When gtk_html_begin
	returns non NULL. Don't call gtk_html_parse when the engine only
	scrolls the page (On a #reference).

2000-01-04  Jonas Borgstrm <jonas_b@bitsmart.com>

	* htmlengine.c : (parse_b): Added "clear=xxx" support in <br> tags.
	(parse_d): Fixed dt function. 
	http://cvs.gnome.org/bonsai/rview.cgi?root=/cvs/gnome looks better now.
	
	(parse_table): Added support for nowrap argument in <td> tags.
			Now http://www.themes.org looks ok.
	
	(parse_table): Added workaround for bad html in table and form combination, 
		       to make gnome bonsai pages render ok.
	
	(parse_f): With a <form action=> defaults to the current URI.
	
	(html_engine_insert_text): Uses HTMLText instead of HTMLTextMaster with NOWRAP

	* htmlengine.h: New variable gboolean noWrap.

	* htmlurl.[ch] (html_url_dup): New flag HTML_URL_DUP_NOCGIARGS.
		
2000-01-03  Jonas Borgstrm <jonas_b@bitsmart.com>
	
	* Makefile.am : Added htmlimageinput.c and htmlimageinput.h

	* gtkhtml.c (button_press_event): Call html_engine_mouse_event

	* htmlengine.c (html_engine_mouse_event): New function.
	(parse_input): Added imageinput support.

	* htmltype.[ch]: Added class HTMLImageInput.
	
	* htmlimageinput.[ch]: New files.

2000-01-03  Jonas Borgstrm <jonas_b@bitsmart.com>

	* Makefile.am : Added htmltextarea and htmlselect
	
	* htmlbutton.c (draw): Removed function.
	
	* htmltextinput.c (draw): Removed function.
	
	* htmlradio.c (draw): Removed function.
	
	* htmlcheckbox.c (draw): Removed function.
	
	* htmlselect.[ch]: New file.

	* htmltextarea.[ch]: New file.

	* htmlelement.c (draw): Added function.

	* htmlengine.c (parse_t): Added <textarea> support.
	
	* htmlengine.h: Added inTextArea and formTextArea.

	* htmltype.[ch]: Added class HTMLTextArea.

	* tests/test9.html: Extended test.

2000-01-02  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlengine-edit.c (delete_same_parent): Save the parent before
	destroying the object.

	* htmlclueflow.c (html_clueflow_split): Set tail.

	* htmlengine-edit.c (delete_different_parent): Do not move
	TextSlaves; destroy them instead.

	* htmltext.c (remove_text): Always queue a redraw for the parent.

2000-01-02  Jonas Borgstrm <jonas_b@bitsmart.com>

	* htmlengine.c (parse_input): Added more support for <input> tag
	
	* htmlbutton.[ch], htmltextinput.[ch], 
	  htmlradio.[ch], htmlcheckbox.[ch],
	  htmlhidden.[ch], htmlform.[ch] and
	  htmlelement.[ch] More frame work.

	* gtkhtml.[ch], htmlengine.[ch]: Added New signal 'submit'

	* testgtkhtml.c: Added submit support.

2000-01-02  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlfont.c (html_font_calc_width): Made const safe.

2000-01-02  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlengine-edit.c (html_engine_delete): Rewritten in a saner
	way.
	(delete_same_parent): Helper function for `html_engine_delete'.
	(delete_different_parent): Helper function for
	`html_engine_delete'.

	* htmldrawqueue.c (draw_obj): Renamed `x', `y', `width', `height'
	to `x1',`y1', `x2', `y2' so that the names make sense.  Also, clip
	the painting region.

2000-01-02  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlengine.c (parse_l): Do not use `indentSize' anymore -- just
	use `listLevel'.

2000-01-02  Jonas Borgstrm <jonas_b@bitsmart.com>

	* htmlengine.c (parse_input): Added more support for <input> tag
	
	* htmlbutton.[ch] : new files, button form element.

	* htmltextinput.[ch]: New files, textinput form element.
	
	* htmlradio.[ch]: New files, radio form element.
	The radio elements start flickering on mouseover.
	
	* htmlcheckbox.[ch]: New files, checkbox form element.

	* htmlhidden.[ch]: New files, hidden form element.

	* htmlclue.c (destroy): Enabled destroying again.

	* htmllinktextmaster.c: Fixed incorrect parent_class.

	* htmltable.c (destroy): New function, free objects.

	* htmltype.[ch]: Added new classes.
	
	* Makefile.am: Added New files

2000-01-01  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlanchor.c (set_max_ascent): Do not change the y.  I have no
	idea why this is done, and breaks the layout of anchors.

	* htmlengine.c (html_engine_new_flow): Argh!  It was setting the
	indentation level in an hideous way.  Anyway, it currently simply
	uses the parameter in `html_clueflow_new()'.
	(INDENT_SIZE): Constant removed.  Instead, we increment/decrement
	indentation level by 1, as HTMLClueFlow takes care of using the
	correct raw offset for us now.
	(parse_b): Modified accordingly.
	(parse_d): Likewise.
	(parse_o): Likewise.
	(parse_u): Likewise.
	(parse_l): Instead of doing all the cluev/clueh/clueflow mess,
	just create a clueflow with an itemized style.  Wee!  This
	dramatically reduces the complexity of the code and the overhead
	of itemized lists in the tree.
	(to_roman): Removed.

	* htmltext.c (remove_text): Actually return a value, as expected.
	(html_text_remove_text): Likewise.

	* htmlclueflow.c (html_clueflow_init): New parameters `font',
	`style', `level' to initialize the corresponding new members.  Do
	not initialize `curr', `tail', `head' as they are initialized by
	`html_clue_init()' already.
	(html_clueflow_new): New parameters `font', `style' and `level',
	passed to `html_clueflow_init()'.
	(INDENT_UNIT): New constant.
	(set_max_width): Use `level' instead of `indent', by multiplying
	by `INDENT_UNIT'.
	(calc_min_width): Likewise.
	(calc_size): Likewise.
	(calc_preferred_width): Likewise.
	(draw): New function, implementation for `HTMLObject::draw'.  This
	is now necessary to draw the bullets/numbers with style
	`HTML_CLUEFLOW_STYLE_ITEM*'.
	(html_clueflow_class_init): Install it.

	* htmlclueflow.h: New enum `HTMLClueFlowStyle'.  New members
	`font', `level', `style' in `HTMLClueFlow'.  Removed member
	`indent'.

	* htmlobject.h: Do not #include "htmlfont.h" anymore.

2000-01-01  Jonas Borgstrm <jonas_b@bitsmart.com>

	* htmlengine.c (parse_i): Added support for <input> tag
	(parse_f): Added support for <form> tag
	(parse_input): New function
	
	* htmlengine.h: Added new members form and formList

	* htmlform.c: New file, initial form support
	* htmlform.h: New file.
	
	* testgtkhtml.c: Added test9.html.
	
	* test9.html: New form test.

	* Makefile.am: Added htmlform.c and htmlform.h

1999-12-31  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlclueflow.c (calc_size): Set `o->y' as for some reason it
	does not work without it.  I have to find out what this is exactly
	for.

1999-12-31  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlengine.c (close_flow): Avoid segfault if there is no prev.

1999-12-31  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlclueflow.c (html_clueflow_init): Removed parameters `x',
	`y', `max_width', `percent'.  I have no idea why they are here
	actually.
	(html_clueflow_new): Likewise.  All callers updated.

	* htmlengine-edit.c (html_engine_delete): Merge the next clueflow
	with the current one if deleting at the end of the flow itself.
	This does not completely work yet; I have to fix some stuff in the
	way the tree is generated first.

	* htmlengine.c (parse_m): Made local variable `content' const
	correct.

	* htmlclue.c (html_clue_remove): New function.
	(html_clue_prepend): Doc'ed and added preconditions.
	(html_clue_append): Likewise.

	* htmltext.c (remove_text): Return the number of characters
	actually deleted.
	(html_text_remove_text): Likewise.
	* htmltextmaster.c (remove_text): Updated accordingly.

1999-12-31  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlengine-edit.c (html_engine_insert_para): Inserting a
	paragraph at the beginning of a paragraph correctly results in an
	empty paragraph now.

	* htmlclueflow.c (html_clueflow_split): Deal with splitting at the
	head of the clue correctly.
	(calc_size): Consider the object's height even if at the left
	margin.  I am not sure this is correct fix, but I don't see the
	reason for not doing it this way, and the previous code did not
	handle a hspace alone in a clueflow as expected.

1999-12-30  Jonas Borgstrm <jonas_b@bitsmart.com>

	* htmlengine.c (parse_m): Added support for META refresh
	
	* htmlengine.[ch] (redirect): New signal
	
	* gtkhtml.[ch] (redirect): New signal

	* testgtkhtml.c (on_redirect): New function, support for META redirection.

1999-12-30  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlobject.c (destroy): Do not deal with the font anymore.

	* htmlobject.h: Removed member `font' from `HTMLObject'.  Bleargh.
	This was truly awful and caused a lot of confusion in the code (as
	`HTML_{TEXT,HSPACE} (obj)->font' was used and `obj->font' was
	always NULL).  It also wasted 4 bytes per object just for nothing.

	* htmltext.c (html_text_init): Precondition: the font pointer must
	not be NULL.

	* htmllinktext.c (split): New function, implementation for
	`HTMLText::split'.
	(html_link_text_class_init): Install it.

	* htmllinktextmaster.c (split): New function, implementation for
	`HTMLText::split'.
	(html_link_text_master_class_init): Install it.

	* htmltextmaster.c (split): New function, implementation for
	`HTMLText::split'.
	(html_text_master_class_init): Install it.

	* htmltext.c (html_text_split): New function.
	(split): New function, default implementation for
	`HTMLText::split()'.
	(html_text_class_init): Install it.

	* htmltext.h: New virtual method `split'.

	* htmlclue.c (html_clue_prepend): New function.
	(html_clue_append_after): New function.

	* htmllinktextmaster.c (html_link_text_master_init): Removed
	parameter `painter'.
	(html_link_text_master_new): Likewise.

	* htmlclue.c (html_clue_append): Set the child's `next' pointer to
	NULL.

	* htmltextmaster.c (html_text_master_init): Removed parameter
	`painter'.
	(html_text_master_new): Likewise.

	* htmltext.c (html_text_init): Removed parameter `painter'.
	(html_text_new): Likewise.

	* htmlhspace.c (html_hspace_init): Removed parameter `painter'.
	(html_hspace_new): Likewise.

	* htmlclue.c (html_clue_split): New function.

	* htmlobject.c (html_object_set_parent): Allow setting a NULL
	parent.

	* htmlcursor.c (forward): Never put the cursor after the last
	character of the text.
	(backward): Likewise.

	* htmlengine.c: Moved helper functions on top.
	(close_flow): New helper function for closing the current
	ClueFlow.
	(block_end_pre): Use it.
	(html_engine_insert_vspace): Use it.
	(block_end_list): Use it.
	(block_end_indent): Use it.
	(parse_b): Use it.

	* htmlhspace.c (draw): Call `HTMLObject::draw()' so that we can
	have the cursor on this.
	(accepts_cursor): New function, implementation for
	`HTMLObject::accepts_cursor()'.
	(html_hspace_class_init): Install it.
	(html_hspace_init): Set the width to 1 if the hspace is invisible.

	* htmlengine.c (html_engine_end): Move the cursor to the home
	position only if the engine is in the editable state.

1999-12-29  Ettore Perazzoli  <ettore@helixcode.com>

	* htmldrawqueue.c (html_draw_queue_flush): Destroy the object
	(without drawing it) if it has `free_pending' true.

	* htmlobject.c (destroy): If the object has a redraw pending, do
	not `g_free()' it; instead, set `free_pending' to `TRUE'.
	(html_object_init): Set `free_pending' to `TRUE'.
	(html_object_destroy): If `free_pending' is true, just `g_free()'
	the object instead of calling the `destroy' method.

	* htmlobject.h: New member `free_pending' in `HTMLObject'.

	* gtkhtml.c (key_press_event): Handle `GDK_BackSpace' by moving
	the cursor to the left and then, if the movement was successful,
	deleting to the right.

	* htmlengine-edit.c (html_engine_move_cursor): Return value
	changed to `guint': return the number of movement actions actually
	taken.  Also, I cleaned up the code a bit.

	* htmlcursor.c (forward): Return value type changed to `gboolean':
	return TRUE if the movement was successful, FALSE otherwise.
	(backward): Likewise.
	(html_cursor_forward): Likewise.
	(html_cursor_backward): Likewise.
	(html_cursor_up): Likewise.
	(html_cursor_down): Likewise.
	(backward): If the cursor is in a NULL position at the beginning
	of the call, move it home.  (Temporary, but consistent with what
	the other cursor movement functions do.)

	* htmlengine-edit.c (queue_draw_for_cursor): Queue the draw even
	if we are not on a text element.

	* htmlcursor.c (next): Removed debugging messages.
	(debug_location): New function to print the cursor position on the
	HTML tree for debugging purposes.
	(html_cursor_home): Use it.
	(html_cursor_forward): Likewise.
	(html_cursor_backward): Likewise.
	(html_cursor_up): Likewise.

	* htmlrule.c (accepts_cursor): New function, implementation of
	`HTMLObject::accepts_cursor'.  This returns TRUE so that you can
	now put the cursor on a rule.
	(html_rule_class_init): Install it.
	(draw): Call `HTMLObject::draw()' so that the cursor is drawn when
	on the rule.  Also, fixed the out-of-area check.

	* htmlcursor.c (forward): Use `html_object_accepts_cursor()'.
	(backward): Likewise.
	(html_cursor_up): Deal with non-HTMLText objects.
	(html_cursor_down): Likewise.

	* htmltext.c (accepts_cursor): New function, implementation of
	`HTMLObject::accepts_cursor'.
	(html_text_class_init): Install it.

	* htmlobject.c (html_object_accepts_cursor): New function.
	(accepts_cursor): New function, default implementation for the
	`accepts_cursor' virtual method.
	(html_object_class_init): Install it.

	* htmlobject.h: New virtual method `accepts_cursor'.

	* htmlengine.c (html_engine_get_type): Removed prototype here.
	* htmlengine.h (html_engine_get_type): Moved here.

	* htmlengine-edit.c (queue_draw_for_cursor): Use
	`html_object_is_text()'.
	(html_engine_insert): Likewise.

	* htmlcursor.c (is_text): Removed.
	(forward): Use `html_object_is_text()' instead.
	(backward): Likewise.

	* htmlobject.c (html_object_is_text): New function.  Ugliest thing
	on Earth, but cheap and working for now.

	* htmlengine-edit.c (html_engine_delete): Added precondition:
	check that `e' is an HTMLEngine.
	(html_engine_insert): Likewise.

	* htmlengine.h (IS_HTML_ENGINE): Renamed to `HTML_IS_ENGINE'.
	(IS_HTML_ENGINE_CLASS): Renamed to `HTML_IS_ENGINE_CLASS'.
	(TYPE_HTML_ENGINE): Renamed to `HTML_TYPE_ENGINE'.

1999-12-28  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlpainter.c (html_painter_draw_cursor): Fix the cursor height:
	it was one pixel too high.

	* htmlobject.c (html_object_calc_abs_position): Take account for
	the ascent.

	* gtkhtml.c (idle_handler): Make cursor visible.

	* htmlengine.c (html_engine_make_cursor_visible): New function.

	* gtkhtml.c (key_press_event): Handle `GDK_Delete' and
	`GDK_KP_Delete'.

	* htmlengine-edit.c (html_engine_delete): New function.

	* htmltextmaster.c (remove_text): New function, implementation for
	the `remove_text' method.
	(html_text_master_class_init): Install it.

	* htmltext.c (html_text_insert_text): Added precondition on
	parameter `engine'.
	(html_text_remove_text): New function.
	(remove_text): New function, default implementation for the
	`remove_text' method.
	(html_text_class_init): Install it.

	* htmltext.h: New virtual method `remove_text'.

	* htmlobject.c (html_object_calc_abs_position): Actually use local
	variable `p'.

	* htmlcursor.c (forward): New helper function.
	(html_cursor_forward): Use it.  Added preconditions.
	(backward): New helper function.
	(html_cursor_backward): Use it.  Added preconditions.
	(html_cursor_up): Set the target X value before anything else, to
	make sure it is always set correctly.  Use `backward()' instead of
	`html_cursor_backward()'.
	(html_cursor_down): Likewise.  Use `forward()' instead of
	`html_cursor_forward()'.
	(html_cursor_new): Initialize `have_target_x' to FALSE, not TRUE.

	* htmltextmaster.c (calc_char_position): Make sure the coordinates
	are always calculated.

	* htmltextslave.c (fit_line): Destroy the next object instead of
	just `g_free()'ing it.  Do not kill the space between the various
	TextSlaves: instead, keep it at the end of the slave.

	* htmlengine-edit.c (queue_draw_for_cursor): Do nothing if the
	pointer to the current object is NULL.

	* htmlurl.c (concat_dir_and_file): Made static.

	* testgtkhtml.c (netin_stream_free): Call `gtk_html_end()' again.
	It does not seem to cause crashes anymore.

	* htmldrawqueue.c (draw_obj): Removed debugging message.

	* gtkhtml.c: Do not #include <stdio.h> anymore.
	(html_engine_draw_pending_cb): Removed debugging message.

	* htmlcursor.c (html_cursor_forward): Skip TextMaster-derived
	objects.

	* gtkhtml.c (key_press_event): Handle `GDK_Up' and `GDK_Down'.

	* htmlengine-edit.c (html_engine_move_cursor): Handle
	`HTML_ENGINE_CURSOR_UP' and `HTML_ENGINE_CURSOR_DOWN'.

	* htmlcursor.c (html_cursor_new): Init `target_x',
	`have_target_x'.
	(html_cursor_equal): New function.
	(html_cursor_up): New function.
	(html_cursor_down): New function.
	(html_cursor_forward): Set `have_target_x' to FALSE.
	(html_cursor_backward): Likewise.

	* htmlcursor.h: New members `target_x', `have_target_x' in
	`HTMLCursor'.

	* htmlobject.c (html_object_calc_abs_position): New function.

	* htmltextmaster.c (calc_char_position): Implementation of the
	`HTMLText::calc_char_position' method.
	(html_text_master_class_init): Install it.

	* htmltext.c (html_text_calc_char_position): New function.
	(calc_char_position): Default implementation for the
	`calc_char_position' method.
	(html_text_class_init): Install it.

	* htmltext.h: New virtual method `calc_char_position'.

1999-12-26  Ettore Perazzoli  <ettore@helixcode.com>

	* htmltext.c (insert_text): Relayout the parent instead of just
	this text.

	* htmlobject.c (relayout): Set the X/Y position manually if this
	is the toplevel object.  Ugly, but there is no way around it for
	now.

1999-12-23  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlengine-edit.c (html_engine_move_cursor): Queue a redraw for
	the cursor.

	* htmltextmaster.c (queue_draw): New function, implementation for
	the `queue_draw' method.
	(html_text_master_class_init): Install it.

	* htmltext.c (html_text_queue_draw): New function.
	(queue_draw): Default implementation for the `queue_draw' method.
	(html_text_class_init): Install it.
	(insert_text): Queue a draw if the parent did not change after
	relayout (and consequently did not queue a draw for itself).

	* htmltext.h: New virtual method `queue_draw'.

	* htmlclueflow.c (calc_size): Do not assign `o->y' anymore.  I am
	not 100% sure that this does not break anything, but at the same
	time I don't see any reason why the y value should be set here.
	So if this breaks, probably it means that something is broken
	somewhere else.

	* htmlcluev.c (calc_size): Replaced hideous binary shift with a
	multiplication.

        [1999-12-22]

	* htmlfont.c (create_gdk_font): `family' made const.
	(html_font_new): Removed unused variable.
	(create_gdk_font): Removed unused variable.

	* htmlcursor.c: #include "htmlclue.h".

	* htmlobject.h: Moved all the typedefs on top, before the #include
	section.

	* htmltext.c (html_text_insert_text): New parameter `engine'.
	(insert_text): New parameter `engine'.  Queue a redraw for the
	object.

	* htmltext.h: New parameter `engine' in method `insert_text'.

	* htmlobject.c (html_object_relayout): New argument `engine'.
	(relayout): New argument `engine'.  Queue a redraw for the object
	if the size changes and the object has no parent, or if the size
	changes and the parent's size does not change.

	* htmlobject.h: New argument `engine' in method `relayout'.

	* htmlengine.c (html_engine_queue_draw): New function.

	* htmlengine-edit.c (html_engine_move_cursor): Do not redraw
	everything.

	* htmlcursor.c (html_cursor_backward): Removed debugging message.
	(html_cursor_forward): Removed debugging message.

	* gtkhtml.c (html_engine_url_requested_cb): First argument
	corrected from `GtkHTML' to `HTMLEngine'.
	(html_engine_draw_pending_cb): New function.
	(gtk_html_new): Connect it to the "draw_pending" signal of the
	HTMLEngine.

	* htmlengine.c: New signal `draw_pending'.
	(html_engine_class_init): Install it.

	* htmlengine.h: Type of first argument in the `url_requested'
	method corrected from `GtkHTML' to `HTMLEngine'.  New signal
	`draw_pending'.

	* gtkhtml.c (idle_handler): New function, flushing the engine's
	draw queue.
	(init): Init it.
	(destroy): Remove pending idle handler.
	(queue_draw): New utility function installing the idle handler.

	* htmlengine.c (html_engine_flush_draw_queue): New function.

	* gtkhtml.h: New member `idle_handler_id' in `GtkHTML'.

	* gtkhtml.c (destroy): Call the parent class' `destroy' method.

	* htmlengine.h: New member `draw_queue' in `HTMLEngine'.
	* htmlengine.c (html_engine_init): Init it.
	(html_engine_destroy): Destroy it.

	* gtkhtml.c: Cleaned up a bit.

	[1999-12-21]

	* htmllinktext.c (html_link_text_new): Use `g_print' instead of
	`printf' for debugging messages.

	* htmltext.c (draw): Removed debugging mesasge.

	* htmlobject.h: New member `redraw_pending' in `HTMLObject'.
	* htmlobject.c (html_object_init): Initialize it to FALSE.

	* htmldrawqueue.c: New file.
	* htmldrawqueue.h: New file.

	* htmltextslave.c (draw): Draw the cursor if it's in the owner,
	instead of the slave.

	* htmlcursor.c (html_cursor_forward): Move on the masters instead
	of the slaves.  The slaves are not a good place for anchoring the
	cursor, as they can be destroyed/recreated without the cursor's
	control.
	(html_cursor_backward): Likewise.

	[1999-12-20]

	* htmlengine.c (html_engine_insert_text): `str' made const.
	`g_strdup()' strings before passing to the text object creation
	functions.

	* htmltextmaster.c (insert_text): New HTMLTextMaster-specific
	implementation for the `insert_text' virtual method.
	(html_text_master_class_init): Install it.

	* htmltext.c (insert_text): Make the text pointer point to the new
	buffer.

	* testgtkhtml.c (main): Removed unused variables.

	* gtkhtml.c (key_press_event): If we are given a nonempty string,
	insert it and move the cursor to the right.

	* htmltext.c (insert_text): Relayout parent.
	(html_text_class_init): Install `insert_text' as the default
	implementation for the `insert_text' method.

	* htmlengine-edit.c (html_engine_cursor_move): Renamed to
	`html_engine_move_cursor'.
	(html_engine_insert_text): New function; not quite finished yet.

	* htmlengine-cursor.c: Renamed to `htmlengine-edit.c'.
	* htmlengine-cursor.h: Renamed to `htmlengine-edit.h'.

	* htmlengine.h: Member `show_cursor' in `HTMLEngine' renamed to
	`editable'.

	* htmlengine.c (html_engine_show_cursor): Renamed to
	`html_engine_set_editable'.

	* htmlobject.c (html_object_relayout): New function.
	(relayout): Default implementation for `relayout'.
	(html_object_class_init): Install it.

	* htmlobject.h: New method `relayout'.

	* htmltextmaster.c (htmL_text_master_get_slave): New function.

	* htmltext.c: Make the `insert_text' method get an integer offset
	instead of a pointer to an `HTMLCursor' object.
	(html_text_insert_text): Updated accordingly.

	[1999-12-13]

	* htmlobject.c (html_object_check_point): Removed debugging code.
	(html_object_draw): Removed debugging code.

1999-12-20  Ariel Rios  <jarios@usa.net>

	* gtkhtml.h: (gtk_html_stream_unref): Moved
	  from gtkhtm-private.h as per Elliot's 
	  recomendation.
	  (gtk_html_stream_ref): Ditto.
	  
	* gtkhtml-private.h:(gtk_html_stream_unref) The function
	  header was moved unto gtkhtml.h
	  (gtk_html_stream_ref) Ditto.

1999-12-19  Jonas Borgstrm  <jonas_b@bitsmart.com>

	* htmlurl.c (html_url_append_path): Strip cgi args
	
1999-12-15  Ariel Rios <jarios@usa.net>
	
          Contributed by Marius Vollmer.

	* gtkhtml-private.h: Add ref_count element in GtkHTML struct.
	(gtk_html_stream_unref): New prototype.
	(gtk_html_stream_ref): New prototype.
	  These two functions would maintain a reference count on a
	  GtkHTMLStream handle so that the struct would only be freed when the
	  ref count reaches zero. gtk_html_stream_new would return a stream
	  with ref_count == 1 and gtk_html_stream_end would flag the stream as
	  terminated and call gtk_html_stream_unref; gtk_html_stream_write
	  would recognize a terminated stream.

	* htmlstream.c (gtk_html_stream_unref): Added.
	(gtk_html_stream_ref): Added.
	(gtk_html_stream_new): Added declararion of new ref_count element.
	(gtk_html_stream_write): Instead of g_freeing the stream here, we
	set write_callback and end_callback as NULL. Then we call
	gtk_html_stream_unref to g_free the handle.

1999-12-15  Havoc Pennington  <hp@redhat.com>

	* gtkhtml.c (gtk_html_realize): Add button press/release to the
	event mask so we get link clicks

1999-12-15  Havoc Pennington  <hp@redhat.com>

	* htmlurl.c (html_url_new): put in a phony path if we return
	because the path string has length 0

1999-12-15  Havoc Pennington  <hp@redhat.com>

	* testgtkhtml.c (main): remove explicit adjustment-setting

	* gtkhtml.c (gtk_html_new): no adjustment args, don't init the
	adjustment fields. This causes Breakage but it's necessary
	probably (and approved by Anders)

	* htmlurl.c (html_url_new): Put in a warning if an HTMLURL with
	NULL path is returned, this is a bug that needs fixing
	(html_url_append_path): put in an assertion that url->path != NULL

1999-12-15  Havoc Pennington  <hp@pobox.com>

	* gtkhtml.c (gtk_html_set_adjustments): zero the connection ID
	if we don't fill it in, avoids a warning message.

1999-12-14  Havoc Pennington  <hp@pobox.com>

	* gtkhtml.c (gtk_html_new): Use
	gtk_widget_set_scroll_adjustments() to set the adjustments
	(gtk_html_class_init): install a scroll adjustments handler
	(gtk_html_set_adjustments): implement this - it connects to the
	adjustments.
	(gtk_html_class_init): add destroy handler

	* gtkhtml.h: add fields to store adjustment connections

1999-12-13  Ettore Perazzoli  <ettore@helixcode.com>

	* gtkhtml.c (gtk_html_size_allocate): Do not call
	`html_engine_calc_absolute_pos' anymore.

	* htmlengine.c (html_engine_calc_absolute_pos): Removed.
	(html_engine_update_event): Do not call it anymore.

	* htmltable.c (calc_absolute_pos): Removed.
	(html_table_class_init): Do not install anymore.

	* htmlclue.c (calc_absolute_pos): Removed.
	(html_clue_class_init): Do not install anymore.

	* htmlobject.c (html_object_init): Do not initialize `abs_x',
	`abs_y' anymore.
	(calc_absolute_posi: Removed.
	(html_object_class_init): Do not install anymore.
	(html_object_calc_absolute_pos): Removed.

	* htmlobject.h: Remove `abs_x', `abs_y'.  Removed
	`calc_absolute_pos' virtual function.

1999-12-12  Miguel de Icaza  <miguel@helixcode.com>

	* htmlengine.c (draw_background): Removed the clipping from here,
	it fixes the double buffering problems.

	* htmlfont.c (create_gdk_font): Fixed memory leaks.

1999-12-12  Ettore Perazzoli  <ettore@helixcode.com>

	* gtkhtml.c (gtk_html_init): Use `GDK_HAND2' and `GDK_LEFT_PTR' as
	the hand/arrow cursors.

	* htmltext.c (html_text_insert_text): New function.
	(insert_text): New function.

	* htmltext.h: New virtual method `insert_text'.

	* htmlurl.c (html_url_destroy): Added precondition.

	* gtkhtml.c (gtk_html_set_geometry): Removed unused function.

	* htmlpainter.c (html_painter_set_font): Destroy the existing
	font, duplicate the new one.

	* htmlfont.c (html_font_destroy): Do not unref the GdkFont if
	NULL.
	(html_font_dup): New function.

	* testgtkhtml.c (title_changed_cb): Removed debugging message.
	Also, free memory returned by `g_strdup_printf()'.

	* htmltable.c (calc_col_info): Free existing row information
	before allocating new.
	(html_table_init): Make sure all the members are initialized.

1999-12-12  Jonas Borgstrm  <jonas_b@bitsmart.com>

	* htmlurl.c (html_url_to_string): html_url_to_string produced
	incorrect urls on url with a port number.
	
	* htmlengine.c (parse_i): Modified the image loading a bit.

1999-12-12  Jonas Borgstrm  <jonas_b@bitsmart.com>

	* testgtkhtml.c (on_stop): Delete all requests.
	(goto_url): Delete requests.

1999-12-12  Ettore Perazzoli  <ettore@helixcode.com>

	* htmltextslave.c (fit_line): Set `prev' on the next, if any.

	* gtkhtml.c (key_press_event): Move left too.

	* htmlcursor.c (html_cursor_backward): Implemented.
	(prev): Removed.

1999-12-12  Jonas Borgstrm  <jonas_b@bitsmart.com>

	* htmlengine.c (parse_table): Added support for backgrounds in tables.
	(parse_href): Better handling of "" hrefs.

	* htmlimage.c (html_image_factory_register(): Insert url into list
	before emitting signal.

	* htmlpainter.c (html_painter_draw_background: Added two
	parameters, pix_width, pix_height.

	* htmltablecell.c (draw): Added support for backgrounds:
	http.//www.themes.org looks great now :)
	(html_table_cell_set_pixmap): New function.

1999-12-12  Ettore Perazzoli  <ettore@helixcode.com>

	* testgtkhtml.c (on_link_followed): New function.
	(main): Instead of connecting `on_button_release_event' to the
	"button_release_event" signal, connect `on_link_followed' to
	"link_followed".
	 (on_button_release_event): Removed.

	* gtkhtml.c: `link_followed' signal renamed to `link_clicked'.
	(gtk_html_button_press_event): New function.  Not doing anything
	for now.
	(gtk_html_button_release_event): New function.  Emit
	"link_clicked" on button release if the pointer is on a URL.
	(gtk_html_class_init): Install them as the "button_press_event"
	and "button_release_event" implementations.

1999-12-11  Ettore Perazzoli  <ettore@helixcode.com>

	* htmltextslave.c (fit_line): Do not assign to `next_obj->prev' if
	`next_obj' is NULL.

1999-12-11  Jonas Borgstrm  <jonas_b@bitsmart.com>

	* htmlengine.c (html_engine_set_base_url): New function
	(parse_s): New function, added support for <small> and </small>
	(html_engine_begin): set newPage = TRUE
	(html_engine_update_event): Scroll page to top if newPage is set.

	* htmlengine.h:(html_engine): new member newPage
	
	* gtkhtml.c (gtkhtml_set_base_url): New function

	* testgtkhtml.c (main): Add a default filter callback (request_terminater).
	(request_terminater): New function. Terminates requests.
	(url_requested): Adds filters for 4 different redirections.
			 Redirections are now handled properly.
	(redirectFilter): New function. calls gtk_html_set_base_url on redirection.
	
	* htmlurl.c (html_url_new): if path == NULL set it to "/"
	(html_url_append_path) Cut the path at the first '/' from the right.
	
1999-12-11  Ettore Perazzoli  <ettore@helixcode.com>

	* htmltextslave.c (fit_line): Update the `prev' pointer.

	* htmltextmaster.c (fit_line): Update the `prev' pointer.

	* htmlclue.c (html_clue_append): Set the `prev' pointer as well.

	* htmlobject.c (html_object_init): Initialize it.

	* htmlobject.h: New member `prev' in `HTMLObject'.

	* htmlcursor.c (html_cursor_backward): New function, does nothing for now.

1999-12-11  Matt Wilson  <msw@redhat.com>

	* htmlurl.c (html_url_append_path): removed dependency on
	gnome by re-implementing g_concat_dir_and_file

1999-12-11  Elliot Turner  <turnere@MimeStar.com>

	* htmlengine.c (parse_m): New function to deal with the `meta'
	tag.
	(parse_table): Remove tmpCell stuff that resulted in random
	segfaults.
	(parse_i): Don't set the parent in the ClueAligned object in
	advance.
	(parse_table): Likewise.

1999-12-11  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlcursor.c (html_cursor_forward): Some navigation fixes.

	* debug.c (debug_dump_tree): Print out the value of the parent
	pointer too.

	* htmltextslave.c (fit_line): Set the parent on the slave.

	* htmltextmaster.c (fit_line): Set the parent on the slave.

	* htmltextslave.c (draw): Draw the cursor if the cursor is here.

	* htmltext.c (draw): Draw the cursor if the cursor is here.

	* htmlobject.c (draw): Draw the cursor if the cursor is here.

	* htmlobject.h: New argument `cursor' in the `draw' method.  All
	of the related functions updated accordingly.

	* htmlengine-cursor.h, htmlengine-cursor.c: New files.

	* gtkhtml.c (key_press_event): New function, implementation for
	the `key_press_event' virtual method.
	(gtk_html_realize): Removed double realization.  Also, add
	`GDK_KEY_PRESS_MASK' and `GDK_KEY_RELEASE_MASK' to the event mask
	for the bin window.

	* htmltext.c (draw_cursor): New function, implementation of the
	`draw_cursor' virtual method.
	(html_text_class_init): Install it.

	* htmlpainter.c (html_painter_draw_cursor): New function.

	* htmlcursor.c (html_cursor_forward): New function to make the
	cursor go forward on the tree.

	* testgtkhtml.c: Big hack to at least make the stop button really
	stop loading.  Something is still wrong, though, as we get no
	callback when the input stream ends.  Help is welcome.  So, there
	is a new local variable called `html_handle' to hold the main html
	stream handle.
	(goto_url): Initialize it with the return value from
	`gtk_html_begin'.
	(stop_cb): Stop the stream and set `html_handle' to NULL.

	* htmlengine.c (html_engine_end): Position the cursor at the
	beginning of the document.

	* htmlcursor.c (html_cursor_home): New function to position the
	cursor at the beginning of the document.

1999-12-10  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlcursor.c (html_cursor_destroy): Added precondition.

	* htmlengine.h (html_engine_get_doc_width): Added prototype.

	* htmlengine.c (parse_body): Add cast to `html_clue_append' call.

	* htmlpainter.h: New member `black' in `HTMLPainter', holding the
	GdkColor for black.
	* htmlpainter.c (html_painter_realize): Allocate it.

	* htmlengine.c (draw_cursor): New function.
	(html_engine_parse): Set the cursor to point at the first clue.

	* htmlpainter.c (html_painter_draw_line): New function.

	* htmlengine.h: New members `cursor', `show_cursor' in `struct
	HTMLEngine'.
	* htmlengine.c (html_engine_init): Init them.
	(html_engine_destroy): Destroy the cursor.

1999-12-11  Anders Carlsson  <andersca@gnu.org>

	* htmlengine.c (parse_body): Add a handler for the '\n' tag
	that's used for newlines in <pre>...</pre>

1999-12-11  Anders Carlsson  <andersca@gnu.org>

	* testgtkhtml.c (main): Set policy to only show scrollbars when needed.

	* gtkhtml.c (gtk_html_calc_scrollbars): use gtk_layout_set_size ();

1999-12-11  Anders Carlsson  <andersca@gnu.org>

	* testgtkhtml.c (main): Use a scrolled window instead of
	a scroll bar.

	* gtkhtml.c (gtk_html_horizontal_scroll): Added function.
	(gtk_html_new): Connect signal to function.
	(gtk_html_calc_scrollbars): Calculate adjustment for horizontal
	scrollbar as well.

	* htmlengine.c: Added functions for calculating document width

1999-12-10  Ettore Perazzoli  <ettore@helixcode.com>

	* htmlengine.h (html_engine_draw_background): Removed prototype.

	* htmlengine.c (html_engine_show_cursor): New function.
	(html_engine_init): Initialize `show_cursor' to TRUE.
	(html_engine_draw_background): Made static and renamed to
	`draw_background'.
	(html_engine_draw): Updated accordingly.

	* htmlengine.h: New flag `show_cursor' in `struct HTMLEngine'.

	* htmlcursor.c, htmlcursor.h: New files.

1999-12-10  Jonas Borgstrm  <jonas_b@bitsmart.com>

	* htmlengine.c (parse_i): Do not pass NULL pointer to
	html_url_to_string.
	
1999-12-10  Ettore Perazzoli  <ettore@helixcode.com>

	* All files: updated to match these changes.

	* htmlclue.c (html_clue_append): Set the parent of the object to
	this one.

	* htmlobject.h: New member `parent' in `HTMLObject'.
	* htmlobject.c (html_object_init): Set it to NULL.
	(html_object_set_parent): New function.

1999-12-10  Jonas Borgstrm  <jonas_b@bitsmart.com>

	* gtkhtml.c (gtk_html_begin): Scroll page to the top on new url
	
	* htmltokenizer.c (html_tokenizer_write): Fixing parsing of entity.
	
	* htmlentity.c (html_entity_parse): Corrected function.
	
1999-12-09  Miguel de Icaza  <miguel@gnu.org>

	* htmlpainter.c (html_painter_draw_pixmap): fix the offsets.

1999-12-09  Anders Carlsson  <andersca@gnu.org>

	* htmltable.c (draw): Doh! Fixed a silly bug where
	it checked c against totalRows, changing to r reallly
	speeded up test6.html

1999-12-09  Jonas Borgstrm  <jonas_b@bitsmart.com>

	* htmlengine.c (parse_a, parse_b, parse_i): Send Absolute urls to
	images.

	* testgtkhtml.c: New Features:
	  * Follow links with mouse click works now.
	  * Implemented Back, Forward, Reload, Home.
	  * Added popup menu (Back, Forward, Home)
	  * Added Go menu (Back, Forward, Home and History list)
	  * Added Wheel mouse scrolling support.
	  * Prepend "http://" To urls if needed.
	  
	* htmlurl.c (html_url_append_path): Fixed correct url handling.

1999-12-08  Miguel de Icaza  <miguel@gnu.org>

	* htmlpainter.c (html_painter_end): Another off-by one error fix.
	(html_painter_draw_panel): Adapt this routine to use the double
	buffering scheme
	(html_painter_draw_background_pixmap): Ditto.

	* htmlurl.c (html_url_append_path): Memory leak fix, and crash fix.

	* htmlpainter.c (html_painter_end): Fix off by one error.
	(html_painter_new): Double buffering is now the default.
	(html_painter_draw_pixmap): Remove soptimization to fix image repainting.
	(html_painter_draw_pixmap): Use proper API.  

1999-12-07  Ettore Perazzoli  <ettore@gnu.org>

	* htmlurl.c (scan_user_and_password): Renamed to `scan_host_info'.
	Do the right thing with URLs that do not have a slash after the
	host name (e.g. because there is no path).

	* htmlengine.c (parse_href): Do the right thing with
	duplicating/changing the HTMLURL structs.

1999-12-06  Ettore Perazzoli  <ettore@gnu.org>

	* testgtkhtml.c (on_url): Removed unused variable.
	(url_requested): Made `ctmp' const.

	* htmltype.c: #include "htmlanchor.h".

	* htmlobject.c (html_object_check_point): Removed unused variable.

	* gtkhtml.c (gtk_html_set_geometry): `#if 0'ed out as currently
	unused.

	* htmlengine.h: Changed type of `url' to `HTMLURL'.
	* htmlengine.c: All functions changed accordingly (i.e. to use
	`HTMLURL' internally, instead of `gchar *').

	* htmlengine.c (parse_href): New function for dealing with links
	properly (i.e. handling relative ones etc.).
	(parse_a): Use it.

	* htmlengine.h: New member `actualURL' in `HTMLEngine'.
	* htmlengine.c (html_engine_begin): Set it.
	(html_engine_init): Init it to NULL.
	(html_engine_destroy): Free it.

	* htmlurl.c: New file.
	* htmlurl.h: New file.

	* htmlfont.c (html_font_new): Made prototype const-safe.

	* htmlpainter.h (html_painter_draw_panel): New function prototype.

	* htmlclue.h (html_clue_append_left_aligned): Added missing prototype.

	* htmltokenizer.c (html_tokenizer_write): Parse the entity with
	`html_entity_parse()'.

	* htmlentity.c, htmlentity.h: New files dealing with entity.
	(html_entity_parse): New function.

	* htmlengine.c (parse_i): Use the current URL and target for the
	new image.

	* htmlimage.c (html_image_init): New parameters `url', `target'.
	(html_image_new): Likewise.

	* htmlimage.h: New members `url' and `target' in `HTMLImage'.

1999-12-03  Ettore Perazzoli  <ettore@gnu.org>

	* testgtkhtml.c (do_request_delete): Do not delete the request.  I
	am not sure if it's supposed to be necessary or not, but it does
	cause crashes.

	* htmlengine.c (parse_b): Oops, fix the `gtk_signal_emit()' calls.

	* htmlobject.c (html_object_get_url): Removed debugging message.

	* gtkhtml.c (gtk_html_motion_notify_event): Keep track of the
	current URL through `pointer_url'.  Also, emit the signal when the
	current URL changes.

	* testgtkhtml.c: Show usage of the `on_url' signal.

	* htmlimage.c (html_image_factory_register): Set the `stream'
	member to point to the newly created stream.
	(html_image_get_stream): New function returning a pointer to the
	stream object.

	* htmlimage.h: New member `stream' in `HTMLImage'.

	* gtkhtml.c (html_engine_title_changed_cb): New signal handler for
	the `title_changed' signal in the HTMLEngine.
	(html_engine_set_base_cb): Likewise for `set_base'.
	(html_engine_set_base_target_cb): Likewise for `set_base_target'.
	(html_engine_load_done_cb): Likewise for `load_done'.
	(gtk_html_new): Connect the signal handlers to the newly created
	object.
	(gtk_html_motion_notify_event): Don't free the URL we get from
	`html_engine_get_link_at()' anymore.

	* htmlengine.c (html_engine_begin): Emit the
	`url_requested_signal' after creating the stream.

	* htmlstream.c (gtk_html_stream_new): Do not make the GtkHTML
	widget emit any signal!

	* htmlengine.c: `html_engine_signals' renamed to `signals' and
	made static.  Also, added "set_base_target", "set_base",
	"load_done", "title_changed" own signals.
	(parse_b): Make the engine emit signals, not the owner widget.
	(parse_t): Likewise.
	(html_engine_end): Likewise.

	* gtkhtml-private.h: Removed signals from here.
	* gtkhtml.c: Moved here.  Also, changed the name from
	`html_signals' to `signals'.

	* gtkhtml.h, gtkhtml.c: New signal `on_url'.

	* gtkhtml.h: New member `pointer_url' in `GtkHTML'.
	* gtkhtml.c (gtk_html_init): Init it to NULL.
	(destroy): `g_free()' it.

	* gtkhtml.c (gtk_html_motion_notify_event): Updated to the const
	return of `html_engine_get_link_at()'.

	* htmlengine.c (html_engine_get_link_at): Return value made const.
	So, we don't strdup the value from `html_object_get_url()'
	anymore.

	* gtkhtml.c (destroy): New function, implementation of the
	`destroy' method.
	(gtk_html_class_init): Install it.
	(gtk_html_realize): Set the arrow cursor as the initial cursor for
	the new widget.

	* gtkhtml.h: New members `hand_cursor' and `arrow_cursor'.
	* gtkhtml.c (gtk_html_init): Init them.

	* htmlengine.c (html_engine_get_uri_at_pointer): Renamed to
	`html_engine_get_link_at'.
	* htmlengine.h: Updated likewise.
	* gtkhtml.c (gtk_html_motion_notify_event): Updated accordingly.

1999-12-04  Anders Carlsson  <andersca@gnu.org>

	* htmlsettings.c: Fix the correct number of font sizes, it's 7 not 6.

	* htmltable.c (draw): Use html_painter_draw_panel for table borders.

	* htmlpainter.c (html_painter_draw_panel): New function for drawing a
	3d panel.

	* htmlimage.c (draw): Use html_painter_draw_panel for pictures that
	are not yet loaded.

1999-12-03  Ettore Perazzoli  <ettore@gnu.org>

	* htmllinktextmaster.c (html_link_text_master_init): `url' and
	`target' made const.  Strdup before assigning.
	(html_link_text_master_new): Likewise.
	(get_url): Removed debugging message.

	* htmllinktext.c (html_link_text_init): Strdup the URL and the
	target strings.
	(html_link_text_new): Made the `url' and `target' arguments const.
	(html_link_text_init): Likewise.

	* htmltextslave.c (get_url): Implementation of the `get_url'
	virtual method.
	(html_text_slave_class_init): Install it.

	* gtkhtml.c (motion_notify_event): New function, handler for the
	`notify_event' signal.
	(gtk_html_class_init): Install it.

1999-12-04  Anders Carlsson  <andersca@gnu.org>

	* htmlcluev.c (appended): Traverse the aligned list, not the
	regular object tree list. This fixes the slashdot bug (Finally).

1999-12-03  Ettore Perazzoli  <ettore@gnu.org>

	* htmltable.c (check_point): Implementation of `check_point'.
	(html_table_class_init): Install it.

	* htmlcluev.c (check_point): Implementation of `check_point'.
	(html_cluev_class_init): Install it.

	* htmlclue.c (check_point): Implementation of `check_point'.
	(html_clue_class_init): Install it.

	* htmlobject.c (check_point): Default implementation for
	`check_point'.
	(html_object_class_init): Install it.
	(html_object_check_point): New function.
	
	* htmlobject.h: New virtual method `check_point'.

1999-12-03  Ettore Perazzoli  <ettore@gnu.org>

	* htmltable.c (mouse_event): New function, implementing the
	`mouse_event()' virtual method.
	(html_table_class_init): Install it.

	* htmlcluev.c (mouse_event): New function, implementing the
	`mouse_event()' virtual method.
	(html_cluev_class_init): Install it.

	* htmlclue.c (mouse_event): New function, implementing the
	`mouse_event()' virtual method.
	(html_clue_class_init): Install it.

	* htmlobject.c (mouse_event): Default implementation for
	`mouse_event()'.
	(html_object_class_init): Install it.
	(html_object_mouse_event): New function.

	* htmlobject.h: New virtual method `mouse_event()'.

	* htmllinktextmaster.c: The parent class is
	`HTMLLinkTextMasterClass', not `HTMLTextMasterClass'.

	* htmlobject.h: Renamed `ClearType' to `HTMLClearType'; made the
	ids uppercase and prefixed with `HTML_CLEAR_'.  Similiar treatmant
	for `HTMLVAlignType' and `HTMLHAlignType'.  Changed values for
	`HTMLFitType' to be all uppercase and be prefixed with `HTML_FIT'
	as well.  All instances updated.

1999-11-28  Ettore Perazzoli  <ettore@gnu.org>

	* htmlengine.c (parse_b): Handle `link=', `vlink=' and `text=' in
	`<body>'.
	(html_engine_init): Allocate `defaultSettings'.
	(html_engine_destroy): Free it.
	(html_engine_parse): AAARGH!  Colors must *never* be allocated
	with `g_new()'!  Anyway, we needed to push the default color, not
	an arbitrary black.
	(html_engine_parse): Allocate colors in the defaultSettings and
	copy to the settings.  Use the settings to set the initial font.
	(parse_a): Color and underline links according to the settings.
	(parse_table): Honour the `forceDefault' flag in the settings.
	(select_font_full): New helper function.
	(parse_c): Use it.  Set the correct font for `<code>'.
	(select_font_relative): New function.
	(parse_h): Use it to deal with header font sizes correctly.
	(parse_t): Use correct font for `<tt>'.
	(parse_p): Use correct font for `<pre>'.

	* htmlengine.h: New member `defaultSettings' in `HTMLEngine'.

	* htmlsettings.c (html_settings_set_font_sizes): New function.
	(html_settings_get_font_sizes): New function.
	(html_settings_reset_font_sizes): New function.
	(HTML_NUM_FONT_SIZES): New constant.
	(html_settings_alloc_colors): New function.
	(html_settings_copy): New function.
	(html_settings_set_fixed_font_face): New function.
	(html_settings_set_font_base_face): New function.

	* htmlsettings.h: Updated `HTMLSettings' to contain all the fields
	in the original KHTMLW code.  `fontbasesize' renamed to
	`fontBaseSize' and `bgcolor' to `bgColor', for consistency.

1999-11-28  Ettore Perazzoli  <ettore@gnu.org>

	* htmlengine.c (select_font_relative): Call `html_engine_set_font'
	so that it does not crash.

1999-11-28  Ettore Perazzoli  <ettore@gnu.org>

	* htmlimage.c (draw): Quick hack to always draw the border
	rectangle.

	* htmltablecell.h: Fixed typo in `HTMLTableCellClass'.

	* htmlobject.c (html_object_draw): Added debug message.

	* htmlcluev.c (draw): Add `x' to `tx' and `y - ascent' to `ty', as
	the original HTMLW code does.  Also, draw left-aligned items as
	well.  Also, I fixed the drawing calls: stupid polymorphism!

1999-11-27  Ettore Perazzoli  <ettore@gnu.org>

	* htmltokenizer.c (html_tokenizer_add_pending): Fixed typo: `%
	TAB_SIZE' instead of `& TAB_SIZE'.

1999-11-27  Ettore Perazzoli  <ettore@gnu.org>

	* htmlengine.h: Removed `parseFuncArray[]' from `struct
	_HTMLEngine'.
	* htmlengine.c: Moved here.
	(html_engine_init): Do not install `parseFuncArray' anymore.

	* htmlengine.c (parse_t): Implemented `<tt>' handling (wrong font
	though).

1999-11-26  Ettore Perazzoli  <ettore@gnu.org>

	* htmlengine.c (html_engine_init): Init `inPre', `inTitle'.
	(block_end_pre): New function.
	(parse_p): Implemented `<pre>' handling.  Also, call
	`close_anchor()' appropriately for the `<p>' case.
	(html_engine_pop_font): Report a warning if the stack is empty
	after popping to prevent segfault.
	(html_engine_new_flow): Handle `inPre'.
	(parse_v): New function, implementing `<var>'.
	(html_engine_init): Install it in the parsing vtable.
	(parse_u): Enable code for `<ul>'.

	* htmlengine.h: New member `inPre' in `HTMLEngine'.

1999-11-26  Ettore Perazzoli  <ettore@gnu.org>

	* htmlengine.c (html_engine_init): Init `tempStrings'.
	(html_engine_destroy): Free it.
	(to_roman): New function.
	(parse_l): Implemented ordered lists.
	(parse_o): Implemented.  (Parses only `<ol>' and not `<option>'
	for now.)
	(html_engine_init): Install `parse_o' in the parsing vtable.
	(block_end_list): Pop and destroy the list on the top of the
	listStack.

	* htmlengine.h: New member `tempStrings' in `HTMLEngine'.

	* htmlengine.c (html_engine_init): Init `glossaryStack'.
	(html_engine_destroy): Destroy it.
	(parse_d): Implemented `<dl>', `<dd>' and `<dt>' from the KHTMLW
	source.
	(html_engine_new_flow): Use the indent value from the HTMLEngine,
	not the clue!
	(parse_k): New function, parsing for the `<kbd>' tag.
	(html_engine_init): Install it.
	(parse_l): Call `close_anchor' for `<li>'.  Also, use
	`html_stack_is_empty()' instead of `html_stack_count()' for
	checking for emptiness.

	* htmlengine.h: New enum `HTMLGlossaryEntry'.  New member
	`glossaryStack' in `HTMLEngine'.

	* htmlstack.c (html_stack_clear): If the `free_func' is NULL,
	don't try to free elements.
	(html_stack_top): If the stack is empty, return NULL.

1999-11-26  Ettore Perazzoli  <ettore@gnu.org>

	* htmlengine.h: Replaced `HTMLListStack' with an `HTMLStack'.
	* htmlengine.c: Updated accordingly.

	* htmllist.h: `ListType' renamed to `HTMLListType', `ListNumType'
	renamed to `HTMLListNumType'.  Also, changed the values to upper
	case, and prefixed them with `HTML_LIST_TYPE' and
	`HTML_LIST_NUM_TYPE' respectively.  Occurrences updated.

	* htmllist.c, htmllist.h: Removed `HTMLListStack' implementation.

	* htmlengine.c (parse_a): Get `<address>' to work.

	* htmlengine.h: Replaced the `HTMLFontStack' with an `HTMLStack'.
	* htmlengine.c: Updated accordingly.

	* htmlfont.c, htmlfont.h: Removed the `HTMLFontStack'
	implementation.

	* htmlfont.c (html_font_new): Init `textColor'.
	(html_font_destroy): Free `textColor' if not NULL.
	(html_font_set_color): New function.
	* htmlengine.c (html_engine_parse): Use it.
	(html_engine_select_font): Use it.

	* htmlengine.h: Replaced the `HTMLColorStack' stack with a
	`HTMLStack'.
	* htmlengine.c: All the functions updated accordingly.
	(html_engine_pop_color): Free the popped color.

	* htmlcolor.c, htmlcolor.h: Removed.  #inclusions from other
	source files removed as well.

	* htmlstack.c, htmlstack.h: Implementation of a generic
	`HTMLStack' type.

	* htmlengine.c: New typedef `BlockStackElement'.
	(block_stack_element_new): New static function, derived from
	`html_stack_element_new()'.
	(html_engine_push_block): Updated to use it.
	(html_block_stack_element_free): New function.
	(html_engine_free_block): Updated to use it.
	(html_engine_push_block): Removed.
	(push_block): New static function replacing it.  Former callers of
	`html_engine_push_block' updated to use it.
	(html_engine_free_block): Removed.
	(free_block): New static function replacing it.  Former callers of
	`html_engine_free_block' updated to use it.
	(html_engine_pop_block): Removed.
	(pop_block): New static function replacing it.  Former callers of
	`html_engine_pop_block' updated to use it.
	(html_engine_block_end_font): Removed.
	(block_end_font): New static function replacing it.  Former
	callers of `html_engine_block_end_font' updated to use it.
	(html_engine_block_end_color_font): Removed.
	(block_end_color_font): New static function replacing it.  Former
	callers of `html_engine_block_end_color_font' updated to use it.
	(html_engine_block_end_list): Removed.
	(block_end_list): New static function replacing it.  Former
	callers of `html_engine_block_end_list' updated to use it.
	(html_engine_block_end_indent): Removed.
	(block_end_indent): New static function replacing it.  Former
	callers of `html_block_end_indent' updated to use it.
	(html_engine_block_end_div): Removed.
	(block_end_div): New static function replacing it.  Former callers
	of `html_engine_block_end_div' updated to use it.
	* htmlengine.h: Updated prototypes accordingly.

	* htmlengine.h: New typedef `HTMLBlockStackElement' that will
	replace former `HTMLStackElement'.

	* htmlstack.c (html_stack_element_new): Removed.  This function is
	only used by `htmlengine.c' for the block stack, so the name is
	misleading.

	* htmlengine.c (parse_d): Enable code for `</div>' which was `#if
	0'ed by mistake.

1999-11-26  Ettore Perazzoli  <ettore@gnu.org>

	* htmlengine.c (parse_table): Call `close_anchor()' when `</table'
	is encountered.  Added support for `<caption>'.  Handle headings.
	Destroy objects correctly.  Handle Left/Right alignment.  With all
	of this, this function should finally be completely ported.
	(set_base_url): New function; for now it's just a dummy.
	(select_font_relative): New function; incomplete.
	(html_engine_block_end_indent): New function.
	(parse_b): Ported `<base>', `<big>' and `<blockquote>' from
	KHTMLW.
	(parse_c): Added `<cite>' and `<code>'.  Font for `<code>' is
	wrong for now.
	(html_engine_begin): Removed unused variable.
	(html_engine_block_end_div): New function.
	(parse_d): New function, implementing only `<dir>' and `<div>' for
	now.
	(html_engine_init): Install it in the parse array.

	* htmlcluev.c (remove_aligned_by_parent): Implemented (from
	`HTMLClueV::removeAlignedByParent()').
	(calc_size): Call it (as the corresponding KHTMLW function did).

	* htmlclueflow.c (calc_size): Handle clear types correctly, using
	`html_clue_get_{left,right}_clear()'.

	* htmlclue.c (html_clue_get_right_clear): New function.
	(html_clue_get_left_clear): New function.
	(get_left_clear): Default implementation of the `get_left_clear()'
	virtual method.
	(get_right_clear): Default implementation of the `get_right_clear()'
	virtual method.
	(html_clue_class_init): Install them.
	(find_free_area): Default implementation changed to match the
	KHTMLW one.

	* htmlclue.h: New virtual methods `get_right_clear()' and
	`get_left_clear()'.
	(html_clue_get_right_clear): New prototype.
	(html_clue_get_left_clear): New prototype.

1999-11-26  Anders Carlsson  <andersca@gnu.org>

	* htmlengine.c (html_engine_draw_background): Use the new function
	when drawing backgrounds.

	* htmlpainter.c (html_painter_draw_background_pixmap): Added a new
	function for drawing the background pixmap.

	* debug.c: Adapted the debug code to the new object system.

	* htmlbullet.c (draw): Fixed the bullet redraw bug.

	* htmlimage.c (draw): Fixed the image redraw bug.

1999-11-25  Ettore Perazzoli  <ettore@gnu.org>

	* htmlengine.c: Added `ID_I' to enum `ID'.
	(parse_h): Removed extra `html_engine_select_font()' call which
	should not be there.
	(parse_i): Added code to deal with the `<i>' tag.
	(html_engine_set_named_color): Aaargh.  Return `TRUE'!
	(parse_a): Pass `TRUE' as the last argument to
	`html_engine_push_block()' when doing the "address" tag.

	* htmlengine.c (html_engine_set_named_color): Return value made
	`gboolean': return FALSE if the color could not be parsed.
	(parse_b): If `html_engine_set_named_color()' fails, don't mark
	the color as set.
	(parse_table): Likewise.

	* htmlengine.h (html_engine_set_named_color): Updated prototype.

1999-11-24  Ettore Perazzoli  <ettore@gnu.org>

	* htmllinktextmaster.c (html_link_text_master_class_init): Assign
	`parent_class' correctly.

	* htmlengine.c (parse_table): Use `html_object_set_bg_color()'
	instead of setting `cell->bg' directly.  Also, avoid using the
	colors if they have not set explicitly.  This fixes the random
	color bugs we were having with tables.

	* htmltablecell.c (set_bg_color): Implementation of the
	`set_bg_color' virtual method for HTMLTableCell.
	(html_table_cell_class_init): Install it.

	* htmlobject.c (html_object_set_bg_color): New function.
	(set_bg_color): Default implementation for the `set_bg_color'
	method.
	(html_object_class_init): Install it.

	* htmlobject.h: New virtual method `set_bg_color'.

	* htmltablecell.h: New member `have_bg' in `HTMLTableCell'.
	* htmltablecell.c (html_table_cell_init): Init it to `FALSE'.
	(draw): Don't draw the background if you don't have a background
	color.

	* htmlengine.c (parse_l): Removed allocation of `fontbasecolor'.
	(html_engine_draw_background): `bgColor' is now always allocated.
	(html_engine_parse): `settings->bgcolor' is no longer a pointer,
	so deal with it.
	(parse_h): Added code from KHTMLW to deal with different alignments
	and sizes.

	* htmlsettings.h: Type of members `bgcolor' and `fontbasecolor' in
	`HTMLSettings' changed from `GdkColor *' to `GdkColor'.
	* htmlsettings.c (html_settings_destroy): Updated accordingly.
	(html_settings_new): Likewise.

	* htmlengine.c (parse_b): Updated accordingly.
	(html_engine_parse): Likewise.
	(html_engine_draw_background): Likewise.

	* htmlengine.h: Type of member `bgcolor' in `HTMLEngine' changed
	from `GdkColor *' to `GdkColor'.

	* htmlclue.c (draw): Do not draw a green rect around the clue
	anymore.

	* htmltablecell.c (draw): Removed meaningless check for a non-zero
	pixel value.

	* htmlengine.c: Added `ID_EM' to enum `ID'.
	(parse_e): New function, imported from KHTMLW.
	(html_engine_init): Install it.

	* htmlengine.c: Renamed all the `html_engine_parse_*()' functions
	to `parse_*()', made static and moved to the top of the file.
	* htmlengine.h: Removed public prototypes accordingly.

1999-11-23  Ettore Perazzoli  <ettore@gnu.org>

	* htmlengine.c (html_engine_new_flow): Updated accordingly.
	(html_engine_insert_vspace): Updated accordingly.
	(html_engine_insert_text): Updated accordingly.
	(html_engine_parse_b): Updated accordingly.
	(html_engine_parse_i): Updated accordingly.
	(html_engine_parse_l): Updated accordingly.
	(html_engine_parse_f): Fixed allocation of `color' which caused a
	memory leak.

	* htmlclue.c (html_clue_append): Type of arg `clue' changed to
	from `HTMLObject' to `HTMLClue'.

	* htmlengine.c (html_engine_parse): Use `lucida' instead of
	`times' (temp hack).

	* htmlfont.c (create_gdk_font): Temp hack to make font handling
	behave a little more sanely.

	* htmlcluev.h: Fixed braino `HTMLClue' -> `HTMLClueClass'.

	* htmlengine.c (html_engine_insert_text): Ported all the code from
	the corresponding function in KHTMLW.
	(html_engine_parse_a): New function, ported from
	`KHTMLWidget::parseA' in KHTMLW.
	(html_engine_init): Install it.
	(close_anchor): New helper function, ported from
	`KHTMLWidget::closeAnchor()'.

	* htmlengine.h: New members `url', `target' and `baseTarget' in
	`struct _HTMLEngine'.
	* htmlengine.c (html_engine_init): Init them.
	(html_engine_destroy): Free them.

	* htmltype.h: New types `HTML_TYPE_LINKTEXT',
	`HTML_TYPE_LINKTEXTMASTER'.
	* htmltype.c (html_type_name): Updated accordingly.

	* htmllinktextmaster.c: New file, implementing the
	`HTMLLinkTextMaster' class.

	* htmlobject.c (get_url): Default implementation for the `get_url'
	virtual method.
	(get_target): Default implementation for the `get_target' virtual
	method.
	(find_anchor): Default implementation for the `find_anchor'
	virtual method.
	(html_object_class_init): Install these functions in the class
	structure.
	(html_object_get_url): New function.
	(html_object_get_target): New function.
	(html_object_find_anchor): New function.

	* htmlobject.h: New virtual methods `get_url', `get_target' and
	`find_anchor' in `HTMLObjectClass'.

	* htmlengine.h: Replaced `HTMLFontWeight weight' with `gboolean
	bold'.
	* htmlengine.c (html_engine_parse): Updated accordingly.
	(html_engine_select_font): Likewise.
	(html_engine_parse_b): Likewise.
	(html_engine_parse_h): Likewise.

	* htmllinktext.c, htmllinktext.h: New files, implementing the
	`HTMLLinkText' class.

	* htmlanchor.c, htmlanchor.h: New files, implementing
	`HTMLAnchor'.

1999-11-17  Ettore Perazzoli  <ettore@gnu.org>

	* htmlengine.c (html_engine_parse_body): Handle empty space
	correctly.  (Added a bunch of lines from the KHTMLW original.)
	This fixes the bug reported in the previous ChangeLog entry.
	(html_tokenizer_write): Added missing increment for `t->dest' when
	a sequence that is too long is ignored.

1999-11-17  Ettore Perazzoli  <ettore@gnu.org>

	* htmltokenizer.c (html_tokenizer_write): Changed handling of
	space according to the KHTMLW source; I am not sure why it was
	done differently.  Something is still wrong though, as `<li> <p>'
	introduces a vspace while `<li><p>' does not.

	* htmlengine.c (html_engine_parse_l): Set `vspace_inserted' to
	TRUE when parsing `li'.  Otherwise, things like
	`<li><p>text</p></li>' incorrectly insert a newline between the
	bullet and the text.

1999-11-17  Ettore Perazzoli  <ettore@gnu.org>

	* Makefile.am (dist-hook): Removed wrong `cp' line.
	(libgtkhtml_HEADERS): Added `gtkhtml-private'.

	* Reimplemented object handling for all the object classes.  We
	still need to fix all the `destroy' handlers and generally
	double-check that things are working right.

	* htmltype.c, htmltype.h: New files implementing a very minimal
	static object system.

	* debug.c (debug_dump_object_type): Removed.
	(debug_dump_tree): Do nothing for now, while we fix the object
	system.

1999-11-11  Elliot Lee  <sopwith@redhat.com>

	* testgtkhtml.c: WWW_SOURCE, not WWW_PRESENT (so it will work with local files).
	* htmlengine.c: Use canonicalized URL for stream creation.

1999-11-09  Ettore Perazzoli  <ettore@gnu.org>

	* Makefile.am: Compile as a standalone library `libgtkhtml.la'.

1999-10-30  Michael Meeks  <mmeeks@gnu.org>

	* html-component.c (embeddable_factory): Add persist stream interface.
	Set stream item = NULL.
	(embeddable_destroy_cb): Kill stream after use.
	(embeddable_load, load_html_from_stream): vicious hack.
	(save_html): stub.
	(view_factory): Hack out view_date->html and move into embeddable_data,
	far reaching change; we need doc / view.

	* Makefile.am (gnorba_DATA): redundant ( kill ).

1999-10-30  Michael Meeks  <mmeeks@gnu.org>

	* Makefile.am (gnorba_DATA): Add gnorba install.

	* html-component.c (update_view): just do a gtk_widget_queue_draw +
	fix args. (view_update): kill.

1999-10-28  Miguel de Icaza  <miguel@gnu.org>

	* htmlpainter.c (html_painter_begin): Use the propper offset here
	when clearing the rectangle.

	* gtkhtml.c (gtk_html_vertical_scroll): Remove the spurious call
	to repaint the whole exposed region.
	(gtk_html_new): If the adjustment was not passed, create it, so
	that we can connect to the signal changed emmission before the
	layout

	* htmlpainter.c (html_painter_draw_text): Adjust the text output
	offset too.

1999-10-26  Miguel de Icaza  <miguel@gnu.org>

	* gtkhtml.c (gtk_html_vertical_scroll): Do not force a redraw anymore.
	(gtk_html_new): Now we take two adjustment arguments.
	(gtk_html_init): Do not create an artificial scrollbar nor its
	adjustments. 
	(gtk_html_calc_scrollbars): This should be no longer required;  An
	alternate mechanism should be pursued.
	(gtk_html_calc_scrollbars): Update the adjustment here.
	(gtk_html_init): Set the APP_PAINTABLE bit here.

1999-10-25  Miguel de Icaza  <miguel@gnu.org>

	* htmlengine.c (html_engine_timer_event): Use exported routines to
	access the painter.

	* htmlpainter.c (html_painter_clear, html_painter_realize,
	html_painter_being, html_painter_end): New methods to implement
	double buffering.
	
	Moved HTMLPainter structure here to make it completely opaque.

	Added preconditions everywhere.

	Made all methods aware of the painter offset, to support double
	buffering. 
	
1999-10-24  Miguel de Icaza  <miguel@gnu.org>

	* gtkhtml.c (gtk_html_unrealize): Added unrealize handler.

1999-10-24  Richard Hult  <rhult@frenzy.hemmet.chalmers.se>

	* testgtkhtml.c (main): Exit when the window is deleted.

1999-10-23  Miguel de Icaza  <miguel@gnu.org>

	* htmltextmaster.c (html_text_master_fit_line): Use
	html_object_destroy here instead of g_free directly.

	* htmlengine.c (html_engine_parse_b): Set the color using the
	proper API to insure proper color allocation management (Gdk uses
	chunks).

	* htmlsettings.c (html_settings_destroy): New method.
	(html_settings_set_bgcolor): New method.

	* htmllist.c (html_list_destroy): New method.
	(html_list_stack_clear): Implement.

	* htmlcolor.c (html_color_stack_destroy): Added destroy method.
	(html_color_stack_clear): Implemented.

	* htmlfont.c (html_font_stack_destroy): Added destroy method.

	* stringtokenizer.c (string_tokenizer_destroy): Added destroy method.

	* htmltokenizer.c (html_tokenizer_destroy): Added destroy method
	and release reosouorces.
	(html_tokenizer_reset): Free buffers here.

	* htmlengine.c (html_engine_class_init): Added destroy handler.

	* htmltokenizer.c (html_tokenizer_begin): Fixed FIXME.

	* htmlcluev.c (html_cluev_appended): Initialize this one.
	(cluev_next_aligned): Utility routine to kill warnings.

	* htmlfont.c (html_font_destroy): Add a destructor for fonts.
	(html_font_stack_clear): Added font stack destruction code.

	Added precondition entry points.
	
1999-10-17  Richard Hult  <rhult@hem2.passagen.se>

	* htmlengine.[ch]: Turn the engine into a GtkObject.

1999-10-17  Anders Carlsson  <andersca@gnu.org>

	* testgtkhtml.c: The goto button shouldn't be able to focus

1999-10-17  Richard Hult  <rhult@hem2.passagen.se>

	* html-component.c: Use a GtkHTML widget directly instead of duplicating the code here.

1999-10-17  Anders Carlsson  <andersca@gnu.org>

	* testgtkhtml.c: More work on the ui

1999-10-17  Richard Hult  <rhult@hem2.passagen.se>

	* Makefile.am: Fixed component build.
