Re: Preview: request for testers

2002-07-12 Thread Angus Leeming

On Friday 12 July 2002 10:31 am, David Kastrup wrote:
> > I remember in your introduction you mentioned that you'd like people
> > to pay you for your LaTeX services... ?
>
> Sure thing, I am suffocating in all the money sent to me from LyX
> users, and you are right to scald me for all the greed I have been
> subjecting you to.
>
> I am currently living off savings and working on TeX stuff so that I
> may eventually be able to continue working on it and just sustain
> myself (more would be too optimistic).  Instead of just looking now
> for a well-paying job, for which I have offers.  There is no sane
> reason, except that I like working on TeX better than on automotive
> driver assistence systems.
>
> So you work on LyX for fun for fun.  Your future does not depend on
> the future of LyX.  I work on TeX for fun for earnest.  If you think
> that this entitles you to call my motivation for working with you on
> LyX greed, there is little that I can say in reply.
>
> Shrug.

I never mentioned "greed", nor do I think it. I think, good on you for giving 
it a go.

A



Re: Preview: request for testers

2002-07-12 Thread David Kastrup

Angus Leeming <[EMAIL PROTECTED]> writes:

> On Friday 12 July 2002 9:41 am, David Kastrup wrote:
> > > David, I work on LyX for fun.
> >
> > I did not particularly address you.  Hmmm, what was the reason I
> > was working on LyX (if you would call it that)?
> 
> I remember in your introduction you mentioned that you'd like people
> to pay you for your LaTeX services... ?

Sure thing, I am suffocating in all the money sent to me from LyX
users, and you are right to scald me for all the greed I have been
subjecting you to.

I am currently living off savings and working on TeX stuff so that I
may eventually be able to continue working on it and just sustain
myself (more would be too optimistic).  Instead of just looking now
for a well-paying job, for which I have offers.  There is no sane
reason, except that I like working on TeX better than on automotive
driver assistence systems.

So you work on LyX for fun for fun.  Your future does not depend on
the future of LyX.  I work on TeX for fun for earnest.  If you think
that this entitles you to call my motivation for working with you on
LyX greed, there is little that I can say in reply.

Shrug.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum
Email: [EMAIL PROTECTED]





Re: Preview: request for testers

2002-07-12 Thread David Kastrup

Angus Leeming <[EMAIL PROTECTED]> writes:

> On Friday 12 July 2002 9:41 am, David Kastrup wrote:
> > Well, PNG image support will mean previews will be much more fun, and
> > their loading will not spend an infinite amount of time...
> 
> Incidentally, whilst total loading time will remain high, actual
> impact on the user will be negligible once I finish this "smart
> loader" stuff. The previews in PPM format will take a fraction of a
> second longer to appear than the ideal case of native PNG loading
> once they've been generated.

"Once they've been generated".  Writing dozens of MBs of data is even
slower than reading them.  And of course, the buffer cache gets
polluted with image data instead of keeping more important stuff.

Anyway, GhostScript takes up quite a bit of time, too.  So while you
are fiddling around with the loader, don't make decisions that would
make it awkward to eventually run GhostScript in daemon mode, telling
it what image it should be converting next.

In preview-latex, by far the slowest stage is GhostScript, and yet it
is the one least impacting responsiveness, because it can cater to
the requests in the needed order, depending on what is currently
on-screen.

dvipng offers similar functionality.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum
Email: [EMAIL PROTECTED]





Re: Preview: request for testers

2002-07-12 Thread Angus Leeming

On Friday 12 July 2002 9:41 am, David Kastrup wrote:
> Well, PNG image support will mean previews will be much more fun, and
> their loading will not spend an infinite amount of time...

Incidentally, whilst total loading time will remain high, actual impact on 
the user will be negligible once I finish this "smart loader" stuff. The 
previews in PPM format will take a fraction of a second longer to appear than 
the ideal case of native PNG loading once they've been generated. Since we're 
only going to be loading 5 or 6 previews at a time, that's hardly important.

Angus



Re: Preview: request for testers

2002-07-12 Thread Angus Leeming

On Friday 12 July 2002 9:41 am, David Kastrup wrote:
> > David, I work on LyX for fun.
>
> I did not particularly address you.  Hmmm, what was the reason I was
> working on LyX (if you would call it that)?

I remember in your introduction you mentioned that you'd like people to pay 
you for your LaTeX services... ?

