From 85d2e4b9176e0765a4d30c4e74c7e78e95ea3d6d Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Tue, 3 Oct 2006 13:38:28 +0000 Subject: [PATCH] * lyx_gui: create_view(), start() and exit() functions deleted. * lyx_main.C and lyx_cb.C: use Application methods directly instead of the above functions. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15211 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/lyx_gui.C | 20 -------------------- src/frontends/lyx_gui.h | 18 ------------------ src/frontends/qt4/GuiView.C | 2 +- src/lyx_cb.C | 2 +- src/lyx_main.C | 7 +++---- 5 files changed, 5 insertions(+), 44 deletions(-) diff --git a/src/frontends/lyx_gui.C b/src/frontends/lyx_gui.C index 41296e61f4..dffd02bec5 100644 --- a/src/frontends/lyx_gui.C +++ b/src/frontends/lyx_gui.C @@ -13,7 +13,6 @@ #include "lyx_gui.h" -#include "LyXView.h" #include "Application.h" #include "funcrequest.h" @@ -31,25 +30,6 @@ void parse_lyxrc() {} -LyXView * create_view(unsigned int width, unsigned int height, int posx, int posy, - bool maximize) -{ - return &theApp->createView(width, height, posx, posy, maximize); -} - - -int start(LyXView * view, string const & batch) -{ - return theApp->start(batch); -} - - -void exit(int status) -{ - theApp->exit(status); -} - - FuncStatus getStatus(FuncRequest const & ev) { FuncStatus flag; diff --git a/src/frontends/lyx_gui.h b/src/frontends/lyx_gui.h index 5469aee8ad..6cf6dc5fbe 100644 --- a/src/frontends/lyx_gui.h +++ b/src/frontends/lyx_gui.h @@ -51,18 +51,6 @@ std::string const typewriter_font_name(); */ void parse_lyxrc(); -/** - * Create the main window with given geometry settings - */ -LyXView * create_view(unsigned int width, unsigned int height, int posx, int posy, - bool maximize); - -/** - * Start the main event loop, after executing the given - * batch commands - */ -int start(LyXView* view, std::string const & batch); - /** * Enter the main event loop (\sa LyX::exec2) */ @@ -73,12 +61,6 @@ int exec(int & argc, char * argv[]); */ void sync_events(); -/** - * Quit running LyX. This may either quit directly or record the exit status - * and only stop the event loop. - */ -void exit(int); - /** * return the status flag for a given action. This can be used to tell * that a given lfun is not implemented by a frontend diff --git a/src/frontends/qt4/GuiView.C b/src/frontends/qt4/GuiView.C index cb6ad4b34c..14f9a1bfd8 100644 --- a/src/frontends/qt4/GuiView.C +++ b/src/frontends/qt4/GuiView.C @@ -235,7 +235,7 @@ void GuiView::closeEvent(QCloseEvent *) // http://www.trolltech.com/developer/task-tracker/index_html?id=119684+&method=entry // Then also the moveEvent, resizeEvent, and the // code for floatingGeometry_ can be removed; - // adjust lyx_gui::start + // adjust GuiView::setGeometry() #ifdef Q_OS_WIN32 QRect geometry = normalGeometry(); #else diff --git a/src/lyx_cb.C b/src/lyx_cb.C index bc806950d8..455136b3df 100644 --- a/src/lyx_cb.C +++ b/src/lyx_cb.C @@ -216,7 +216,7 @@ void quitLyX(bool noask) Alert::warning(_("Unable to remove temporary directory"), msg); } - lyx_gui::exit(0); + theApp->exit(0); // Restore original font resources after Application is destroyed. lyx::support::restoreFontResources(); } diff --git a/src/lyx_main.C b/src/lyx_main.C index 6485af0939..18e7453ff5 100644 --- a/src/lyx_main.C +++ b/src/lyx_main.C @@ -109,8 +109,7 @@ void lyx_exit(int status) // guarantees a return to the system, no application cleanup. // This may cause troubles with not executed destructors. if (lyx_gui::use_gui) { - // lyx_gui::exit may return and only schedule the exit - lyx_gui::exit(status); + theApp->exit(status); // Restore original font resources after Application is destroyed. lyx::support::restoreFontResources(); } @@ -345,7 +344,7 @@ int LyX::exec2(int & argc, char * argv[]) height = 0; } // create the main window - LyXView * view = lyx_gui::create_view(width, height, posx, posy, maximize); + LyXView * view = &theApp->createView(width, height, posx, posy, maximize); ref().addLyXView(view); // load files @@ -364,7 +363,7 @@ int LyX::exec2(int & argc, char * argv[]) // clear this list to save a few bytes of RAM session_->clearLastOpenedFiles(); - return lyx_gui::start(view, batch_command); + return theApp->start(batch_command); } else { // Something went wrong above quitLyX(false); -- 2.39.2