


Plugins should go into $prefix/lib rather than $prefix/libexec
in order to be FHS compliant.

What is needed to use Richtext standalone as a single line text
widget that can replace Textfield? The resources are:
+top_row: top row, default 1. No changes needed.
+top_col: top col, default 1. No changes needed.
+sel_top_row, sel_top_col, sel_bottom_row, sel_bottom_col: selection,
+	default 0 (no selection). No changes needed.
+point_row, point_col: default (0,0). Must be handled by widget.
+row_height: function which returns the height of a given row.
+	Must be set to a function that returns some dummy height.
+adj_horiz: function which returns the horizontal adjustment.
+	Must be set to a function which returns HADJ_LEFT.
+style: function which returns the style. Must be set to a
+	function which returns 0.
+bop: function which returns True if a line is a bop. Must be set
+	to a function which returns False.
+text: function which returns the text of a line (?). Must be set
+	to a function which returns the internally managed data.
+data: pointer to some arbitrary data, a window structure in PW's
+	case. Can be left as the default NULL
+redisplay: boolean which causes the widget to redraw itself when
+	set to True. No need to change.
+visible_cursor: boolean which causes the cursor to be drawn if True.
+	Should be True to be used as a text widget.
+paper_width: default is 595, but that is totally inappropriate.
+	Should probably be the widget width, or infinity, or something.
+left_margin: default is 72, but 0 seems much better.
+right_margin: ditto.
+tab_distance: the default 36 is just fine.
+plugin_coords: function which returns the coordinates of a plugin.
+	We're not going to have any, so this resource can be anything.
+zoom: this will be used exactly as in PW; the default 1.0 can be kept
+	unless we want to change it.
+In addition, SelfInsertChar should be returned to pw application code
+and replaced with one that operates on the widget's own data.
More actions must be written, e.g. to move the point. New functions
+RichtextSetString and RichtextGetString work as the Textfield
+equivalents and take plain C strings as arguments.
+A new resource called format specifies what format should be used for
+characters that are entered. Defaults to 0. Another resource, rc_string,
+stores the richtext string being edited.
It seems that this will result in a widget that does much of what
pw does already. It would be a good idea to integrate as much as
possible. Another good idea would be to replace all TextField widgets
with Richtext.


Siag: row and column headings are off.

Since the TextField widget can't zoom, in-place editing in Siag will have
to be done using another widget. The Richtext widget is an obvious
candidate, but needs some work before it can be used as a general-purpose
text widget.

Zoom plugins, or at least images.

Replace applications.scm with applications.sh, which looks like:

viewer=gvu
lpr=lpr
editor=kedit
help=kdehelp
filer=xfiler
terminal=konsole
calculator=kcalc

Then create the program siagrun.sh, which looks like:

#!/bin/sh
if [ ! -f $HOME/.siag/applications.sh ]; then
	cat > $HOME/.siag/applications.sh << EOF
viewer=gvu
lpr=lpr
editor=xedplus
help=siaghelp
filer=xfiler
terminal=xterm
calculator=xcalc
EOF

. $HOME/.siag/applications.sh



Update fileio_html to deal with the features in xlHtml:
 - Convert HTML entities like &nbsp; (should be done anyway)
 - Recognize expressions as such
 - Adjust line widths automatically
 - Grok some of the formatting:
	<BODY TEXT="#nnnnnn BGCOLOR="#nnnnnn">
	<CENTER></CENTER>
	<FONT FACE="Arial"></FONT>
	<TR ALIGN="center/left/right" VALIGN="ignore">
Look for this line: <meta name="GENERATOR" content="xlHtml">
But just converting &nbsp; would actually make a whole lot of difference.