> > On a more positive note, John Levon has an almost working Qt
> > frontend. That will "just work" with PNG.
>
> Hmmm.  Image loading will depend on the toolkit used?

Why would we re-invent the wheel and not use what is available to us in the 
toolkit? Of course image loading is done by the toolkit. The intellectual 
challenge is in writing a core that is GUI-independent yet doesn't dumn 
things down to the abilities of the stupidest toolkit.

Once you've got your head around it, it's actually a pleasure coding in this 
way. Look at mathed. Beautiful, clean code. Doesn't know what the hell it is 
writing to. That must be elegant ;-)

Angus



Re: Preview: request for testers

2002-07-12 Thread David Kastrup

Angus Leeming <[EMAIL PROTECTED]> writes:

> On Friday 12 July 2002 9:12 am, David Kastrup wrote:
> > Herbert Voss <[EMAIL PROTECTED]> writes:
> > > Angus Leeming wrote:
> > > >>Statistics:
> > > >>285 numbered equations
> > > >>732 pages in the metrics file
> > > >>57 MBytes for the ppm-files
> > > >
> > > > Experiment with gs -sDEVICE=pnmraw. Does that reduce disk footprint
> > > > much?
> > >
> > > yes, up 14.5 MBytes
> >
> > This is still ridiculous.  Get this PNG support going.  Of course,
> > this also explains why previews got slower when color support got
> > added: I/O time.  ppm files take up three times more space than pgm,
> > and when you leave off antialiasing, you get pbm, at another factor
> > of 8 in file size.  I/O time for 57MBytes is far from trivial.
> >
> > Get this PNG support going.
> 
> David, I work on LyX for fun.

I did not particularly address you.  Hmmm, what was the reason I was
working on LyX (if you would call it that)?

> I do not have an infiinite amount of time to spend on it.

Well, PNG image support will mean previews will be much more fun, and
their loading will not spend an infinite amount of time...

> On a more positive note, John Levon has an almost working Qt
> frontend. That will "just work" with PNG.

Hmmm.  Image loading will depend on the toolkit used?

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum
Email: [EMAIL PROTECTED]





Re: Preview: request for testers

2002-07-12 Thread Angus Leeming

On Friday 12 July 2002 9:12 am, David Kastrup wrote:
> Herbert Voss <[EMAIL PROTECTED]> writes:
> > Angus Leeming wrote:
> > >>Statistics:
> > >>285 numbered equations
> > >>732 pages in the metrics file
> > >>57 MBytes for the ppm-files
> > >
> > > Experiment with gs -sDEVICE=pnmraw. Does that reduce disk footprint
> > > much?
> >
> > yes, up 14.5 MBytes
>
> This is still ridiculous.  Get this PNG support going.  Of course,
> this also explains why previews got slower when color support got
> added: I/O time.  ppm files take up three times more space than pgm,
> and when you leave off antialiasing, you get pbm, at another factor
> of 8 in file size.  I/O time for 57MBytes is far from trivial.
>
> Get this PNG support going.

David, I work on LyX for fun. I do not have an infiinite amount of time to 
spend on it. Given the options of writing something reasonable for LyX or 
learning how to write a new loader for an external library, guess which one I 
choose?

On a more positive note, John Levon has an almost working Qt frontend. That 
will "just work" with PNG.

Angus



Re: Preview: request for testers

2002-07-12 Thread David Kastrup

Herbert Voss <[EMAIL PROTECTED]> writes:

> Angus Leeming wrote:
> 
> 
> >>Statistics:
> >>285 numbered equations
> >>732 pages in the metrics file
> >>57 MBytes for the ppm-files
> >>
> > Experiment with gs -sDEVICE=pnmraw. Does that reduce disk footprint
> > much?
> 
> 
> yes, up 14.5 MBytes

This is still ridiculous.  Get this PNG support going.  Of course,
this also explains why previews got slower when color support got
added: I/O time.  ppm files take up three times more space than pgm,
and when you leave off antialiasing, you get pbm, at another factor
of 8 in file size.  I/O time for 57MBytes is far from trivial.

Get this PNG support going.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum
Email: [EMAIL PROTECTED]





Re: Preview: request for testers

2002-07-12 Thread Angus Leeming

