I have been working pretty steadily on the graphics stuff and have reached a 
stage where I'd like to commit what I have done. The functionality of the 
graphics inset as seen by the user is pretty well unchanged in this patch, 
but nonetheless the patch is pretty big. After this goes in, things should 
change pretty rapidly for the user.

Anyway: what this patch does:
Removed files
frontends/support/*
graphics/ImageLoader*

New files in the graphics directory:
GraphicsConverter.[Ch], GraphicsImage.[Ch], GraphicsImageXPM.[Ch],
GraphicsParams.[Ch], GraphicsTypes.h

I have re-written the graphics cache completely. As it says in 
GraphicsCacheItem.h:

The graphics cache is a container of GCacheItems. Each GCacheItem, defined 
here, represents a separate image file. However, each file can be viewed in 
different ways (different sizes, rotations etc), so each GCacheItem itself 
contains a list of ModifiedItems, also defined here. Each ModifiedItem has a 
GParams variable that defines the way it will be viewed. It also contains a 
list of the graphics insets that refer to it, so calls through the GCache to 
GCacheItem ultimately return the loading status and image for that particular 
graphics inset.

The graphics cache supports fully asynchronous:
* file conversion to a loadable format;
* file loading;
* image modification (scaling, rotation etc).

Whether you get that, of course, depends on grfx::GConverter and on the
grfx::GImage-derived image class.

As yet you get neither!

The GConverter class is currently just a wrapper around converters that gives 
the GCache the appearance that conversion is asynchronous. I plan to recreate 
Converters::convert in the GConverter class so that it generates a shell 
script with all the actions necessary to convert a file to the desired 
format. This shell script can then be passed to the fork call controller to 
be executed asynchronously. 

All this already exists in my little demo program, so it shouldn't be too 
hard to move over.

That just leaves image modification. Again, all the hooks are in place. I 
just need to alter GImageXPM::modify so that it actually scales, rotates, 
crops the XpmImage struct before generating a Pixmap from it.

Anyway, the patch is more than big enough as it is. I have tried to produce 
high quality code that won't need many changes in future. Would the gurus 
please review it and the brave try it out.

Many, many thanks,
Angus

Attachment: graphics.diff.gz
Description: GNU Zip compressed data

Reply via email to