]> git.lyx.org Git - lyx.git/commitdiff
First part of r14315 from the younes branch:
authorLars Gullik Bjønnes <larsbj@gullik.org>
Mon, 3 Jul 2006 20:19:33 +0000 (20:19 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Mon, 3 Jul 2006 20:19:33 +0000 (20:19 +0000)
* BufferView and BufferView::pimpl:
    - getClipboard, stuffClipboard, haveSelection: deleted

* CutAndPaste.C: use BufferView::owner()->gui().clipboard()
* insettabular.C: ditto
* math_nestinset.C: ditto
* text3.C: ditto

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14323 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferView.C
src/BufferView.h
src/BufferView_pimpl.C
src/BufferView_pimpl.h
src/CutAndPaste.C
src/insets/insettabular.C
src/mathed/math_nestinset.C
src/text3.C

index 1c56e33867641ae729a165b09ea36e9b53ef937a..2f23937c28db776b9160a156392f7447c51ba250 100644 (file)
@@ -212,18 +212,6 @@ void BufferView::center()
 }
 
 
-string const BufferView::getClipboard() const
-{
-       return pimpl_->gui().clipboard().get();
-}
-
-
-void BufferView::stuffClipboard(string const & stuff) const
-{
-       pimpl_->stuffClipboard(stuff);
-}
-
-
 FuncStatus BufferView::getStatus(FuncRequest const & cmd)
 {
        return pimpl_->getStatus(cmd);
@@ -238,31 +226,31 @@ bool BufferView::dispatch(FuncRequest const & ev)
 
 void BufferView::selectionRequested()
 {
-        pimpl_->selectionRequested();
+       pimpl_->selectionRequested();
 }
 
 
 void BufferView::selectionLost()
 {
-        pimpl_->selectionLost();
+       pimpl_->selectionLost();
 }
 
 
 void BufferView::workAreaResize(int width, int height)
 {
-        pimpl_->workAreaResize(width, height);
+       pimpl_->workAreaResize(width, height);
 }
 
 
 void BufferView::workAreaKeyPress(LyXKeySymPtr key, key_modifier::state state)
 {
-        pimpl_->workAreaKeyPress(key, state);
+       pimpl_->workAreaKeyPress(key, state);
 }
 
 
 bool BufferView::workAreaDispatch(FuncRequest const & ev)
 {
-        return pimpl_->workAreaDispatch(ev);
+       return pimpl_->workAreaDispatch(ev);
 }
 
 
@@ -338,12 +326,6 @@ LyXText const * BufferView::getLyXText() const
 }
 
 
-void BufferView::haveSelection(bool sel)
-{
-       pimpl_->gui().clipboard().haveSelection(sel);
-}
-
-
 int BufferView::workHeight() const
 {
        return pimpl_->height();
index 357ab9acbb34c595d1ce888b8098641bd3abf711..c5423f936df12e087c242004a0042449df362404 100644 (file)
@@ -187,13 +187,6 @@ public:
        /// switch between primary and secondary keymaps for RTL entry
        void switchKeyMap();
 
-       /// get the contents of the window system clipboard
-       std::string const getClipboard() const;
-       /// fill the window system clipboard
-       void stuffClipboard(std::string const &) const;
-       /// tell the window system we have a selection
-       void haveSelection(bool sel);
-
        /// return true for events that will handle
        FuncStatus getStatus(FuncRequest const & cmd);
        /// execute the given function
index b4ed4db808ed16887591fcaa990eb0456fb54dac..2a16604e237f9abe2f9b3c67289c4ecc094e01a8 100644 (file)
@@ -872,11 +872,6 @@ void BufferView::Pimpl::center()
 }
 
 
