#include <config.h>
#include "XPM_Renderer.h"
+#include "frontends/support/LyXImage.h"
#include FORMS_H_LOCATION
#include XPM_H_LOCATION
Display * display = fl_get_display();
//(BE 2000-08-05)
-#warning This might be a dirty thing, but I dont know any other solution.
- Screen * screen = DefaultScreenOfDisplay(display);
+//#warning This might be a dirty thing, but I dont know any other solution.
+ Screen * screen = ScreenOfDisplay(display, fl_screen);
int status = XpmReadFileToPixmap(
display,
// This should have been set by the XpmReadFileToPixmap call!
Assert(attrib.valuemask & XpmSize);
- setPixmap(pixmap, attrib.width, attrib.height);
+ setPixmap(new LyXImage(pixmap), attrib.width, attrib.height);
XpmFreeAttributes(&attrib);
bool XPM_Renderer::isImageFormatOK(string const & filename) const
{
- std::ifstream is(filename.c_str());
+ std::ifstream is(filename.c_str(), ios::in);
// The signature of the file without the spaces.
static const char str[] = "/*XPM*/";