#include "lyx_main.h"
#include "lyxrc.h"
+#include "lyxfont.h"
// FIXME: move this stuff out again
#include "bufferlist.h"
#include FORMS_H_LOCATION
#include "ColorHandler.h"
#include "xforms_helpers.h"
+#include "xfont_loader.h"
#ifdef USE_XFORMS_IMAGE_LOADER
#include "xformsImage.h"
#else
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);
{
lyxColorHandler->updateColor(col);
}
+
+
+void lyx_gui::update_fonts()
+{
+ fontloader.update();
+}
+
+
+bool lyx_gui::font_available(LyXFont const & font)
+{
+ 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);
+}