2 * \file qt4/GuiApplication.C
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * \author Abdelrazak Younes
10 * Full author contact details are available in file CREDITS.
15 // Too hard to make concept checks work with this file
16 #ifdef _GLIBCXX_CONCEPT_CHECKS
17 #undef _GLIBCXX_CONCEPT_CHECKS
19 #ifdef _GLIBCPP_CONCEPT_CHECKS
20 #undef _GLIBCPP_CONCEPT_CHECKS
23 #include "GuiApplication.h"
26 #include "GuiWorkArea.h"
29 #include "BufferView.h"
31 #include "graphics/LoaderQueue.h"
33 #include "support/lstrings.h"
34 #include "support/os.h"
35 #include "support/package.h"
43 #include "LyXGdkImage.h"
46 using lyx::support::subst;
54 /// estimate DPI from X server
57 //TODO use GDK instead
58 Screen * scr = ScreenOfDisplay(getDisplay(), getScreen());
59 return int(((HeightOfScreen(scr) * 25.4 / HeightMMOfScreen(scr)) +
60 (WidthOfScreen(scr) * 25.4 / WidthMMOfScreen(scr))) / 2);
69 GuiApplication::GuiApplication(int & argc, char ** argv)
70 : Gtk::Main(argc, argv), Application(argc, argv)
72 using namespace lyx::graphics;
73 Image::newImage = boost::bind(&LyXGdkImage::newImage);
74 Image::loadableFormats = boost::bind(&LyXGdkImage::loadableFormats);
76 // needs to be done before reading lyxrc
79 LoaderQueue::setPriority(10,100);
83 Clipboard& GuiApplication::clipboard()
89 Selection& GuiApplication::selection()
95 int const GuiApplication::exec()
102 void GuiApplication::exit(int /*status*/)
104 // FIXME: Don't ignore status
109 // FIXME: this whole method needs to be moved to Application.
110 LyXView & GuiApplication::createView(unsigned int width,
115 // FIXME: for now we assume that there is only one LyXView with id = 0.
116 /*int workArea_id_ =*/ gui().newWorkArea(width, height, 0);
117 //WorkArea * workArea_ = & theApp->gui().workArea(workArea_id_);
119 int view_id = gui().newView(width, height);
120 GView & view = static_cast<GView &>(gui().view(view_id));
122 lyxfunc_.reset(new LyXFunc(&view));
124 LyX::ref().addLyXView(&view);
132 } // namespace frontend