#include "lyx_gui.h"
// FIXME: move this stuff out again
-#include "bufferlist.h"
-#include "BufferView.h"
#include "Color.h"
#include "funcrequest.h"
#include "LColor.h"
#include "support/lstrings.h"
-
#include "GuiView.h"
-#include "FontLoader.h"
#include "QLImage.h"
#include "qt_helpers.h"
#include "socket_callback.h"
using boost::shared_ptr;
-#ifndef CXX_GLOBAL_CSTD
-using std::exit;
-#endif
-
using std::map;
using std::vector;
using std::string;
lyx::frontend::GuiApplication * guiApp;
-lyx::frontend::Application * theApp;
-
namespace {
namespace lyx_gui {
-bool use_gui = true;
-
int exec(int & argc, char * argv[])
{
/*
Clipboard and Selection access.
*/
- // Force adding of font path _before_ QApplication is initialized
- FontLoader::initFontPath();
-
#if defined(Q_WS_WIN) && !defined(Q_CYGWIN_WIN)
static GuiApplication app(argc, argv);
#else
}
-void parse_lyxrc()
-{}
-
-
-LyXView * create_view(unsigned int width, unsigned int height, int posx, int posy,
- bool maximize)
-{
- return &guiApp->createView(width, height, posx, posy, maximize);
-}
-
-
-int start(LyXView * view, string const & batch)
-{
- return theApp->start(batch);
-}
-
-
void sync_events()
{
// This is the ONLY place where processEvents may be called.
}
-void exit(int status)
-{
- guiApp->exit(status);
-}
-
-
-FuncStatus getStatus(FuncRequest const & ev)
-{
- FuncStatus flag;
- switch (ev.action) {
- case LFUN_TOOLTIPS_TOGGLE:
- flag.unknown(true);
- break;
- default:
- break;
- }
-
- return flag;
-}
-
-
bool getRGBColor(LColor_color col, lyx::RGBColor & rgbcol)
{
QColor const & qcol = guiApp->colorCache().get(col);
}
-void update_fonts()
-{
- guiApp->fontLoader().update();
-}
-
-
-bool font_available(LyXFont const & font)
-{
- return guiApp->fontLoader().available(font);
-}
-
-
void register_socket_callback(int fd, boost::function<void()> func)
{
socket_callbacks[fd] = shared_ptr<socket_callback>(new socket_callback(fd, func));
socket_callbacks.erase(fd);
}
-
-string const roman_font_name()
-{
- if (!use_gui)
- return "serif";
-
- QFont font;
- font.setStyleHint(QFont::Serif);
- font.setFamily("serif");
-
- return fromqstr(QFontInfo(font).family());
-}
-
-
-string const sans_font_name()
-{
- if (!use_gui)
- return "sans";
-
- QFont font;
- font.setStyleHint(QFont::SansSerif);
- font.setFamily("sans");
-
- return fromqstr(QFontInfo(font).family());
-}
-
-
-string const typewriter_font_name()
-{
- if (!use_gui)
- return "monospace";
-
- QFont font;
- font.setStyleHint(QFont::TypeWriter);
- font.setFamily("monospace");
-
- return fromqstr(QFontInfo(font).family());
-}
-
}; // namespace lyx_gui