-void BufferView::Pimpl::stuffClipboard(string const & content) const
-{
-       owner_->gui().clipboard().put(content);
-}
-
 
 void BufferView::Pimpl::menuInsertLyXFile(string const & filenm)
 {
index b5b42d19709196ac1c228647cf3c390c0434096f..18a019f958e07abf2ec621118c0c92b537f91529 100644 (file)
@@ -176,8 +176,6 @@ private:
        ///
        Timeout cursor_timeout;
        ///
-       void stuffClipboard(std::string const &) const;
-       ///
        bool using_xterm_cursor;
        ///
        class Position {
@@ -219,6 +217,5 @@ private:
        ViewMetricsInfo metrics(bool singlepar = false);
        /// Working variable indicating a full screen refresh
        mutable bool refresh_inside_;
-
 };
 #endif // BUFFERVIEW_PIMPL_H
index 7f7a0e0080e5cf9e6d17d1e9ac9af70da5317f9b..a418054c952382dbd83f9411f299e62bad8fc234 100644 (file)
 
 #include "support/lstrings.h"
 
+#include "frontends/Gui.h"
+#include "frontends/LyXView.h"
+#include "frontends/Clipboard.h"
+
 #include <boost/tuple/tuple.hpp>
 
 using lyx::pos_type;
@@ -53,6 +57,9 @@ using lyx::textclass_type;
 
 using lyx::support::bformat;
 
+using lyx::frontend::Gui;
+using lyx::frontend::Clipboard;
+
 using std::endl;
 using std::for_each;
 using std::make_pair;
@@ -492,7 +499,8 @@ void cutSelection(LCursor & cur, bool doclear, bool realcut)
                // finished. The solution used currently just works, to make it
                // faster we need to be more clever and probably also have more
                // calls to stuffClipboard. (Lgb)
-//             cur.bv().stuffClipboard(cur.selectionAsString(true));
+//             cur.bv().owner()->gui().clipboard().put(cur.selectionAsString(true));
+       
 
                // make sure that the depth behind the selection are restored, too
                recordUndoSelection(cur);
@@ -555,7 +563,7 @@ void cutSelection(LCursor & cur, bool doclear, bool realcut)
 void copySelection(LCursor & cur)
 {
        // stuff the selection onto the X clipboard, from an explicit copy request
-       cur.bv().stuffClipboard(cur.selectionAsString(true));
+       cur.bv().owner()->gui().clipboard().put(cur.selectionAsString(true));
 
        // this doesn't make sense, if there is no selection
        if (!cur.selection())
index a8c9d8d95d60f3da4681e501e58a09adde5c6ca7..d927fe70957675f62a417e6235ac192a5486b4bb 100644 (file)
@@ -38,7 +38,9 @@
 
 #include "frontends/Alert.h"
 #include "frontends/font_metrics.h"
+#include "frontends/Gui.h"
 #include "frontends/LyXView.h"
+#include "frontends/Clipboard.h"
 #include "frontends/Painter.h"
 #include "frontends/nullpainter.h"
 
@@ -54,6 +56,8 @@ using lyx::graphics::PreviewLoader;
 using lyx::support::ltrim;
 
 using lyx::frontend::Painter;
+using lyx::frontend::Gui;
+using lyx::frontend::Clipboard;
 
 using boost::shared_ptr;
 
@@ -683,7 +687,7 @@ void InsetTabular::doDispatch(LCursor & cur, FuncRequest & cmd)
                break;
 
        case LFUN_PRIMARY_SELECTION_PASTE: {
-               string const clip = cur.bv().getClipboard();
+               string const clip = cur.bv().owner()->gui().clipboard().get();
                if (clip.empty())
                        break;
                // pass to InsertAsciiString, but
@@ -1776,7 +1780,7 @@ bool InsetTabular::copySelection(LCursor & cur)
        ostringstream os;
        OutputParams const runparams;
        paste_tabular->plaintext(cur.buffer(), os, runparams, 0, true, '\t');
-       cur.bv().stuffClipboard(os.str());
+       cur.bv().owner()->gui().clipboard().put(os.str());
        // mark tabular stack dirty
        // FIXME: this is a workaround for bug 1919. Should be removed for 1.5,
        // when we (hopefully) have a one-for-all paste mechanism.
index d4967a70488691c23050c32df63d42e33d19b1fc..fe37369bc0bcabfcbe353fbcd60ae2ecbbc5de83 100644 (file)
@@ -50,7 +50,9 @@
 #include "support/lstrings.h"
 
 #include "frontends/Dialogs.h"
+#include "frontends/Gui.h"
 #include "frontends/LyXView.h"
+#include "frontends/Clipboard.h"
 #include "frontends/Painter.h"
 #include "frontends/nullpainter.h"
 
@@ -62,6 +64,9 @@ using lyx::cap::cutSelection;
 using lyx::cap::replaceSelection;
 using lyx::cap::selClearOrDel;
 
+using lyx::frontend::Gui;
+using lyx::frontend::Clipboard;
+
 using std::endl;
 using std::string;
 using std::istringstream;
@@ -1083,7 +1088,7 @@ void MathNestInset::lfunMousePress(LCursor & cur, FuncRequest & cmd)
 
        if (cmd.button() == mouse_button::button2) {
                MathArray ar;
-               asArray(cur.bv().getClipboard(), ar);
+               asArray(cur.bv().owner()->gui().clipboard().get(), ar);
                cur.clearSelection();
                editXY(cur, cmd.x, cmd.y);
                cur.insert(ar);
@@ -1116,7 +1121,7 @@ void MathNestInset::lfunMouseRelease(LCursor & cur, FuncRequest & cmd)
        //lyxerr << "## lfunMouseRelease: buttons: " << cmd.button() << endl;
 
        if (cmd.button() == mouse_button::button1) {
-               //cur.bv().stuffClipboard(cur.grabSelection());
+               //cur.bv().owner()->gui().clipboard().put(cur.grabSelection());
                return;
        }
 
index d74494cefd20ef8c24eb90aa8f5c8092a9f2e174..49d204a3fd8614844e80faa8d9ca4c1c4fddff32 100644 (file)
@@ -47,7 +47,9 @@
 #include "pariterator.h"
 
 #include "frontends/Dialogs.h"
+#include "frontends/Gui.h"
 #include "frontends/LyXView.h"
+#include "frontends/Clipboard.h"
 
 #include "insets/insetcommand.h"
 #include "insets/insetfloatlist.h"
@@ -79,6 +81,9 @@ using lyx::cap::replaceSelection;
 using lyx::support::isStrUnsignedInt;
 using lyx::support::token;
 
+using lyx::frontend::Gui;
+using lyx::frontend::Clipboard;
+
 using std::endl;
 using std::string;
 using std::istringstream;
@@ -119,7 +124,7 @@ namespace {
                if (selecting || cur.mark())
                        cur.setSelection();
                if (!cur.selection())
-                       cur.bv().haveSelection(false);
+                       cur.bv().owner()->gui().clipboard().haveSelection(false);
                cur.bv().switchKeyMap();
        }
 
@@ -980,7 +985,7 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
 
        case LFUN_PRIMARY_SELECTION_PASTE: {
                cur.clearSelection();
-               string const clip = bv->getClipboard();
+               string const clip = bv->owner()->gui().clipboard().get();
                if (!clip.empty()) {
                        recordUndo(cur);
                        if (cmd.argument == "paragraph")
@@ -1040,7 +1045,7 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
                        cursorEnd(cur);
                        cur.setSelection();
                        bv->cursor() = cur;
-                       bv->haveSelection(cur.selection());
+                       bv->owner()->gui().clipboard().haveSelection(cur.selection());
                }
                break;
 
@@ -1048,7 +1053,7 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
                if (cmd.button() == mouse_button::button1) {
                        selectWord(cur, lyx::WHOLE_WORD_STRICT);
                        bv->cursor() = cur;
-                       bv->haveSelection(cur.selection());
+                       bv->owner()->gui().clipboard().haveSelection(cur.selection());
                }
                break;
 
@@ -1130,7 +1135,7 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
 
                // finish selection
                if (cmd.button() == mouse_button::button1)
-                       bv->haveSelection(cur.selection());
+                       bv->owner()->gui().clipboard().haveSelection(cur.selection());
 
                bv->switchKeyMap();
                bv->owner()->updateMenubar();
@@ -1151,7 +1156,7 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
                if (lyxrc.auto_region_delete) {
                        if (cur.selection())
                                cutSelection(cur, false, false);
-                       bv->haveSelection(false);
+                       bv->owner()->gui().clipboard().haveSelection(false);
                }
 
                cur.clearSelection();