mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-14 06:57:01 +00:00
c7a3620eeb
in lyx_main.C. Size will be stored in the session file. * src/lyx_main.C : default value * src/frontends/Application.h : restore also icon size * src/frontends/LyXView.h : " * src/frontends/qt4/GuiView.h : " * src/frontends/qt4/GuiView.C : " * src/frontends/Application.C : " git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16085 a592a061-630c-0410-9148-cb99ea01b6c8
133 lines
2.4 KiB
C
133 lines
2.4 KiB
C
/**
|
|
* \file frontend/Application.C
|
|
* This file is part of LyX, the document processor.
|
|
* Licence details can be found in the file COPYING.
|
|
*
|
|
* \author Abdelrazak Younes
|
|
*
|
|
* Full author contact details are available in file CREDITS.
|
|
*/
|
|
|
|
#include <config.h>
|
|
|
|
#include "frontends/Application.h"
|
|
|
|
#include "frontends/NoGuiFontLoader.h"
|
|
#include "frontends/NoGuiFontMetrics.h"
|
|
#include "frontends/FontLoader.h"
|
|
#include "frontends/FontMetrics.h"
|
|
#include "frontends/Gui.h"
|
|
#include "frontends/LyXView.h"
|
|
#include "frontends/WorkArea.h"
|
|
|
|
#include "funcrequest.h"
|
|
#include "FuncStatus.h"
|
|
#include "lyx_main.h"
|
|
#include "lyxfont.h"
|
|
#include "lyxfunc.h"
|
|
#include "lyxrc.h"
|
|
|
|
#include "support/lstrings.h"
|
|
#include "support/os.h"
|
|
|
|
#include <boost/scoped_ptr.hpp>
|
|
#include <boost/shared_ptr.hpp>
|
|
|
|
|
|
namespace lyx {
|
|
namespace frontend {
|
|
|
|
|
|
Application::Application(int &, char **)
|
|
{
|
|
// FIXME: please confirm: with unicode, I think initEncoding()
|
|
// is not needed anymore!
|
|
|
|
// this can't be done before because it needs the Languages object
|
|
//initEncodings();
|
|
}
|
|
|
|
|
|
LyXView & Application::createView(unsigned int width,
|
|
unsigned int height,
|
|
int posx, int posy,
|
|
bool maximize,
|
|
unsigned int iconSizeXY)
|
|
{
|
|
int view_id = gui().newView();
|
|
LyXView & view = gui().view(view_id);
|
|
|
|
theLyXFunc().setLyXView(&view);
|
|
|
|
/*int workArea_id_ =*/ gui().newWorkArea(width, height, view_id);
|
|
|
|
view.init();
|
|
view.setGeometry(width, height, posx, posy, maximize, iconSizeXY);
|
|
|
|
setCurrentView(view);
|
|
|
|
return view;
|
|
}
|
|
|
|
|
|
LyXView const & Application::currentView() const
|
|
{
|
|
return *current_view_;
|
|
}
|
|
|
|
|
|
LyXView & Application::currentView()
|
|
{
|
|
return *current_view_;
|
|
}
|
|
|
|
|
|
void Application::setCurrentView(LyXView & current_view)
|
|
{
|
|
current_view_ = ¤t_view;
|
|
}
|
|
|
|
} // namespace frontend
|
|
|
|
|
|
|
|
frontend::FontLoader & theFontLoader()
|
|
{
|
|
static frontend::NoGuiFontLoader no_gui_font_loader;
|
|
|
|
if (!use_gui)
|
|
return no_gui_font_loader;
|
|
|
|
BOOST_ASSERT(theApp);
|
|
return theApp->fontLoader();
|
|
}
|
|
|
|
|
|
frontend::FontMetrics const & theFontMetrics(LyXFont const & f)
|
|
{
|
|
static frontend::NoGuiFontMetrics no_gui_font_metrics;
|
|
|
|
if (!use_gui)
|
|
return no_gui_font_metrics;
|
|
|
|
BOOST_ASSERT(theApp);
|
|
return theApp->fontLoader().metrics(f);
|
|
}
|
|
|
|
|
|
frontend::Clipboard & theClipboard()
|
|
{
|
|
BOOST_ASSERT(theApp);
|
|
return theApp->clipboard();
|
|
}
|
|
|
|
|
|
frontend::Selection & theSelection()
|
|
{
|
|
BOOST_ASSERT(theApp);
|
|
return theApp->selection();
|
|
}
|
|
|
|
|
|
} // namespace lyx
|