The font/format handling code has an api that is much too wide:
too many fuctions and too many datastructures. It should be possible
to keep encode_format and decode_format and remove everything else.
Remove all datastructures from public view. font_list and color_list
are necessary for the user interface. font_ascent and font_descent are
needed too, as are font_height and font_width.
As an example, let's say we are developing a widget which will display
scaled multifont text. We would like to do something like:
for (i = 0; text[i].c; i++) {
	adjust_gc(gc, text[i].f, zoom);
	print_char(x, y, gc, text[i].c);
	x += char_width(text[i], zoom);
}
Note: this does not take into account line wrapping, white space,
adjustment, line height and so on. We'll graft that on later.
	

PW: transfer control over the data from the application to the
Richtext widget. This so that Richtext can be used on its own.
Changes required: enormous. The sheet datastructure must be encapsulated
in the widget rather than the application. Actions must be rewritten
to not require SIOD. Yuk.
The text must have a reasonable representation in the widget. I would
prefer to have a single string of richtext characters with lines separated
by newlines, but then we lose the styles. PW stores each line as
height, style, adjustment, bop and richtext. The widget would need to
do the same for each line. It would also need to store all this info:
point row and column, mark row and column, top, block boundaries,
number of allocated and used lines, the lines as specified above,
and finally the plugins. Whew.

PW: give one ruler, grid, hscroll and vscroll to
each sheet. Move all the position tracking from pw to xcommon,
i.e. remove point_pos, mark_pos, top, blku and blkl from
struct sheet.

OTOH, use one Richtext widget for each sheet. It looks like I'm
about to wreck the "device independence".

PW: Bootstrap in this order:
1. Initialize the window system. This creates the main application
   window, but no document window. It will work fine thanks to the
   Rudegrid.
2. Create a single application window, with no buffer associated.
   There will never be more than one such window. I'm scrapping
   that functionality.
2a. Load pw.scm and any other Scheme code that needs X. Must rewrite
   siodi.c so it can run without the presence of buffers.
3. If there are command line arguments, use them to load files.
   For each document, create a buffer. For each sheet, create a Richtext.
   The parent of the widget must be the single application window.
4. If no files were loaded, create a dummy "Noname" document using
   a single sheet in a single buffer.
I'll be better off rewriting the whole thing from scratch, starting
with a dummy application. Scrap the nspw directory, get rid of legacy
code and write a word processor that does not attempt to be "device
independent" or use widgets that are so general purpose that nothing
else can use them.



Change plugin coordinates to use pixels rather than cells.

There is something strange going on with the styles in PW.

Unredirect stderr when executing child processes; unrelated popups
are quite annoying.



Old bugs from before 3.2.0 follow.

--------


Fix Chimera, i.e. make a Really Neato version.

Plotting appears to be broken and Gnuplot has many new
features in 3.7.

Integrate libMagick and libxmagick.

Xedplus: Menu entry to send mail. Display row/column on status
line.

Xedplus: Open a file. Save it. The filename should already be
present in the file selector.

Siag: Add missing functions in scheme.html. They are:
print-format, make-backups, change-margins, change-paper-size,
change-headfoot, cut-block-to-string, copy-block-to-string,
paste-block-from-string, edit-python, define *standard-interpreter*,
change-interpreter, interpreter-test, add-property,
smart-fill-block, sort-block, change-first-page, set-standard-width,
set-standard-height, set-standard-format, siag-net, enter-date,
enter-time, what-cursor-position, recalc-matrix, add-sheet,
remove-sheet, rename-sheet, move-sheet-up, move-sheet-down,
move-sheet-top, move-sheet-bottom, beginning-of-buffer,
end-of-buffer, top-of-buffer, bottom-of-buffer, go-to,
a1-refs-set, save-preferences, plot-plugin, exec-python,
spawn, set-environment, edit-applications, form-test, form-test2,
form-test3, plugin-import, plugin-export, plugin-link,
plugin-delete, plugin-move, plugin-resize, do-link, aboutbox,
aboutsiag. And most of the stuff in keys.html.

PW: Add missing functions in scheme.html.

Egon: Add missing functions in scheme.html.

Siag: there are probably colour-related bugs in the format code,
similar to the border-related ones fixed earlier.
