On Monday 08 July 2002 4:02 pm, Juergen Vigna wrote:
> > I don't think you're wrong. I'd just like to implement it so that the
> > Inset does as little as possible. I think I see how we'd do this, but I
> > need your help to turn it into working code.
> >
> > The plan
> > =======
> > 1. Don't load all image files once they are converted.
> > 2. insets ascertain whether they should use the previewed image with
>
> [snip]
>
> I have the impression that we talk of different things. While you're
> fixed at the preview level I think at a more general "graphics" level.
> I don't care about the implementation of "preview" I care if and when
> a graphics file is loaded and/or displayed.

We're talking about /exactly/ the same thing.

I /want/ to invoke startLoading() from within Inset::draw.

I /do not want/ to do it without a little care. 

I envisage something like:

Image::startLoading(Inset * inset) {
        // call REALLYstartLoading(inset) in 2 secs time
        startTimer(2, inset REALLYstartLoading)
}

Image::REALLYstartLoading(Inset * inset) {
        if (!inset->isVisible())
                return;

        // load it
        ..
}

Similarly in BufferView::updateInset(Inset * inset) {
        if (!inset->isVisible())
                return;

        inset->draw();
}

So, my question again. What's the equivalent of "Inset::isVisible()". I /do/ 
know the BufferView.

You know, /if/ there were such a method or way of ascertaining this 
information, then BufferView::updateInset() should also use it to not redraw 
things that aren't visible. That would stop all those "the cursor jumps all 
over the place as the graphics insets are loaded" problems that people moan 
about now.

void BufferView::updateInset(Inset * inset) {
        if (!inset->isVisible())
                return;

        inset->draw();
}

Capito?
Angus

Reply via email to