1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
<html>
<body bgcolor="#ffffff" text="#000000">
<h1>XmHTML and Animations</h1>
If you are viewing this document with example_2, you should see an
animation here -->
<img src="eye.xpm,eye1.xpm,eye2.xpm,eye3.xpm,eye4.xpm,eye5.xpm,eye6.xpm,eye7.xpm,eye8.xpm,eye9.xpm,eye10.xpm,eye11.xpm,eye12.xpm,eye13.xpm,eye14.xpm,eye15.xpm,eye16.xpm,eye17.xpm,eye18.xpm,eye19.xpm,eye20.xpm,eye21.xpm,eye22.xpm,eye23.xpm,eye24.xpm">
<p>
The animation displayed in this document is <b>not</b> a gif animation but
rather a sequence of xpm images. It has been specified as follows:
<pre>
<img src="eye.xpm,eye1.xpm,eye2.xpm,eye3.xpm,eye4.xpm,eye5.xpm,eye6.xpm,
eye7.xpm,eye8.xpm,eye9.xpm,eye10.xpm,eye11.xpm,eye12.xpm,eye13.xpm,eye14.xpm,
eye15.xpm,eye16.xpm,eye17.xpm,eye18.xpm,eye19.xpm,eye20.xpm,eye21.xpm,
eye22.xpm,eye23.xpm,eye24.xpm">
</pre>
<p>
Obviously, example_2 knows how to deal with such an image specification; look
at the source to see how it is done.
<p>
<img src="eye.xpm,eye1.xpm,eye2.xpm,eye3.xpm,eye4.xpm,eye5.xpm,eye6.xpm,eye7.xpm,eye8.xpm,eye9.xpm,eye10.xpm,eye11.xpm,eye12.xpm,eye13.xpm,eye14.xpm,eye15.xpm,eye16.xpm,eye17.xpm,eye18.xpm,eye19.xpm,eye20.xpm,eye21.xpm,eye22.xpm,eye23.xpm,eye24.xpm">
<p>
If you run this example with the -d6 option (enable debug output from the
image routines), you will notice that XmHTML will say something like the
following a number of times:
<pre>
images.c: lookForImage, checking private cache for ....
</pre>
(where <b>...</b> is replaced by the series of images making up the animation).
At some stage it will say:
<pre>
images.c: lookForImage, ... not yet loaded
</pre>
or
<pre>
images.c: lookForImage, ... found!
</pre>
The first will be followed by a lot more messages telling you that the
images are being created while the latter will be followed by a single message:
<pre>
images.c: _XmHTMLNewImage, image ... copied, dimension 32x32
</pre>
which, shortly said, means that XmHTML has <b>copied</b> the essential members
of the image and <b>linked</b> the internal pixmaps of the previously loaded
animation to the new animation. This greatly reduces the amount of memory
used and causes a considerable speedup: XmHTML does not have to recreate all
images in the animation but simply reuses the ones from the previous one.
<p>
<img src="eye.xpm,eye1.xpm,eye2.xpm,eye3.xpm,eye4.xpm,eye5.xpm,eye6.xpm,eye7.xpm,eye8.xpm,eye9.xpm,eye10.xpm,eye11.xpm,eye12.xpm,eye13.xpm,eye14.xpm,eye15.xpm,eye16.xpm,eye17.xpm,eye18.xpm,eye19.xpm,eye20.xpm,eye21.xpm,eye22.xpm,eye23.xpm,eye24.xpm">
<p>
This image-reusing is also retained when animations are replaced or updated using
the XmHTMLReplaceImage or XmHTMLUpdateImage convenience function.
</body>
</html>
|