#include "GraphicsImageXPM.h"
#include "GraphicsParams.h"
-#include "ColorHandler.h"
+#include "frontends/xforms/ColorHandler.h"
#include "debug.h"
#include "frontends/GUIRunTime.h" // x11Display, x11Screen
#include "support/filetools.h" // IsFileReadable
ImagePtr GImageXPM::newImage()
{
ImagePtr ptr;
- ptr.reset(new GImageXPM());
+ ptr.reset(new GImageXPM);
return ptr;
}
void GImageXPM::load(string const & filename, GImage::SignalTypePtr on_finish)
{
if (filename.empty()) {
- on_finish->emit(false);
+ on_finish->operator()(false);
return;
}
if (!image_.empty()) {
lyxerr[Debug::GRAPHICS]
<< "Image is loaded already!" << std::endl;
- on_finish->emit(false);
+ on_finish->operator()(false);
return;
}
image_.reset(*xpm_image);
}
- on_finish->emit(success == XpmSuccess);
+ on_finish->operator()(success == XpmSuccess);
}
attrib.valuemask |= XpmColorKey;
// Set the color "none" entry to the color of the background.
- XpmColorSymbol xpm_col;
- xpm_col.name = 0;
- xpm_col.value = "none";
- xpm_col.pixel = lyxColorHandler->colorPixel(LColor::graphicsbg);
-
- attrib.numsymbols = 1;
- attrib.colorsymbols = &xpm_col;
+ XpmColorSymbol xpm_col[2];
+ xpm_col[0].name = 0;
+ xpm_col[0].value = "none";
+ xpm_col[0].pixel = lyxColorHandler->colorPixel(LColor::graphicsbg);
+
+ // some image magick versions use this
+ xpm_col[1].name = 0;
+ xpm_col[1].value = "opaque";
+ xpm_col[1].pixel = lyxColorHandler->colorPixel(LColor::white);
+
+ attrib.numsymbols = 2;
+ attrib.colorsymbols = xpm_col;
attrib.valuemask |= XpmColorSymbols;
// Load up the pixmap
// Ascertain the bounding box of the rotated image
// Rotate about the bottom-left corner
static double const pi = 3.14159265358979323846;
- double const angle = double(params.angle) * pi / 180.0;
+ // The minus sign is needed to rotate in the same sense as xdvi et al.
+ double const angle = -double(params.angle) * pi / 180.0;
double const cos_a = cos(angle);
double const sin_a = sin(angle);