Replaced the screen struct with SOS classes.
authorMatt Birkholz <matt@birkholz.chandler.az.us>
Mon, 17 Jan 2011 08:49:44 +0000 (01:49 -0700)
committerMatt Birkholz <matt@birkholz.chandler.az.us>
Thu, 2 Jun 2011 17:39:51 +0000 (10:39 -0700)
commit3c5c50697e7f26c1e7ecd3d1b80b7bab0445c227
treeea0f627f1cdf84d77f928dd5675c5f39e51a9ad8
parent23d8c71096dee83d69f85c6047fa5548fc58c998
Replaced the screen struct with SOS classes.

* src/edwin/buffrm.scm (buffer-frame-needs-redisplay?): Punted; not in
use, and the only user of buffer-window/needs-redisplay?.

* src/edwin/bufwfs.scm (draw-region!, %scroll-lines-up)
(%scroll-lines-down): Should only be used in the tty-screen-specific
output optimizer, and thus may use tty-screen-specific procedures.

* src/edwin/bufwin.scm (buffer-window:update-display!): Check that the
:update-display! message is sent to buffer-windows on tty-screens
only.

(buffer-window/direct-update!): Use the new update-screen-window!
generic procedure, which dispatches according to the screen type.
Moved the original, tty-screen-specific code to a new procedure:
update-tty-screen-window!.

(buffer-window/redraw!): Genericized; moved the tty-screen-specific
code to a new procedure, tty-screen/buffer-window/redraw!.
Non-tty-screen windows just punt.

(buffer-window/set-buffer!): Call update-modified-tick!, else
%window-modified-tick can be #f, causing %notice-window-changes to
complain.  Found when running Edwin interpretively.  The compiled code
had no problem with (fix:> (group-modified-tick group) #f)!

(update-override-string!): Use the tty-screen-specific procedure
tty-screen-get-output-line.  The screen is necessarily a tty-screen
because this procedure is only called by update-buffer-window!, which
is only called by update-tty-screen-window! and
buffer-window:update-display!.

* src/edwin/bufwiu.scm: Genericized the direct-output procedures,
moving their tty-screen-specific code to new procedures named
e.g. tty-screen/buffer-window/direct-output-insert-newline!, which can
safely call e.g. tty-screen-direct-output-move-cursor.  Other types of
screens will, probably, not support direct output.

(buffer-window/needs-redisplay?): Punted; used only by
buffer-frame-needs-redisplay?, which was punted.

* src/edwin/edtfrm.scm (set-editor-frame-size!): Conditionalized a
tiny bit of tty-screen-specific code.

* src/edwin/edwin.pkg: Include SOS.  Renamed several procedures from
screen-... to tty-screen-...  Punted screen-in-update?,
screen-needs-update? and with-screen-in-update?. The "needs-update?"
and "in-update?"  slots are now tty-screen-specific.  Export
tty-screen? for general use.  Export update-screen-window! for use by
buffer-window/direct-update!, and with-tty-screen-in-update for use by
update-tty-screen-window!.  Punted buffer-frame-needs-redisplay?.
Export update-tty-screen-window! so it can be used to implement the
tty-screen method of update-screen-window!.  The method could not be
defined directly in bufwin.scm because define-method means something
different there.

* src/edwin/edwin.sf, src/edwin/make.scm: Load option 'SOS when
syntaxing or loading.

* src/edwin/modwin.scm, src/edwin/utlwin.scm: The :update-display!
message is sent only to windows on tty-screens, so tty-screen-specific
procedures can be used.

* src/edwin/screen.scm: Replaced the screen struct with SOS classes
<screen> and <tty-screen>.  Most of its slots, related to the output
optimizer, went into <tty-screen>, and code using the old
accessor/mutator procedure names was updated.  Some uses moved to
tty-screen-specific methods of new generic procedures like
update-screen!.  Some users, e.g. terminal-output-char, obviously
assume a tty-screen argument.  Others, e.g. screen-move-cursor,
changed their names to show their tty-screen-specificity.  Thus all
users, and users of users, of tty-screen-specific code were updated.

* src/edwin/tterm.scm (scroll-draw-cost): Use tty-screen-specific
procedure tty-screen-line-draw-cost in, which is only used by
console-scroll-lines-up/down!.
12 files changed:
src/edwin/buffrm.scm
src/edwin/bufwfs.scm
src/edwin/bufwin.scm
src/edwin/bufwiu.scm
src/edwin/edtfrm.scm
src/edwin/edwin.pkg
src/edwin/edwin.sf
src/edwin/make.scm
src/edwin/modwin.scm
src/edwin/screen.scm
src/edwin/tterm.scm
src/edwin/utlwin.scm