I'd like to check whether I understand how CLIM's redisplay features
work. Suppose an application frame pane is defined like:
(my-pane :application :display-function 'my-pane-display)
and `my-pane-display' doesn't include any calls to incremental
redisplay forms. If the application frame is exposed after being
previously obscured in whole or in part (e.g. after deiconifying the
frame, changing the stacking order, etc.), CLIM does a *full*
redisplay, i.e. it redraws everything drawn by `my-pane-display'.
If, on the other hand, the application wants to take advantage of
incremental redisplay, it has to both add `:incremental-redisplay t'
to the pane definition, *and* add appropriate incremental redisplay
forms--e.g. `updating output'--to the body of `my-pane-display'. Is
this correct?
Paolo
--
Why Lisp? http://alu.cliki.net/RtL%20Highlight%20Film
Paolo Amoroso <·······@mclink.it> writes:
> I'd like to check whether I understand how CLIM's redisplay features
> work. Suppose an application frame pane is defined like:
>
> (my-pane :application :display-function 'my-pane-display)
>
> and `my-pane-display' doesn't include any calls to incremental
> redisplay forms. If the application frame is exposed after being
> previously obscured in whole or in part (e.g. after deiconifying the
> frame, changing the stacking order, etc.), CLIM does a *full*
> redisplay, i.e. it redraws everything drawn by `my-pane-display'.
The display function is run after a command is executed
to reflect the new state of the application. It's also possible to
avoid calling any display function by specifying :display-time nil for
a pane. This is the default for interactors because all of the output
for an interactor happens during the command itself.
The display function doesn't have anything to do with "redisplay" that
happens as a result of exposure events or whatever; that "redisplay"
is handled by replaying output records that capture drawing
operations. Only the output records that intersect the exposed region
are replayed.
>
> If, on the other hand, the application wants to take advantage of
> incremental redisplay, it has to both add `:incremental-redisplay t'
> to the pane definition, *and* add appropriate incremental redisplay
> forms--e.g. `updating output'--to the body of `my-pane-display'. Is
> this correct?
Sort of. :incremental-redisplay t causes the call to the
display-function to be wrapped in an updating-output form; after the
first evaluation, redisplay will be called on the resulting
updating-output-record instead of calling the display function
directly. There's nothing magic about this; you could do it yourself
if you wrote your own top level loop.
[Digression: I used to refer to the CLIM that is sold by Lisp vendors
as "real CLIM." I am now going to call it "classic CLIM."]
If you don't use updating-output in your display code, all of your
code will be run. Only output records are generated; nothing is drawn
on the screen. CLIM compares the output tree before and after your
display code is run and only updates the screen with the difference of
the two. Classic CLIM goes to a lot of trouble to blit around output
records that have moved but have not otherwise changed. We don't do
that in McCLIM for two reasons: we wanted to get something working
quickly, and blitting doesn't play nicely with antialiasing and other
uses of partial transparency.
If you do use updating-output with the appropriate arguments, you are
telling CLIM that the output records in that part of the tree and
below haven't changed, so it doesn't need to examine them in the
difference operation and the associated code won't be executed. This
can be a significant optimization.
Tim
Timothy Moore writes:
> The display function doesn't have anything to do with "redisplay" that
> happens as a result of exposure events or whatever; that "redisplay"
> is handled by replaying output records that capture drawing
> operations. Only the output records that intersect the exposed region
> are replayed.
Does CLIM automatically take care of this?
Thanks for the clarifications,
Paolo
--
Why Lisp? http://alu.cliki.net/RtL%20Highlight%20Film
Paolo Amoroso <·······@mclink.it> writes:
> Timothy Moore writes:
>
> > The display function doesn't have anything to do with "redisplay" that
> > happens as a result of exposure events or whatever; that "redisplay"
> > is handled by replaying output records that capture drawing
> > operations. Only the output records that intersect the exposed region
> > are replayed.
>
> Does CLIM automatically take care of this?
>
Yes. For the panes usually used in CLIM applications (application and
interactor), rendering commands are captured in output records, unless you
explicitly turn off recording, and expose events are handled by CLIM. If
you really want to you can use the more primitive pane types and write
your own callbacks for expose events, etc.
Tim