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 #include "GuiApplication.h"
18 #include "GuiWorkArea.h"
21 #include "BufferView.h"
23 #include "graphics/LoaderQueue.h"
25 #include "support/lstrings.h"
26 #include "support/os.h"
27 #include "support/package.h"
35 #include "LyXGdkImage.h"
38 using lyx::support::subst;
46 /// estimate DPI from X server
49 //TODO use GDK instead
50 Screen * scr = ScreenOfDisplay(getDisplay(), getScreen());
51 return int(((HeightOfScreen(scr) * 25.4 / HeightMMOfScreen(scr)) +
52 (WidthOfScreen(scr) * 25.4 / WidthMMOfScreen(scr))) / 2);
61 GuiApplication::GuiApplication(int & argc, char ** argv)
62 : Gtk::Main(argc, argv), Application(argc, argv)
64 using namespace lyx::graphics;
65 Image::newImage = boost::bind(&LyXGdkImage::newImage);
66 Image::loadableFormats = boost::bind(&LyXGdkImage::loadableFormats);
68 // needs to be done before reading lyxrc
71 LoaderQueue::setPriority(10,100);
75 Clipboard& GuiApplication::clipboard()
81 Selection& GuiApplication::selection()
87 int const GuiApplication::exec()
94 void GuiApplication::exit(int /*status*/)
96 // FIXME: Don't ignore status
101 // FIXME: this whole method needs to be moved to Application.
102 LyXView & GuiApplication::createView(unsigned int width,
107 // FIXME: for now we assume that there is only one LyXView with id = 0.
108 /*int workArea_id_ =*/ gui().newWorkArea(width, height, 0);
109 //WorkArea * workArea_ = & theApp->gui().workArea(workArea_id_);
111 int view_id = gui().newView(width, height);
112 GView & view = static_cast<GView &>(gui().view(view_id));
114 lyxfunc_.reset(new LyXFunc(&view));
116 LyX::ref().addLyXView(&view);
124 } // namespace frontend