]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/lyx_gui.C
enable Font cache only for MacOSX and inline width() for other platform.
[lyx.git] / src / frontends / qt4 / lyx_gui.C
index a7255ddc5b32ec6fa1d14797ee1172908defa94c..ea848a26ce0c9a2d2a472e7c372d61e257085e46 100644 (file)
@@ -15,8 +15,6 @@
 #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"
@@ -28,9 +26,7 @@
 
 #include "support/lstrings.h"
 
-
 #include "GuiView.h"
-#include "FontLoader.h"
 #include "QLImage.h"
 #include "qt_helpers.h"
 #include "socket_callback.h"
@@ -55,17 +51,11 @@ using lyx::frontend::GuiApplication;
 
 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 {
 
@@ -75,8 +65,6 @@ map<int, shared_ptr<socket_callback> > socket_callbacks;
 
 namespace lyx_gui {
 
-bool use_gui = true;
-
 int exec(int & argc, char * argv[])
 {
        /*
@@ -100,9 +88,6 @@ 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
@@ -116,23 +101,6 @@ int exec(int & argc, char * argv[])
 }
 
 
-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.
@@ -143,27 +111,6 @@ void sync_events()
 }
 
 
-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);
@@ -193,18 +140,6 @@ void update_color(LColor_color)
 }
 
 
-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));
@@ -216,43 +151,4 @@ void unregister_socket_callback(int fd)
        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