]> git.lyx.org Git - features.git/commitdiff
This commit introduces Application_pimpl and cleanup the header includes of the affec...
authorAbdelrazak Younes <younes@lyx.org>
Fri, 29 Sep 2006 22:06:28 +0000 (22:06 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Fri, 29 Sep 2006 22:06:28 +0000 (22:06 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15182 a592a061-630c-0410-9148-cb99ea01b6c8

25 files changed:
development/scons/scons_manifest.py
src/BufferView.C
src/LaTeX.C
src/buffer.C
src/buffer_funcs.C
src/format.C
src/frontends/Application.C
src/frontends/Application.h
src/frontends/Application_pimpl.h [new file with mode: 0644]
src/frontends/LyXView.C
src/frontends/LyXView.h
src/frontends/Makefile.am
src/frontends/controllers/ControlPrefs.C
src/frontends/controllers/ControlRef.C
src/frontends/gtk/GuiApplication.C
src/frontends/lyx_gui.h
src/frontends/qt3/GuiApplication.C
src/frontends/qt4/GuiApplication.C
src/insets/insetinclude.C
src/insets/insetref.C
src/lyx_cb.C
src/lyx_main.C
src/lyxfunc.C
src/mathed/InsetMathNest.C
src/text2.C

index be61a3ff07b5bbb83d12be934498acfa9df1a1e7..c898cc9a17c38ab50496f781aefcd62422cb70e2 100644 (file)
@@ -429,6 +429,7 @@ src_insets_files = Split('''
 src_frontends_header_files = Split('''
     Alert.h
     Alert_pimpl.h
+       Application_pimpl.h
     Application.h
     Clipboard.h
     Dialogs.h
index 1ea67ce9dfff8fe41bf085282bd7b3b42e42ad89..d3a09a53df458ac0130509727aacafd3e38d8a18 100644 (file)
@@ -18,6 +18,7 @@
 
 #include "buffer.h"
 #include "buffer_funcs.h"
+#include "bufferlist.h"
 #include "bufferparams.h"
 #include "coordcache.h"
 #include "CutAndPaste.h"
index 112e5778767b648eee0fdfa716c0351db7e6c572..17854a217adce14fd55370a6ac049d3fdc45cedf 100644 (file)
@@ -14,6 +14,7 @@
 
 #include <config.h>
 
+#include "bufferlist.h"
 #include "LaTeX.h"
 #include "gettext.h"
 #include "lyxrc.h"
index 1cd063a26affe6d681bde4e03e30cb39ba7954d6..2ce60e9dfc2310db0740ea1a79fd8fe1aa7b01e7 100644 (file)
@@ -15,6 +15,7 @@
 #include "author.h"
 #include "BranchList.h"
 #include "buffer_funcs.h"
+#include "bufferlist.h"
 #include "bufferparams.h"
 #include "counters.h"
 #include "Bullet.h"
index 782ae4c68fb15a0302ea9aeeaf61b2ccc24c87ba..f4d7726555a54fdbced7801ed55ecb9b131b5f1e 100644 (file)
@@ -14,6 +14,7 @@
 
 #include "buffer_funcs.h"
 #include "buffer.h"
+#include "bufferlist.h"
 #include "bufferparams.h"
 #include "dociterator.h"
 #include "counters.h"
index 7de79556ff9eb90400e0f5273ebd1a203480f712..147ba7e6fb0d36e74cba2b1aeebd66518e636177 100644 (file)
@@ -16,6 +16,7 @@
 #include "lyxrc.h"
 #include "debug.h"
 #include "gettext.h"
+#include "lyxsocket.h"
 
 #include "frontends/Application.h"
 #include "frontends/Alert.h" //to be removed?
index 22417f7ed605b2f9f19b56e6cb3c5fe5dc5f8a6d..9e95d81b38150938383296145746af0dcd71f593 100644 (file)
 
 #include "Application.h"
 
-#include "funcrequest.h"
+#include "Application_pimpl.h"
+#include "Gui.h"
+
 #include "LyXAction.h"
+#include "lyxfunc.h"
 #include "lyxrc.h"
 #include "LyXView.h"
 
 #include "support/os.h"
 #include "support/package.h"
 
-#include <boost/scoped_ptr.hpp>
 
 using lyx::support::package;
 
 namespace lyx {
 namespace frontend {
 
-
 Application::Application(int &, char **)
 {
+       pimpl_ = new Application_pimpl;
 }
 
 
 LyXFunc & Application::lyxFunc()
 {
-       return *lyxfunc_.get(); 
+       return *pimpl_->lyxfunc_.get();
 }
 
 
 LyXFunc const & Application::lyxFunc() const
 {
-       return *lyxfunc_.get(); 
+       return *pimpl_->lyxfunc_.get(); 
 }
 
 
 LyXServer & Application::server()
 {
-       return *lyx_server_.get(); 
+       return *pimpl_->lyx_server_.get(); 
 }
 
 
 LyXServer const & Application::server() const 
 {
-       return *lyx_server_.get(); 
+       return *pimpl_->lyx_server_.get(); 
 }
 
 
 LyXServerSocket & Application::socket()
 {
-       return *lyx_socket_.get();
+       return *pimpl_->lyx_socket_.get();
 }
 
 
 LyXServerSocket const & Application::socket() const
 {
-       return *lyx_socket_.get();
+       return *pimpl_->lyx_socket_.get();
 }
 
 
 BufferList & Application::bufferList()
 {
-       return buffer_list_;
+       return pimpl_->buffer_list_;
 }
 
 
 BufferList const & Application::bufferList() const
 {
-       return buffer_list_;
+       return pimpl_->buffer_list_;
 }
 
 
@@ -90,13 +92,13 @@ void Application::setBufferView(BufferView * buffer_view)
 
 int Application::start(std::string const & batch)
 {
-       lyx_server_.reset(new LyXServer(lyxfunc_.get(), lyxrc.lyxpipes));
-       lyx_socket_.reset(new LyXServerSocket(lyxfunc_.get(), 
+       pimpl_->lyx_server_.reset(new LyXServer(pimpl_->lyxfunc_.get(), lyxrc.lyxpipes));
+       pimpl_->lyx_socket_.reset(new LyXServerSocket(pimpl_->lyxfunc_.get(), 
                lyx::support::os::internal_path(package().temp_dir() + "/lyxsocket")));
 
        // handle the batch commands the user asked for
        if (!batch.empty()) {
-               lyxfunc_->dispatch(lyxaction.lookupFunc(batch));
+               pimpl_->lyxfunc_->dispatch(lyxaction.lookupFunc(batch));
        }
 
        return exec();
index 1ee5c13840191134b4322a44de613b44735d84f4..d8cee6ca4b5e16ad3bd3265b15a4a3c4cc3555a4 100644 (file)
 #ifndef LYX_APPLICATION_H
 #define LYX_APPLICATION_H
 
-#include "bufferlist.h"
-#include "lyxfunc.h"
-#include "lyxserver.h"
-#include "lyxsocket.h"
-
 #include <boost/scoped_ptr.hpp>
 
 #include <string>
 
+class BufferList;
 class BufferView;
-class LyXView;
-
+class LyXFunc;
+class LyXServer;
+class LyXServerSocket;
+       
 namespace lyx {
 namespace frontend {
 
+struct Application_pimpl;
 class Clipboard;
 class Gui;
 class Selection;
 
-
 /// The main application class
 /**
 There should be only one instance of this class. No Qt object
@@ -76,22 +74,15 @@ public:
        void setBufferView(BufferView * buffer_view);
 
 protected:
-       ///
+       /// This BufferView is the one receiving Clipboard and Selection
+       /// Events
+       /// FIXME: \todo use Gui::currentView() in the future
        BufferView * buffer_view_;
 
-       // FIXME: lyxfunc_ should be private. But the actual construction is done in
-       // GuiApplication for now.
-
-       /// our function handler
-       boost::scoped_ptr<LyXFunc> lyxfunc_;
-
-private:
-       ///
-       boost::scoped_ptr<LyXServer> lyx_server_;
-       ///
-       boost::scoped_ptr<LyXServerSocket> lyx_socket_;
-       ///
-       BufferList buffer_list_;
+       /// Application private implementation.
+       /// FIXME: this should be private but LyXFunc construction
+       /// is still done in GuiApplication.
+       Application_pimpl * pimpl_;
 
 }; // Application
 
diff --git a/src/frontends/Application_pimpl.h b/src/frontends/Application_pimpl.h
new file mode 100644 (file)
index 0000000..127707b
--- /dev/null
@@ -0,0 +1,40 @@
+/**
+ * \file frontend/Application_pimpl.h
+ * 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.
+ */
+
+#ifndef LYX_APPLICATION_PIMPL_H
+#define LYX_APPLICATION_PIMPL_H
+
+#include "bufferlist.h"
+#include "funcrequest.h"
+#include "lyxserver.h"
+#include "lyxsocket.h"
+
+#include <boost/scoped_ptr.hpp>
+
+namespace lyx {
+namespace frontend {
+
+/// The main application class private implementation.
+struct Application_pimpl 
+{
+       ///
+       BufferList buffer_list_;
+       /// our function handler
+       boost::scoped_ptr<LyXFunc> lyxfunc_;
+       ///
+       boost::scoped_ptr<LyXServer> lyx_server_;
+       ///
+       boost::scoped_ptr<LyXServerSocket> lyx_socket_;
+};
+
+} // namespace frontend
+} // namespace lyx
+
+#endif // LYX_APPLICATION_PIMPL_H
index 2333f8d8883d4926ae37a1caa94cdde4c2c22a06..a7eb12bbb13f40712b5044bcbf1785c26349f14f 100644 (file)
@@ -68,7 +68,6 @@ LyXView::LyXView()
        : work_area_(0),
          toolbars_(new Toolbars(*this)),
          autosave_timeout_(new Timeout(5000)),
-         lyxfunc_(new LyXFunc(this)),
          dialogs_(new Dialogs(*this)),
          controlcommand_(new ControlCommandBuffer(*this))
 {
index 309e4af1f049049295f4f218b8911c32391ac103..a36178a7e10ab5a358a63df9fcc15d3a464247f6 100644 (file)
@@ -16,6 +16,7 @@
 #include "frontends/Application.h"
 #include "frontends/Toolbars.h"
 
+#include "lyxfunc.h"
 #include <boost/scoped_ptr.hpp>
 #include <boost/shared_ptr.hpp>
 #include <boost/signal.hpp>
index fd9d691e931ab2c7003feb448efc6fa971639143..30daea585fc68a38628cca3dff2fe4b07d92b713 100644 (file)
@@ -16,6 +16,7 @@ libfrontends_la_SOURCES = \
        Alert.C \
        Alert.h \
        Alert_pimpl.h \
+       Application_pimpl.h \
        Application.C \
        Application.h \
        Dialogs.C \
index 221fe03a91aee1b5f7d186a7337499ee2a82c15b..dfe5f1e6a6810f3cec4b766d97db1fe3a3a9f749 100644 (file)
@@ -15,6 +15,7 @@
 #include "helper_funcs.h"
 #include "Kernel.h"
 
+#include "bufferlist.h"
 #include "gettext.h"
 #include "funcrequest.h"
 #include "paper.h"
index ff91fcb361a974d80833aa005c0efe31c02b644e..69b705306b1cd0caaf62a9fa9490800ad1026d9f 100644 (file)
@@ -12,7 +12,9 @@
 
 
 #include "ControlRef.h"
+
 #include "buffer.h"
+#include "bufferlist.h"
 #include "funcrequest.h"
 
 #include "frontends/Application.h"
index 9b3db098510b875b3b9a63446ee3c76b0707ba77..3e0dc7148242f9d72868af514863f2fd5891a20c 100644 (file)
 
 #include "BufferView.h"
 
+// FIXME: this is needed for now because LyXFunc is still constructed
+// there.
+#include "frontends/Application_pimpl.h"
+
 #include "graphics/LoaderQueue.h"
 
 #include "support/lstrings.h"
@@ -119,7 +123,7 @@ LyXView & GuiApplication::createView(unsigned int width,
        int view_id = gui().newView(width, height);
        GView & view = static_cast<GView &>(gui().view(view_id));
 
-       lyxfunc_.reset(new LyXFunc(&view));
+       pimpl_->lyxfunc_.reset(new LyXFunc(&view));
 
        LyX::ref().addLyXView(&view);
 
index 4fd080f3a2821deac73e3a053f3a8a3031e0c5eb..5469aee8adecf7a147169cdd517f83add6f66007 100644 (file)
@@ -24,8 +24,6 @@ class Dialogs;
 class LColor_color;
 class LyXFont;
 class LyXComm;
-class LyXDataSocket;
-class LyXServerSocket;
 class FuncRequest;
 class LyXView;
 namespace lyx {
index 894db2adb448177ae13ae396b2835a98fa86093c..ccc4a51387241630016808be3c2ba8e5575d46bc 100644 (file)
 
 #include "BufferView.h"
 
+// FIXME: this is needed for now because LyXFunc is still constructed
+// there.
+#include "frontends/Application_pimpl.h"
+
 #include "graphics/LoaderQueue.h"
 
 #include "support/lstrings.h"
@@ -176,7 +180,7 @@ LyXView & GuiApplication::createView(unsigned int width,
        int view_id = gui().newView(width, height);
        QtView & view = static_cast<QtView &> (gui().view(view_id));
 
-       lyxfunc_.reset(new LyXFunc(&view));
+       pimpl_->lyxfunc_.reset(new LyXFunc(&view));
 
        // FIXME: for now we assume that there is only one LyXView with id = 0.
        /*int workArea_id_ =*/ gui().newWorkArea(width, height, 0);
index 75dcddfeb4cd3492efdd301d61899cf272e4f623..a18fb3c3882937bac72dd77956c3b7660b804ffe 100644 (file)
 
 #include "BufferView.h"
 
+// FIXME: this is needed for now because LyXFunc is still constructed
+// there.
+#include "frontends/Application_pimpl.h"
+
 #include "graphics/LoaderQueue.h"
 
 #include "support/lstrings.h"
@@ -173,7 +177,7 @@ LyXView & GuiApplication::createView(unsigned int width,
        int view_id = gui().newView(width, height);
        GuiView & view = static_cast<GuiView &> (gui().view(view_id));
 
-       lyxfunc_.reset(new LyXFunc(&view));
+       pimpl_->lyxfunc_.reset(new LyXFunc(&view));
 
        // FIXME: for now we assume that there is only one LyXView with id = 0.
        /*int workArea_id_ =*/ gui().newWorkArea(width, height, 0);
index 1db1caf42bdb7435b49f25dd898b6de9bf00af17..6a964f97df6f3b89d89049e6709c325739d27143 100644 (file)
@@ -14,6 +14,7 @@
 
 #include "buffer.h"
 #include "buffer_funcs.h"
+#include "bufferlist.h"
 #include "bufferparams.h"
 #include "BufferView.h"
 #include "cursor.h"
index 700961eee5deee9ca19175bae1870cc8d98e363f..3ca4803bdaec24a7fc7e75d9d05bbf8c281770f4 100644 (file)
@@ -17,6 +17,7 @@
 #include "funcrequest.h"
 #include "gettext.h"
 #include "LaTeXFeatures.h"
+#include "lyxfunc.h"
 #include "outputparams.h"
 #include "sgml.h"
 
index ab444b148b8615ab95edfc89db92f22f618c8d7c..aeaee83489a3ff5c0646ba461eb873d066dc467f 100644 (file)
@@ -17,6 +17,7 @@
 #include "lyx_cb.h"
 
 #include "buffer.h"
+#include "bufferlist.h"
 #include "BufferView.h"
 #include "buffer_funcs.h"
 #include "cursor.h"
index 100d845f539d69cb086fbcdae591c742aac89611..1e328ac1d90bb9d8a21184cfd6064f8a4cde270d 100644 (file)
@@ -19,6 +19,7 @@
 
 #include "buffer.h"
 #include "buffer_funcs.h"
+#include "bufferlist.h"
 #include "converter.h"
 #include "debug.h"
 #include "encoding.h"
@@ -33,6 +34,7 @@
 #include "lyxfunc.h"
 #include "lyxlex.h"
 #include "lyxrc.h"
+#include "lyxserver.h"
 #include "lyxtextclasslist.h"
 #include "MenuBackend.h"
 #include "mover.h"
index a3625c5510b255c72d5e43e208cec19f64c3cc21..ea80d9fc8d6d1a5d3a17f13139ba749099cc3b69 100644 (file)
@@ -24,6 +24,7 @@
 #include "BranchList.h"
 #include "buffer.h"
 #include "buffer_funcs.h"
+#include "bufferlist.h"
 #include "bufferparams.h"
 #include "BufferView.h"
 #include "cursor.h"
@@ -50,6 +51,7 @@
 #include "lyxlex.h"
 #include "lyxrc.h"
 #include "lyxrow.h"
+#include "lyxserver.h"
 #include "lyxtextclasslist.h"
 #include "lyxvc.h"
 #include "paragraph.h"
index 87a41f628a4fc71066c29a8065f7c925a08c7c92..c357c94a7a96c67970a2cff372112162b44228fb 100644 (file)
 #include "frontends/Selection.h"
 #include "frontends/nullpainter.h"
 
+//#include "bufferlist.h"
+#include "funcrequest.h"
+#include "lyxserver.h"
+#include "lyxsocket.h"
+
 #include <sstream>
 
 using lyx::cap::copySelection;
index be1994246425c2f615d9457cd3e8bec764fce06e..403300a987fab14de7d3b2cd3ace8f558daf237b 100644 (file)
@@ -23,6 +23,7 @@
 
 #include "buffer.h"
 #include "buffer_funcs.h"
+#include "bufferlist.h"
 #include "bufferparams.h"
 #include "BufferView.h"
 #include "Bullet.h"
@@ -36,6 +37,7 @@
 #include "gettext.h"
 #include "language.h"
 #include "LColor.h"
+#include "lyxfunc.h"
 #include "lyxrc.h"
 #include "lyxrow.h"
 #include "lyxrow_funcs.h"
@@ -43,6 +45,8 @@
 #include "paragraph_funcs.h"
 #include "ParagraphParameters.h"
 #include "pariterator.h"
+#include "lyxserver.h"
+#include "lyxsocket.h"
 #include "undo.h"
 #include "vspace.h"