On Friday 12 July 2002 9:06 am, Juergen Vigna wrote:
> Angus Leeming wrote:
> >>- equations in floats (caption) are not previewed
> >>maybe all insets???
> >
> > It's possible that my isInsetVisible function won't work on these. Same
> > problem as the tabulars and something that Jürgen might be able to help
> > with.
>
> Well I think you have to inform the InsetText that some update happend
> and that it has to redraw itself on the row where the insets reside.
> I'll try to debug this as soon as your patch is in the main line and
> I can do an update. I think this shouldn't hamper the inclusion if it
> works in normal text as this surely can be fixed quite fast.

Well, another more mundane question. Where should I put it? 
bufferview_funcs.[Ch] ? Probably.



Re: Preview: request for testers

2002-07-12 Thread Juergen Vigna

Angus Leeming wrote:
>>- equations in floats (caption) are not previewed
>>maybe all insets???
> 
> 
> It's possible that my isInsetVisible function won't work on these. Same 
> problem as the tabulars and something that Jürgen might be able to help with.

Well I think you have to inform the InsetText that some update happend
and that it has to redraw itself on the row where the insets reside.
I'll try to debug this as soon as your patch is in the main line and
I can do an update. I think this shouldn't hamper the inclusion if it
works in normal text as this surely can be fixed quite fast.

   Jug

-- 
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._
Dr. Jürgen VignaE-Mail:  [EMAIL PROTECTED]
Mitterstrich 151/A  Tel/Fax: +39-0471-450260 / +39-0471-450253
I-39050 SteineggWeb: http://www.lyx.org/~jug
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._




Re: Preview: request for testers

2002-07-12 Thread Angus Leeming

On Friday 12 July 2002 7:26 am, Andre Poenitz wrote:
> On Thu, Jul 11, 2002 at 07:04:03PM +0100, Angus Leeming wrote:
> > // top_y is not const because it's reset by getRowNearY.
> > int top_y = bv.text->first_y;
> > Row const * row = bv.text->getRowNearY(top_y);
> >
> > int const bv_height = bv.painter().paperHeight();
> > int height = row->height();
> > rows.push_back(row);
> >
> > while (height < bv_height) {
> > row = row->next();
> > +   if (!row)
> > +   break;
> > height += row->height();
> > rows.push_back(row);
> > }
> >
> > return rows;
> > }
>
> What about writing this as
>
> for (int height = 0; row && height < bv_height; row = row->next()) {
>   height += row->height();
>   rows.push_back(row);
> }
>
> Andre'

Cheers André. I'lll think about it ;-)



Re: Preview: request for testers

2002-07-12 Thread Herbert Voss

Herbert Voss wrote:

> Angus Leeming wrote:
> 
> 
>>> Statistics:
>>> 285 numbered equations
>>> 732 pages in the metrics file
>>> 57 MBytes for the ppm-files
>>>
>>
>> Experiment with gs -sDEVICE=pnmraw. Does that reduce disk footprint much?
> 
> 
> 
> yes, up 14.5 MBytes


aehm ... downto ... :-)

Herbert



-- 
http://www.lyx.org/help/




Re: Preview: request for testers

2002-07-12 Thread Herbert Voss

Angus Leeming wrote:


>>Statistics:
>>285 numbered equations
>>732 pages in the metrics file
>>57 MBytes for the ppm-files
>>
> 
> Experiment with gs -sDEVICE=pnmraw. Does that reduce disk footprint much?


yes, up 14.5 MBytes

Herbert


-- 
http://www.lyx.org/help/




Re: Preview: request for testers

2002-07-12 Thread Kornel Benko

-BEGIN PGP SIGNED MESSAGE-

On Friday 12 July 2002 09:00, Angus Leeming wrote:
> On Thursday 11 July 2002 7:43 pm, Kornel Benko wrote:
> > On Thursday 11 July 2002 20:21, Angus Leeming wrote:
> > > Ok. Thanks. I'll have a look tomorrow.
> >
> > One more thing: my labels are now redefined, so that the referencies no
> > longer match. (You know, "underlines" in labels, see attached)
>
> Some strange interation with underline.sty? This isn't preview-specific
> however. File a bug report and badger Herbert ;-)

Well, I don't think so. "underline.sty" may have to do something with display
after the latex-call, but here it is the display of an internal table in lyx.
(The lyx-file itself is not corrupted, lyx-1.2 is working ok)

Kornel

