- // I wish that I didn't have to use this
- // but the figinset code is so complicated so
- // I don't want to fiddle with it now.
- unsigned long pm = scr.getForeground();
-
- if (figure && figure->data && figure->data->bitmap &&
- !figure->data->reading && !figure->data->broken) {
- // draw the bitmap
- XCopyArea(fl_display, figure->data->bitmap, pm, local_gc_copy,
- 0, 0, wid, hgh, int(x+1), baseline-hgh);
- XFlush(fl_display);
- if (flags & 4) XDrawRectangle(fl_display, pm, local_gc_copy,
- int(x), baseline - hgh - 1,
- wid+1, hgh+1);
- } else {
- char * msg = 0;
- // draw frame
- XDrawRectangle(fl_display, pm, local_gc_copy,
- int(x),
- baseline - hgh - 1, wid+1, hgh+1);
- if (figure && figure->data) {
- if (figure->data->broken) msg = _("[render error]");
- else if (figure->data->reading) msg = _("[rendering ... ]");
- } else
- if (fname.empty()) msg = _("[no file]");
- else if ((flags & 3) == 0) msg = _("[not displayed]");
- else if (lyxrc->ps_command.empty()) msg = _("[no ghostscript]");
-
- if (!msg) msg = _("[unknown error]");
-
- font.setFamily (LyXFont::SANS_FAMILY);
- font.setSize (LyXFont::SIZE_FOOTNOTE);
- string justname = OnlyFilename (fname);
- font.drawString(justname, pm,
- baseline - font.maxAscent() - 4,
- int(x) + 8);
- font.setSize (LyXFont::SIZE_TINY);
- font.drawText (msg, strlen(msg), pm,
- baseline - 4,
- int(x) + 8);