XSetErrorHandler(LyX_XErrHandler);
lyxColorHandler.reset(new LyXColorHandler());
+
+ using namespace grfx;
+
+#ifdef USE_XFORMS_IMAGE_LOADER
+ // connect the image loader based on the xforms library
+ Image::newImage = boost::bind(&xformsImage::newImage);
+ Image::loadableFormats = boost::bind(&xformsImage::loadableFormats);
+#else
+ // connect the image loader based on the XPM library
+ Image::newImage = boost::bind(&ImageXPM::newImage);
+ Image::loadableFormats = boost::bind(&ImageXPM::loadableFormats);
+#endif
}
}
-// Called by the graphics cache to connect the appropriate frontend
-// image loading routines to the LyX kernel.
-void lyx_gui::init_graphics()
-{
- using namespace grfx;
-
-#ifdef USE_XFORMS_IMAGE_LOADER
- // connect the image loader based on the xforms library
- Image::newImage = boost::bind(&xformsImage::newImage);
- Image::loadableFormats = boost::bind(&xformsImage::loadableFormats);
-#else
- // connect the image loader based on the XPM library
- Image::newImage = boost::bind(&ImageXPM::newImage);
- Image::loadableFormats = boost::bind(&ImageXPM::loadableFormats);
-#endif
-}
-
-
string const lyx_gui::hexname(LColor::color col)
{
string const name = lcolor.getX11Name(col);
{
return fontloader.available(font);
}
+
+namespace {
+
+extern "C"
+void C_read_callback(int, void * data)
+{
+ LyXComm * comm = static_cast<LyXComm *>(data);
+ comm->read_ready();
+}
+
+}
+
+void lyx_gui::set_read_callback(int fd, LyXComm * comm)
+{
+ fl_add_io_callback(fd, FL_READ, C_read_callback, comm);
+}