- -- 
Kornel Benko
[EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: PGP 6.5.8

iQCVAwUBPS6G/rewfbDGmeqhAQHPOAP9GZluTPcuuOubc4OeCMXPzYj93vkq9EMS
nxeGUxVaqCmPH/YjiedcQsitCOSSc7n+RIFcEMzjsJRk8Uw8pvZj2RRs5I0CH17x
vpRwSAP73hb6q4yWQSO7z/tI9iaoxLw9yO9ipuDoOPs9fiVkNamNYT1nNuBrFyzR
POZa/VSeIlg=
=55vw
-END PGP SIGNATURE-




Re: Preview: request for testers

2002-07-12 Thread Herbert Voss

Angus Leeming wrote:

> On Thursday 11 July 2002 9:04 pm, Herbert Voss wrote:
> 
>>Another small problem:
>>
>>
>>attached are the mathbox and the preview,
>>it's still a bit too deep.
>>
>>Herbert
>>
> 
> You mean "Original" doesn't line up with "fürht"? Then modify your copy of 
> lyxpreview2ppm.sh. That's why it's a shell script after all. You should need 
> to just set REMOVE_WS=1.


sure, but this looks a bit ugly ... the preview stuff is very
nice so that it should be 100% to the output which I also attached.

Herbert



-- 
http://www.lyx.org/help/





Re: Preview: request for testers

2002-07-12 Thread Angus Leeming

On Thursday 11 July 2002 8:57 pm, Herbert Voss wrote:
> Angus Leeming wrote:
>  > Attached is a "smart loader" for the previews. I'd really, really like
>  > interested users --- that's the mathematicians out there who use
>
> /lots/ of
>
>  > equations to test it out.
>  >
>  > It's meant to enable you to generate and display the previews with no
>  > discernible effect on LyX's responsiveness.
>
> nice work :-)
>
> I loaded one of my books with a lot of mathstuff. Only some
> problems:
> - it starts only when I walk with the cursor "through" some
> mathboxes

Yes. For some reason the first page doesn't think it's visible until the 
entire document is loaded. Or something.

If I can't track this down properly (quite possible) the work around is to 
load insets for the first page anyway. Should be easy enough.

> - in tabulars with matstuff in every cell, I have some
> in preview and some not, not so good
> sed: Couldn't open file bbox.sed
> extracting metrics failed.
> is the message, when I walk from cell to cell
> - now I see, that tabulars are totally ignored???

Really? Small example doument please.

> - stere is still the problem with the not ignored
> geometry settings -> eqno is unvisible

You're asking the wrong man. Ask a LaTeX expert ;-)

> - the eqno is f.ex: 0.21 but it's the third chapter
> and it should be 3.5, a minor problem ...

Alternatively, you could hack preview.sty so that it outputs (eq:label) 
rather than (0.21) [eq:label

David said he'd be willing to accept a patch...

> - equations in floats (caption) are not previewed
> maybe all insets???

It's possible that my isInsetVisible function won't work on these. Same 
problem as the tabulars and something that Jürgen might be able to help with.

> - scrolling quickly to the end -> peng

Fixed.

> - restart and imidiately scrolling to the end was ok,
> but now only the formulas through which I "walked"
> were previewed, no the one before or behind

I don't understand what you mean here. 

> Statistics:
> 285 numbered equations
> 732 pages in the metrics file
> 57 MBytes for the ppm-files

Experiment with gs -sDEVICE=pnmraw. Does that reduce disk footprint much?

Maybe now is the time to write/use lyxpreview2png.sh.
On loading, the xforms loader will have to run a conversion to ppm step 
first, so loading will take a little longer but not much. Disk footprint 
would then be O(1MB). Moreover the Qt loader will just load ;-)

Angus



Re: Preview: request for testers

2002-07-12 Thread Angus Leeming

On Thursday 11 July 2002 9:04 pm, Herbert Voss wrote:
> Another small problem:
>
>
> attached are the mathbox and the preview,
> it's still a bit too deep.
>
> Herbert

You mean "Original" doesn't line up with "fürht"? Then modify your copy of 
lyxpreview2ppm.sh. That's why it's a shell script after all. You should need 
to just set REMOVE_WS=1.

Angus



Re: Preview: request for testers

2002-07-11 Thread Angus Leeming

