}
-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);
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);
}
}
-void BufferView::haveSelection(bool sel)
-{
- pimpl_->gui().clipboard().haveSelection(sel);
-}
-
-
int BufferView::workHeight() const
{
return pimpl_->height();
/// 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
}
-void BufferView::Pimpl::stuffClipboard(string const & content) const
-{
- owner_->gui().clipboard().put(content);
-}
-
void BufferView::Pimpl::menuInsertLyXFile(string const & filenm)
{
///
Timeout cursor_timeout;
///
- void stuffClipboard(std::string const &) const;
- ///
bool using_xterm_cursor;
///
class Position {
ViewMetricsInfo metrics(bool singlepar = false);
/// Working variable indicating a full screen refresh
mutable bool refresh_inside_;
-
};
#endif // BUFFERVIEW_PIMPL_H
#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;
using lyx::support::bformat;
+using lyx::frontend::Gui;
+using lyx::frontend::Clipboard;
+
using std::endl;
using std::for_each;
using std::make_pair;
// 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);
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())
#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"
using lyx::support::ltrim;
using lyx::frontend::Painter;
+using lyx::frontend::Gui;
+using lyx::frontend::Clipboard;
using boost::shared_ptr;
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
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.
#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"
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;
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);
//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;
}
#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"
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;
if (selecting || cur.mark())
cur.setSelection();
if (!cur.selection())
- cur.bv().haveSelection(false);
+ cur.bv().owner()->gui().clipboard().haveSelection(false);
cur.bv().switchKeyMap();
}
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")
cursorEnd(cur);
cur.setSelection();
bv->cursor() = cur;
- bv->haveSelection(cur.selection());
+ bv->owner()->gui().clipboard().haveSelection(cur.selection());
}
break;
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;
// finish selection
if (cmd.button() == mouse_button::button1)
- bv->haveSelection(cur.selection());
+ bv->owner()->gui().clipboard().haveSelection(cur.selection());
bv->switchKeyMap();
bv->owner()->updateMenubar();
if (lyxrc.auto_region_delete) {
if (cur.selection())
cutSelection(cur, false, false);
- bv->haveSelection(false);
+ bv->owner()->gui().clipboard().haveSelection(false);
}
cur.clearSelection();