Angus Leeming wrote:
>
> Attached is a prototype image loader using the xforms library routines.
>
> It contains new files xformsGImage.[Ch] which should go in the xforms
> directory.
>
> It should work out of the box for xforms 0.89.6 and above.
>
> It will definitely never work for xforms 0.88 or 0.89.0
>
> People with xforms 0.89.x where 1<= x <= 5 will have to ascertain whether
> the routines
> FLIMAGE * flimage_dup(FLIMAGE *);
> Pixmap flimage_to_pixmap(FL_IMAGE *, FL_WINDOW);
> are defined in forms.h
>
> and alter the
> #if (FL_REVISION == 89 && FL_FIXLEVEL < 6)
> #error "Your version of the xforms library may be too old for this class"
> #endif
> in xformsGImage.C as approriate. Feedback on this would be good!
>
> There are still issues with it
> * doesn't seem to crop
> * only a few formats are loadable, because we haven't yet defined the other
> formats in LyX.
> * loading xpm files seems to die.
>
> Hovever, if you can define a converter to ppm, then it'll load these
> beautfully. I haven't tried the others.
>
> Much, much prettier scaling and rotation than I achieved.
>
OK, after putting xformsGImage.[Ch] in the right place, and adding
#include<iostream>, changing the FL_FIXLEVEL < 6 to a 5, it compiled and
installed.
Creating a Postscript to ppm converter,(pstopnm $$i),
I get the same color only graphic and it looks like it still used the
.xpm converter. If I delete the PS to XPM converter I just get errors.
What did I miss?
Garst
---------------------------------
Conversion script:
#!/bin/sh
infile='/home/garst/eagle/NLM-ECG/ecg-drd.ps'
infile_base='/home/garst/eagle/NLM-ECG/ecg-drd'
outfile='/home/garst/tmp/lyx_tmpdir32633XXXXXX/gconvert132633XXXXXX.x
convert PS:${infile} XPM:${outfile}
if [ $? -ne 0 ]; then
'rm' -f ${outfile}
exit 1
fi
if [ ! -f ${outfile} ]; then
if [ -f ${outfile}.0 ]; then
'mv' -f ${outfile}.0 ${outfile}
'rm' -f ${outfile}.?
else
exit 1
fi
fi
fromfile=${outfile}
tofile='/home/garst/tmp/lyx_tmpdir32633XXXXXX/ecg-drd32633XXXXXX.xpm'
'mv' -f ${fromfile} ${tofile}
if [ $? -ne 0 ]; then
'cp' -f ${fromfile} ${tofile}
if [ $? -ne 0 ]; then
exit 1
fi
'rm' -f ${fromfile}
fi
Image conversion succeeded.
Loading image.
Image loading succeeded.