On Thursday 11 July 2002 7:43 pm, Kornel Benko wrote:
> On Thursday 11 July 2002 20:21, Angus Leeming wrote:
> > Ok. Thanks. I'll have a look tomorrow.
>
> One more thing: my labels are now redefined, so that the referencies no
> longer match. (You know, "underlines" in labels, see attached)

Some strange interation with underline.sty? This isn't preview-specific 
however. File a bug report and badger Herbert ;-)

Angus



Re: Preview: request for testers

2002-07-11 Thread Juergen Vigna

Angus Leeming wrote:

> One other point (for Jürgen?): I think that a (working) isInsetVisible could 
> be used to advantage by BufferView::updateInset. Seems intelligent to only 
> redraw insets that are visible...

I think you didn't understand the Row::pos() variable/function. The pos
returning from a row is the _first_ position of the first character of
this row inside the Row::par(). You understand that in the visible rows
you may have more than one paragraph and so the use of the start/end pos
cannot work as you use it because most probably the lastrow is inside a
different paragraph then the firstrow.

Capito ;)

Jug

-- 
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._
Dr. Jürgen VignaE-Mail:  [EMAIL PROTECTED]
Mitterstrich 151/A  Tel/Fax: +39-0471-450260 / +39-0471-450253
I-39050 SteineggWeb: http://www.lyx.org/~jug
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._




Re: Preview: request for testers

2002-07-11 Thread Andre Poenitz

On Thu, Jul 11, 2002 at 07:04:03PM +0100, Angus Leeming wrote:
>   // top_y is not const because it's reset by getRowNearY.
>   int top_y = bv.text->first_y;
>   Row const * row = bv.text->getRowNearY(top_y);
> 
>   int const bv_height = bv.painter().paperHeight();
>   int height = row->height();
>   rows.push_back(row);
> 
>   while (height < bv_height) {
>   row = row->next();
> + if (!row)
> + break;
>   height += row->height();
>   rows.push_back(row);
>   }
> 
>   return rows;
> }

What about writing this as 

for (int height = 0; row && height < bv_height; row = row->next()) {
height += row->height();
rows.push_back(row);
}

Andre'

-- 
Those who desire to give up Freedom in order to gain Security,
will not have, nor do they deserve, either one. (T. Jefferson)



Re: Preview: request for testers

2002-07-11 Thread Herbert Voss

Another small problem:


attached are the mathbox and the preview,
it's still a bit too deep.

Herbert




-- 
http://www.lyx.org/help/





Re: Preview: request for testers

2002-07-11 Thread Herbert Voss

Angus Leeming wrote:

 > Attached is a "smart loader" for the previews. I'd really, really like
 > interested users --- that's the mathematicians out there who use 
/lots/ of
 > equations to test it out.
 >
 > It's meant to enable you to generate and display the previews with no
 > discernible effect on LyX's responsiveness.

nice work :-)

I loaded one of my books with a lot of mathstuff. Only some
problems:
- it starts only when I walk with the cursor "through" some
mathboxes
- in tabulars with matstuff in every cell, I have some
in preview and some not, not so good
sed: Couldn't open file bbox.sed
extracting metrics failed.
is the message, when I walk from cell to cell
- now I see, that tabulars are totally ignored???
- stere is still the problem with the not ignored
geometry settings -> eqno is unvisible
- the eqno is f.ex: 0.21 but it's the third chapter
and it should be 3.5, a minor problem ...
- equations in floats (caption) are not previewed
maybe all insets???
- scrolling quickly to the end -> peng
- restart and imidiately scrolling to the end was ok,
but now only the formulas through which I "walked"
were previewed, no the one before or behind

Statistics:
285 numbered equations
732 pages in the metrics file
57 MBytes for the ppm-files

Herbert

-- 
http://www.lyx.org/help/




Re: Preview: request for testers

2002-07-11 Thread Kornel Benko

-BEGIN PGP SIGNED MESSAGE-

On Thursday 11 July 2002 20:21, Angus Leeming wrote:
> Ok. Thanks. I'll have a look tomorrow.

One more thing: my labels are now redefined, so that the referencies no longer match.
(You know, "underlines" in labels, see attached)

> Have a nice evening.

You too.

Kornel
- -- 
Kornel Benko
[EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: PGP 6.5.8

iQCVAwUBPS3R67ewfbDGmeqhAQHkrAP/U6G4Fo3WoB8wXnHDzKXJkQ1Vxj46O5I0
fs9RF4UfYdBRzjQ20HDTP0TLFZbEQoQFGLaEVEwbXzWytQpl8doNlHGJdD7Ql57S
IURANxtpukgT2OgPh2JRRaISF+AvEQdehFhRQNk59W5qC2o7MFQVpG35xTYn/+eG
G04ilEM4t5U=
=AbNL
-END PGP SIGNATURE-



test.gif
Description: GIF image


Re: Preview: request for testers

2002-07-11 Thread Angus Leeming

On Thursday 11 July 2002 7:32 pm, Kornel Benko wrote:
> On Thursday 11 July 2002 20:04, Angus Leeming wrote:
> > Does this cure the problem?
>
> It does. At least I seem to be unable to reproduce it.
>
> There is one feature, which may be changed. If I load a document,
> there is no update of the visible formulae on the first visible page. I
> have to scroll to get this new behaviour.

Ok. Thanks. I'll have a look tomorrow.
Have a nice evening.
A



Re: Preview: request for testers

2002-07-11 Thread Kornel Benko

-BEGIN PGP SIGNED MESSAGE-

On Thursday 11 July 2002 20:04, Angus Leeming wrote:
> Does this cure the problem?

It does. At least I seem to be unable to reproduce it.

There is one feature, which may be changed. If I load a document,
there is no update of the visible formulae on the first visible page. I have to
scroll to get this new behaviour.


Nice work.

Kornel
- -- 
Kornel Benko
[EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: PGP 6.5.8

iQCVAwUBPS3PRLewfbDGmeqhAQEdtQP/cKnjtfv6+9e2en5+Lh/t8mAmAjf1+WVQ
YOrECT4yNCyuwzVbMYszZz4kxa0WsgJzIOfzzBczihEoLhL/iNjrBjjH8GMDw2k5
u+t8KKMgsEhD0FmE1upjoGmz/hkT4jhaom70CYyVPJz0ZAjiwZ93icWbcZpMFXwz
woJ8TdzayYc=
=ugYj
-END PGP SIGNATURE-




Re: Preview: request for testers

2002-07-11 Thread Angus Leeming

On Thursday 11 July 2002 7:01 pm, Kornel Benko wrote:
> On Thursday 11 July 2002 18:38, Angus Leeming wrote:
> > Attached is a "smart loader" for the previews. I'd really, really like
> > interested users --- that's the mathematicians out there who use /lots/
> > of equations to test it out.
>
> Super!

Great!

> I tried it and I like it. But on the last page I had a core dump.

Hmmm!

> gdb backtrace:
> (gdb) bt
> #0  0x402b9ab1 in kill () from /lib/libc.so.6
> #1  0x402b98a8 in raise () from /lib/libc.so.6
> #2  0x402baedb in abort () from /lib/libc.so.6
> #3  0x083f6bbb in lyx::abort ()
> #4  0x081167f8 in error_handler ()
> #5  
> #6  0x083f408c in getVisibleRows ()

That means I'm doing something illegal.

> It does not look very hellpful, does it?

Does this cure the problem?

RowList const getVisibleRows(BufferView const & bv)
{
RowList rows;

// top_y is not const because it's reset by getRowNearY.
int top_y = bv.text->first_y;
Row const * row = bv.text->getRowNearY(top_y);

int const bv_height = bv.painter().paperHeight();
int height = row->height();
rows.push_back(row);

while (height < bv_height) {
row = row->next();
+   if (!row)
+   break;
height += row->height();
rows.push_back(row);
}

return rows;
}


Angus



Re: Preview: request for testers

2002-07-11 Thread Kornel Benko

-BEGIN PGP SIGNED MESSAGE-

On Thursday 11 July 2002 18:38, Angus Leeming wrote:
> Attached is a "smart loader" for the previews. I'd really, really like
> interested users --- that's the mathematicians out there who use /lots/ of
> equations to test it out.

Super!

I tried it and I like it. But on the last page I had a core dump.


scrollDocView of 30a2
screen: drawFromTo 0-2b6
expose 269x2b6+0+0

lyx: SIGSEGV signal caught
Sorry, you have found a bug in LyX. Please read the bug-reporting instructions in 
Help->Introduction and send us a bug report, if necessary. Thanks !
Bye.

...

gdb backtrace:
(gdb) bt
#0  0x402b9ab1 in kill () from /lib/libc.so.6
#1  0x402b98a8 in raise () from /lib/libc.so.6
#2  0x402baedb in abort () from /lib/libc.so.6
#3  0x083f6bbb in lyx::abort ()
#4  0x081167f8 in error_handler ()
#5  
#6  0x083f408c in getVisibleRows ()
#7  0x083eb29e in grfx::PreviewImage::Impl::startLoading ()
#8  0x084c2614 in 
boost::detail::function::void_function_obj_invoker0, 
boost::_bi::list1 > >, void>::invoke ()
#9  0x0841f91b in boost::signal0, int, less, 
boost::function0 > >::operator() ()
#10 0x082b870b in Timeout::emit ()
#11 0x082d4ec2 in C_intern_timeout_cb ()
#12 0x400d49c0 in fl_handle_timeouts () from /usr/X11R6/lib/libforms.so.0.89
#13 0x4008e941 in get_next_event () from /usr/X11R6/lib/libforms.so.0.89
#14 0x4008d573 in do_interaction_step () from /usr/X11R6/lib/libforms.so.0.89
#15 0x4008df79 in fl_treat_interaction_events ()
   from /usr/X11R6/lib/libforms.so.0.89
#16 0x4008dfc6 in fl_check_forms () from /usr/X11R6/lib/libforms.so.0.89
#17 0x082e8beb in lyx_gui::start ()
#18 0x08116055 in LyX::LyX ()
#19 0x0817c70c in main ()
#20 0x402a89ed in __libc_start_main () from /lib/libc.so.6

It does not look very hellpful, does it?
There was no editing, only scrols down.

Kornel
- -- 
Kornel Benko
[EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: PGP 6.5.8

iQCVAwUBPS3IAbewfbDGmeqhAQHI+AQAiSaXZf7JgnVsalsciwunt3+fwz5biKyG
EOaL+LMYXnS6r0JjkcdQ8t0N7z2CoFgFllOb/Oe9cIfj+CGBT3nJl3RlGlymTieq
p/C/r88dJi78A4YHtL46UvKvKGTCgEARnNY+du/+Z17hEAxt0vt9veFUzMzTcOAH
m/1qbxPOHcQ=
=auOL
-END PGP SIGNATURE-




Preview: request for testers

2002-07-11 Thread Angus Leeming

Attached is a "smart loader" for the previews. I'd really, really like 
interested users --- that's the mathematicians out there who use /lots/ of 
equations to test it out.

It's meant to enable you to generate and display the previews with no 
discernible effect on LyX's responsiveness.

If you run 
./lyx -dbg graphics
you'll see what is going on. Having loaded up the document you should be able 
immediately to start editing it. That's because we already had generation of 
all these preview images when a document is loaded as a single forked 
process. You might here ghostscript writing hundreds of image files to disk...

One a message like:

PreviewLoader::finishedInProgress(0): processing succeeded for sh 
LYXLIBDIR/scripts/lyxpreview2ppm.sh 
/tmp/lyx_tmpdir31006aaEiEa/lyx_tmpbuf0/0lyxpreview.tex 111.15

is printed to screen, you'll know that their generation is complete. At 
present all images are then loaded up into LyX, a process that will 
effectively hang LyX until all the images are loaded up.

Not with this patch. This patch gives you "smart loading" of these images.
* The "start loading" request is only sent from the inset's draw method.
* Actual loading is then delayed for two seconds, at which point we check 
whether the inset is actually visible on the screen or not.
* If it /is/ visible, then we start loading it.

This seems like an elegant solution to me, but I'd like you lot to try it 
yourselves.

If you like the approach, (or rather, if you don't say "I dislike it 
immensely"), then I'll refactor the code so that the Graphics Inset can do 
things the same way. No more jumping randomly all over the place as images 
are loaded.

One point to make: the actual implementation still has some bugs, so not 
everything get's loaded immediately (isInsetVisible sometimes returns false 
when clearly its true!). What I'm interested in here is whether people like 
the approach. And if not, whether they can come up with a plausible 
alternative that does not involve threads. That seems like a solution for the 
future.

One other point (for Jürgen?): I think that a (working) isInsetVisible could 
be used to advantage by BufferView::updateInset. Seems intelligent to only 
redraw insets that are visible...

Best regards,
Angus

ps, having applied it, you can always remove this patch with 
patch -R < smartloading.diff 
;-)


smartloading.diff.bz2
Description: BZip2 compressed data