mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-26 11:16:55 +00:00
* LyXView:
- view() -> currentBufferView() - add const access to bufferViews. * GuiView.h: cleanups git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31286 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
ed4c30930a
commit
722d8c757b
@ -211,10 +211,10 @@ void LyXFunc::initKeySequences(KeyMap * kb)
|
|||||||
|
|
||||||
void LyXFunc::setLyXView(LyXView * lv)
|
void LyXFunc::setLyXView(LyXView * lv)
|
||||||
{
|
{
|
||||||
if (lyx_view_ && lyx_view_->view() && lyx_view_ != lv)
|
if (lyx_view_ && lyx_view_->currentBufferView() && lyx_view_ != lv)
|
||||||
// save current selection to the selection buffer to allow
|
// save current selection to the selection buffer to allow
|
||||||
// middle-button paste in another window
|
// middle-button paste in another window
|
||||||
cap::saveSelection(lyx_view_->view()->cursor());
|
cap::saveSelection(lyx_view_->currentBufferView()->cursor());
|
||||||
lyx_view_ = lv;
|
lyx_view_ = lv;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -226,9 +226,10 @@ void LyXFunc::handleKeyFunc(FuncCode action)
|
|||||||
if (keyseq.length())
|
if (keyseq.length())
|
||||||
c = 0;
|
c = 0;
|
||||||
|
|
||||||
LASSERT(lyx_view_ && lyx_view_->view(), /**/);
|
LASSERT(lyx_view_ && lyx_view_->currentBufferView(), /**/);
|
||||||
lyx_view_->view()->getIntl().getTransManager().deadkey(
|
lyx_view_->currentBufferView()->getIntl().getTransManager().deadkey(
|
||||||
c, get_accent(action).accent, view()->cursor().innerText(), view()->cursor());
|
c, get_accent(action).accent, view()->cursor().innerText(),
|
||||||
|
currentBufferView()->cursor());
|
||||||
// Need to clear, in case the minibuffer calls these
|
// Need to clear, in case the minibuffer calls these
|
||||||
// actions
|
// actions
|
||||||
keyseq.clear();
|
keyseq.clear();
|
||||||
@ -823,7 +824,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
|
|||||||
|
|
||||||
case LFUN_WORD_FIND_FORWARD:
|
case LFUN_WORD_FIND_FORWARD:
|
||||||
case LFUN_WORD_FIND_BACKWARD: {
|
case LFUN_WORD_FIND_BACKWARD: {
|
||||||
LASSERT(lyx_view_ && lyx_view_->view(), /**/);
|
LASSERT(lyx_view_ && lyx_view_->currentBufferView(), /**/);
|
||||||
static docstring last_search;
|
static docstring last_search;
|
||||||
docstring searched_string;
|
docstring searched_string;
|
||||||
|
|
||||||
@ -850,7 +851,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case LFUN_CANCEL:
|
case LFUN_CANCEL:
|
||||||
LASSERT(lyx_view_ && lyx_view_->view(), /**/);
|
LASSERT(lyx_view_ && lyx_view_->currentBufferView(), /**/);
|
||||||
keyseq.reset();
|
keyseq.reset();
|
||||||
meta_fake_bit = NoModifier;
|
meta_fake_bit = NoModifier;
|
||||||
if (buffer)
|
if (buffer)
|
||||||
@ -865,7 +866,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case LFUN_BUFFER_TOGGLE_READ_ONLY: {
|
case LFUN_BUFFER_TOGGLE_READ_ONLY: {
|
||||||
LASSERT(lyx_view_ && lyx_view_->view() && buffer, /**/);
|
LASSERT(lyx_view_ && lyx_view_->currentBufferView() && buffer, /**/);
|
||||||
if (buffer->lyxvc().inUse())
|
if (buffer->lyxvc().inUse())
|
||||||
buffer->lyxvc().toggleReadOnly();
|
buffer->lyxvc().toggleReadOnly();
|
||||||
else
|
else
|
||||||
@ -1341,22 +1342,22 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
|
|||||||
|
|
||||||
case LFUN_KEYMAP_OFF:
|
case LFUN_KEYMAP_OFF:
|
||||||
LASSERT(lyx_view_ && lyx_view_->view(), /**/);
|
LASSERT(lyx_view_ && lyx_view_->view(), /**/);
|
||||||
lyx_view_->view()->getIntl().keyMapOn(false);
|
lyx_view_->currentBufferView()->getIntl().keyMapOn(false);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LFUN_KEYMAP_PRIMARY:
|
case LFUN_KEYMAP_PRIMARY:
|
||||||
LASSERT(lyx_view_ && lyx_view_->view(), /**/);
|
LASSERT(lyx_view_ && lyx_view_->currentBufferView(), /**/);
|
||||||
lyx_view_->view()->getIntl().keyMapPrim();
|
lyx_view_->currentBufferView()->getIntl().keyMapPrim();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LFUN_KEYMAP_SECONDARY:
|
case LFUN_KEYMAP_SECONDARY:
|
||||||
LASSERT(lyx_view_ && lyx_view_->view(), /**/);
|
LASSERT(lyx_view_ && lyx_view_->currentBufferView(), /**/);
|
||||||
lyx_view_->view()->getIntl().keyMapSec();
|
lyx_view_->currentBufferView()->getIntl().keyMapSec();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LFUN_KEYMAP_TOGGLE:
|
case LFUN_KEYMAP_TOGGLE:
|
||||||
LASSERT(lyx_view_ && lyx_view_->view(), /**/);
|
LASSERT(lyx_view_ && lyx_view_->currentBufferView(), /**/);
|
||||||
lyx_view_->view()->getIntl().toggleKeyMap();
|
lyx_view_->currentBufferView()->getIntl().toggleKeyMap();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LFUN_REPEAT: {
|
case LFUN_REPEAT: {
|
||||||
@ -1678,15 +1679,15 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
|
|||||||
|
|
||||||
// Let the current LyXView dispatch its own actions.
|
// Let the current LyXView dispatch its own actions.
|
||||||
if (lyx_view_->dispatch(cmd)) {
|
if (lyx_view_->dispatch(cmd)) {
|
||||||
if (lyx_view_->view()) {
|
if (lyx_view_->currentBufferView()) {
|
||||||
updateFlags = lyx_view_->view()->cursor().result().update();
|
updateFlags = lyx_view_->currentBufferView()->cursor().result().update();
|
||||||
if (theBufferList().isLoaded(buffer))
|
if (theBufferList().isLoaded(buffer))
|
||||||
buffer->undo().endUndoGroup();
|
buffer->undo().endUndoGroup();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
LASSERT(lyx_view_->view(), /**/);
|
LASSERT(lyx_view_->currentBufferView(), /**/);
|
||||||
|
|
||||||
// Let the current BufferView dispatch its own actions.
|
// Let the current BufferView dispatch its own actions.
|
||||||
if (view()->dispatch(cmd)) {
|
if (view()->dispatch(cmd)) {
|
||||||
@ -1889,7 +1890,7 @@ docstring LyXFunc::viewStatusMessage()
|
|||||||
BufferView * LyXFunc::view() const
|
BufferView * LyXFunc::view() const
|
||||||
{
|
{
|
||||||
LASSERT(lyx_view_, /**/);
|
LASSERT(lyx_view_, /**/);
|
||||||
return lyx_view_->view();
|
return lyx_view_->currentBufferView();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -57,9 +57,11 @@ public:
|
|||||||
//@{ generic accessor functions
|
//@{ generic accessor functions
|
||||||
|
|
||||||
/// \return the currently selected buffer view.
|
/// \return the currently selected buffer view.
|
||||||
virtual BufferView * view() = 0;
|
virtual BufferView * currentBufferView() = 0;
|
||||||
|
virtual BufferView const * currentBufferView() const = 0;
|
||||||
/// \return the current document buffer view.
|
/// \return the current document buffer view.
|
||||||
virtual BufferView * documentBufferView() = 0;
|
virtual BufferView * documentBufferView() = 0;
|
||||||
|
virtual BufferView const * documentBufferView() const = 0;
|
||||||
|
|
||||||
/// \return the buffer currently selected in this window
|
/// \return the buffer currently selected in this window
|
||||||
virtual Buffer * buffer() = 0;
|
virtual Buffer * buffer() = 0;
|
||||||
|
@ -108,7 +108,7 @@ KernelDocType Dialog::docType() const
|
|||||||
|
|
||||||
BufferView const * Dialog::bufferview() const
|
BufferView const * Dialog::bufferview() const
|
||||||
{
|
{
|
||||||
return lyxview_->view();
|
return lyxview_->currentBufferView();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -297,7 +297,7 @@ string const GuiCommandBuffer::historyDown()
|
|||||||
|
|
||||||
docstring const GuiCommandBuffer::getCurrentState() const
|
docstring const GuiCommandBuffer::getCurrentState() const
|
||||||
{
|
{
|
||||||
return view_->view()->cursor().currentState();
|
return view_->currentBufferView()->cursor().currentState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -929,8 +929,8 @@ void GuiView::setCurrentWorkArea(GuiWorkArea * wa)
|
|||||||
if (old_gwa == wa)
|
if (old_gwa == wa)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (view())
|
if (currentBufferView())
|
||||||
cap::saveSelection(view()->cursor());
|
cap::saveSelection(currentBufferView()->cursor());
|
||||||
|
|
||||||
theGuiApp()->setCurrentView(this);
|
theGuiApp()->setCurrentView(this);
|
||||||
d.current_work_area_ = wa;
|
d.current_work_area_ = wa;
|
||||||
@ -1168,7 +1168,21 @@ BufferView * GuiView::documentBufferView()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BufferView * GuiView::view()
|
BufferView const * GuiView::documentBufferView() const
|
||||||
|
{
|
||||||
|
return currentMainWorkArea()
|
||||||
|
? ¤tMainWorkArea()->bufferView()
|
||||||
|
: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BufferView * GuiView::currentBufferView()
|
||||||
|
{
|
||||||
|
return d.current_work_area_ ? &d.current_work_area_->bufferView() : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BufferView const * GuiView::currentBufferView() const
|
||||||
{
|
{
|
||||||
return d.current_work_area_ ? &d.current_work_area_->bufferView() : 0;
|
return d.current_work_area_ ? &d.current_work_area_->bufferView() : 0;
|
||||||
}
|
}
|
||||||
@ -1178,8 +1192,8 @@ void GuiView::autoSave()
|
|||||||
{
|
{
|
||||||
LYXERR(Debug::INFO, "Running autoSave()");
|
LYXERR(Debug::INFO, "Running autoSave()");
|
||||||
|
|
||||||
if (buffer())
|
if (documentBufferView())
|
||||||
view()->buffer().autoSave();
|
documentBufferView()->buffer().autoSave();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1198,7 +1212,7 @@ bool GuiView::getStatus(FuncRequest const & cmd, FuncStatus & flag)
|
|||||||
if (cmd.origin == FuncRequest::TOC) {
|
if (cmd.origin == FuncRequest::TOC) {
|
||||||
GuiToc * toc = static_cast<GuiToc*>(findOrBuild("toc", false));
|
GuiToc * toc = static_cast<GuiToc*>(findOrBuild("toc", false));
|
||||||
FuncStatus fs;
|
FuncStatus fs;
|
||||||
if (toc->getStatus(view()->cursor(), cmd, fs))
|
if (toc->getStatus(documentBufferView()->cursor(), cmd, fs))
|
||||||
flag |= fs;
|
flag |= fs;
|
||||||
else
|
else
|
||||||
flag.setEnabled(false);
|
flag.setEnabled(false);
|
||||||
@ -1254,12 +1268,13 @@ bool GuiView::getStatus(FuncRequest const & cmd, FuncStatus & flag)
|
|||||||
enable = buf->isExportable("dvi")
|
enable = buf->isExportable("dvi")
|
||||||
&& lyxrc.print_command != "none";
|
&& lyxrc.print_command != "none";
|
||||||
else if (name == "character" || name == "symbols") {
|
else if (name == "character" || name == "symbols") {
|
||||||
if (buf->isReadonly() || !view() || !view()->cursor().inTexted())
|
if (buf->isReadonly() || !currentBufferView()
|
||||||
|
|| !currentBufferView()->cursor().inTexted())
|
||||||
enable = false;
|
enable = false;
|
||||||
else {
|
else {
|
||||||
// FIXME we should consider passthru
|
// FIXME we should consider passthru
|
||||||
// paragraphs too.
|
// paragraphs too.
|
||||||
Inset const & in = view()->cursor().inset();
|
Inset const & in = currentBufferView()->cursor().inset();
|
||||||
enable = !in.getLayout().isPassThru();
|
enable = !in.getLayout().isPassThru();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1285,7 +1300,7 @@ bool GuiView::getStatus(FuncRequest const & cmd, FuncStatus & flag)
|
|||||||
if (inset) {
|
if (inset) {
|
||||||
FuncRequest fr(LFUN_INSET_MODIFY, cmd.argument());
|
FuncRequest fr(LFUN_INSET_MODIFY, cmd.argument());
|
||||||
FuncStatus fs;
|
FuncStatus fs;
|
||||||
if (!inset->getStatus(view()->cursor(), fr, fs)) {
|
if (!inset->getStatus(currentBufferView()->cursor(), fr, fs)) {
|
||||||
// Every inset is supposed to handle this
|
// Every inset is supposed to handle this
|
||||||
LASSERT(false, break);
|
LASSERT(false, break);
|
||||||
}
|
}
|
||||||
@ -1300,19 +1315,22 @@ bool GuiView::getStatus(FuncRequest const & cmd, FuncStatus & flag)
|
|||||||
|
|
||||||
case LFUN_COMPLETION_INLINE:
|
case LFUN_COMPLETION_INLINE:
|
||||||
if (!d.current_work_area_
|
if (!d.current_work_area_
|
||||||
|| !d.current_work_area_->completer().inlinePossible(view()->cursor()))
|
|| !d.current_work_area_->completer().inlinePossible(
|
||||||
|
currentBufferView()->cursor()))
|
||||||
enable = false;
|
enable = false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LFUN_COMPLETION_POPUP:
|
case LFUN_COMPLETION_POPUP:
|
||||||
if (!d.current_work_area_
|
if (!d.current_work_area_
|
||||||
|| !d.current_work_area_->completer().popupPossible(view()->cursor()))
|
|| !d.current_work_area_->completer().popupPossible(
|
||||||
|
currentBufferView()->cursor()))
|
||||||
enable = false;
|
enable = false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LFUN_COMPLETION_COMPLETE:
|
case LFUN_COMPLETION_COMPLETE:
|
||||||
if (!d.current_work_area_
|
if (!d.current_work_area_
|
||||||
|| !d.current_work_area_->completer().inlinePossible(view()->cursor()))
|
|| !d.current_work_area_->completer().inlinePossible(
|
||||||
|
currentBufferView()->cursor()))
|
||||||
enable = false;
|
enable = false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -1385,7 +1403,7 @@ Buffer * GuiView::loadDocument(FileName const & filename, bool tolastfiles)
|
|||||||
if (lyxrc.use_lastfilepos) {
|
if (lyxrc.use_lastfilepos) {
|
||||||
LastFilePosSection::FilePos filepos =
|
LastFilePosSection::FilePos filepos =
|
||||||
theSession().lastFilePos().load(filename);
|
theSession().lastFilePos().load(filename);
|
||||||
view()->moveToPosition(filepos.pit, filepos.pos, 0, 0);
|
documentBufferView()->moveToPosition(filepos.pit, filepos.pos, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tolastfiles)
|
if (tolastfiles)
|
||||||
@ -1525,7 +1543,8 @@ static bool import(GuiView * lv, FileName const & filename,
|
|||||||
string filename2 = (loader_format == format) ? filename.absFilename()
|
string filename2 = (loader_format == format) ? filename.absFilename()
|
||||||
: support::changeExtension(filename.absFilename(),
|
: support::changeExtension(filename.absFilename(),
|
||||||
formats.extension(loader_format));
|
formats.extension(loader_format));
|
||||||
lv->view()->insertPlaintextFile(FileName(filename2), as_paragraphs);
|
lv->currentBufferView()->insertPlaintextFile(FileName(filename2),
|
||||||
|
as_paragraphs);
|
||||||
theLyXFunc().setLyXView(lv);
|
theLyXFunc().setLyXView(lv);
|
||||||
lyx::dispatch(FuncRequest(LFUN_MARK_OFF));
|
lyx::dispatch(FuncRequest(LFUN_MARK_OFF));
|
||||||
}
|
}
|
||||||
@ -1655,15 +1674,15 @@ void GuiView::newDocument(string const & filename, bool from_template)
|
|||||||
|
|
||||||
// If no new document could be created, it is unsure
|
// If no new document could be created, it is unsure
|
||||||
// whether there is a valid BufferView.
|
// whether there is a valid BufferView.
|
||||||
if (view())
|
if (currentBufferView())
|
||||||
// Ensure the cursor is correctly positioned on screen.
|
// Ensure the cursor is correctly positioned on screen.
|
||||||
view()->showCursor();
|
currentBufferView()->showCursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void GuiView::insertLyXFile(docstring const & fname)
|
void GuiView::insertLyXFile(docstring const & fname)
|
||||||
{
|
{
|
||||||
BufferView * bv = view();
|
BufferView * bv = documentBufferView();
|
||||||
if (!bv)
|
if (!bv)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -1713,7 +1732,7 @@ void GuiView::insertLyXFile(docstring const & fname)
|
|||||||
void GuiView::insertPlaintextFile(docstring const & fname,
|
void GuiView::insertPlaintextFile(docstring const & fname,
|
||||||
bool asParagraph)
|
bool asParagraph)
|
||||||
{
|
{
|
||||||
BufferView * bv = view();
|
BufferView * bv = documentBufferView();
|
||||||
if (!bv)
|
if (!bv)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -2131,7 +2150,7 @@ void GuiView::gotoNextOrPreviousBuffer(NextOrPrevious np)
|
|||||||
|
|
||||||
bool GuiView::dispatch(FuncRequest const & cmd)
|
bool GuiView::dispatch(FuncRequest const & cmd)
|
||||||
{
|
{
|
||||||
BufferView * bv = view();
|
BufferView * bv = currentBufferView();
|
||||||
// By default we won't need any update.
|
// By default we won't need any update.
|
||||||
if (bv)
|
if (bv)
|
||||||
bv->cursor().updateFlags(Update::None);
|
bv->cursor().updateFlags(Update::None);
|
||||||
@ -2239,7 +2258,7 @@ bool GuiView::dispatch(FuncRequest const & cmd)
|
|||||||
Inset * inset = getOpenInset(name);
|
Inset * inset = getOpenInset(name);
|
||||||
if (inset) {
|
if (inset) {
|
||||||
FuncRequest fr(LFUN_INSET_DIALOG_UPDATE, cmd.argument());
|
FuncRequest fr(LFUN_INSET_DIALOG_UPDATE, cmd.argument());
|
||||||
inset->dispatch(view()->cursor(), fr);
|
inset->dispatch(currentBufferView()->cursor(), fr);
|
||||||
} else if (name == "paragraph") {
|
} else if (name == "paragraph") {
|
||||||
lyx::dispatch(FuncRequest(LFUN_PARAGRAPH_UPDATE));
|
lyx::dispatch(FuncRequest(LFUN_PARAGRAPH_UPDATE));
|
||||||
} else if (name == "prefs" || name == "document") {
|
} else if (name == "prefs" || name == "document") {
|
||||||
@ -2309,16 +2328,16 @@ bool GuiView::dispatch(FuncRequest const & cmd)
|
|||||||
Inset * inset = getOpenInset(name);
|
Inset * inset = getOpenInset(name);
|
||||||
if (inset) {
|
if (inset) {
|
||||||
// put cursor in front of inset.
|
// put cursor in front of inset.
|
||||||
if (!view()->setCursorFromInset(inset)) {
|
if (!currentBufferView()->setCursorFromInset(inset)) {
|
||||||
LASSERT(false, break);
|
LASSERT(false, break);
|
||||||
}
|
}
|
||||||
|
BufferView * bv = currentBufferView();
|
||||||
// useful if we are called from a dialog.
|
// useful if we are called from a dialog.
|
||||||
view()->cursor().beginUndoGroup();
|
bv->cursor().beginUndoGroup();
|
||||||
view()->cursor().recordUndo();
|
bv->cursor().recordUndo();
|
||||||
FuncRequest fr(LFUN_INSET_MODIFY, cmd.argument());
|
FuncRequest fr(LFUN_INSET_MODIFY, cmd.argument());
|
||||||
inset->dispatch(view()->cursor(), fr);
|
inset->dispatch(bv->cursor(), fr);
|
||||||
view()->cursor().endUndoGroup();
|
bv->cursor().endUndoGroup();
|
||||||
} else {
|
} else {
|
||||||
FuncRequest fr(LFUN_INSET_INSERT, cmd.argument());
|
FuncRequest fr(LFUN_INSET_INSERT, cmd.argument());
|
||||||
lyx::dispatch(fr);
|
lyx::dispatch(fr);
|
||||||
|
@ -62,53 +62,54 @@ public:
|
|||||||
|
|
||||||
~GuiView();
|
~GuiView();
|
||||||
|
|
||||||
///
|
/// LyXView inherited methods.
|
||||||
int id() const { return id_; }
|
///@{
|
||||||
void setFocus();
|
int id() const;
|
||||||
void setBusy(bool);
|
void setBusy(bool);
|
||||||
/// returns true if this view has the focus.
|
BufferView * currentBufferView();
|
||||||
|
BufferView const * currentBufferView() const;
|
||||||
|
BufferView * documentBufferView();
|
||||||
|
BufferView const * documentBufferView() const;
|
||||||
|
Buffer * buffer();
|
||||||
|
Buffer const * buffer() const;
|
||||||
|
Buffer * documentBuffer();
|
||||||
|
Buffer const * documentBuffer() const;
|
||||||
|
void setBuffer(Buffer * b);
|
||||||
|
bool closeBuffer();
|
||||||
|
bool closeBufferAll();
|
||||||
bool hasFocus() const;
|
bool hasFocus() const;
|
||||||
|
Buffer * loadDocument(support::FileName const & name,
|
||||||
|
bool tolastfiles = true);
|
||||||
|
void newDocument(std::string const & filename,
|
||||||
|
bool fromTemplate);
|
||||||
|
void message(docstring const &);
|
||||||
|
bool getStatus(FuncRequest const & cmd, FuncStatus & flag);
|
||||||
|
bool dispatch(FuncRequest const & cmd);
|
||||||
|
void restartCursor();
|
||||||
|
void updateCompletion(Cursor & cur, bool start, bool keep);
|
||||||
|
void setFocus();
|
||||||
|
///@}
|
||||||
|
|
||||||
/// add toolbar, if newline==true, add a toolbar break before the toolbar
|
/// add toolbar, if newline==true, add a toolbar break before the toolbar
|
||||||
GuiToolbar * makeToolbar(ToolbarInfo const & tbinfo, bool newline);
|
GuiToolbar * makeToolbar(ToolbarInfo const & tbinfo, bool newline);
|
||||||
virtual void updateStatusBar();
|
void updateStatusBar();
|
||||||
virtual void message(docstring const & str);
|
|
||||||
|
|
||||||
/// updates the possible layouts selectable
|
/// updates the possible layouts selectable
|
||||||
void updateLayoutList();
|
void updateLayoutList();
|
||||||
void updateToolbars();
|
void updateToolbars();
|
||||||
QMenu * createPopupMenu();
|
QMenu * createPopupMenu();
|
||||||
bool getStatus(FuncRequest const & cmd, FuncStatus & flag);
|
|
||||||
bool dispatch(FuncRequest const & cmd);
|
|
||||||
|
|
||||||
///
|
///
|
||||||
LayoutBox * getLayoutDialog() const;
|
LayoutBox * getLayoutDialog() const;
|
||||||
|
|
||||||
/// \return the buffer currently selected in this window
|
|
||||||
virtual Buffer * buffer();
|
|
||||||
virtual Buffer const * buffer() const;
|
|
||||||
|
|
||||||
/// \return the document buffer in this window
|
|
||||||
virtual Buffer * documentBuffer();
|
|
||||||
virtual Buffer const * documentBuffer() const;
|
|
||||||
|
|
||||||
/// set a buffer to the current workarea.
|
|
||||||
void setBuffer(Buffer * b); ///< \c Buffer to set.
|
|
||||||
/// closes the current active buffer
|
|
||||||
bool closeBuffer();
|
|
||||||
/// hides the workarea and makes sure it is clean
|
/// hides the workarea and makes sure it is clean
|
||||||
bool hideWorkArea(GuiWorkArea * wa);
|
bool hideWorkArea(GuiWorkArea * wa);
|
||||||
/// closes the workarea
|
/// closes the workarea
|
||||||
bool closeWorkArea(GuiWorkArea * wa);
|
bool closeWorkArea(GuiWorkArea * wa);
|
||||||
/// load a document into the current workarea.
|
|
||||||
Buffer * loadDocument(support::FileName const & name, ///< File to load.
|
|
||||||
bool tolastfiles = true); ///< append to the "Open recent" menu?
|
|
||||||
///
|
///
|
||||||
void openDocument(std::string const & filename);
|
void openDocument(std::string const & filename);
|
||||||
///
|
///
|
||||||
void importDocument(std::string const &);
|
void importDocument(std::string const &);
|
||||||
///
|
|
||||||
void newDocument(std::string const & filename, bool fromTemplate);
|
|
||||||
|
|
||||||
/// GuiBufferDelegate.
|
/// GuiBufferDelegate.
|
||||||
///@{
|
///@{
|
||||||
@ -124,17 +125,10 @@ public:
|
|||||||
/// called on timeout
|
/// called on timeout
|
||||||
void autoSave();
|
void autoSave();
|
||||||
|
|
||||||
/// \return the currently selected buffer view.
|
|
||||||
BufferView * view();
|
|
||||||
/// \return the current document buffer view.
|
|
||||||
BufferView * documentBufferView();
|
|
||||||
|
|
||||||
/** redraw \c inset in all the BufferViews in which it is currently
|
/** redraw \c inset in all the BufferViews in which it is currently
|
||||||
* visible. If successful return a pointer to the owning Buffer.
|
* visible. If successful return a pointer to the owning Buffer.
|
||||||
*/
|
*/
|
||||||
Buffer const * updateInset(Inset const *);
|
Buffer const * updateInset(Inset const *);
|
||||||
///
|
|
||||||
void restartCursor();
|
|
||||||
|
|
||||||
/// \return the \c Workarea associated to \p Buffer
|
/// \return the \c Workarea associated to \p Buffer
|
||||||
/// \retval 0 if no \c WorkArea is found.
|
/// \retval 0 if no \c WorkArea is found.
|
||||||
@ -262,9 +256,6 @@ public:
|
|||||||
///
|
///
|
||||||
void disconnectDialog(std::string const & name);
|
void disconnectDialog(std::string const & name);
|
||||||
|
|
||||||
///
|
|
||||||
void updateCompletion(Cursor & cur, bool start, bool keep);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
///
|
///
|
||||||
void saveLayout() const;
|
void saveLayout() const;
|
||||||
@ -314,8 +305,6 @@ private:
|
|||||||
/// or to discard the changes. If hiding is true, the
|
/// or to discard the changes. If hiding is true, the
|
||||||
/// document will be reloaded.
|
/// document will be reloaded.
|
||||||
bool saveBufferIfNeeded(Buffer & buf, bool hiding);
|
bool saveBufferIfNeeded(Buffer & buf, bool hiding);
|
||||||
/// closes all workareas and all hidden buffers
|
|
||||||
bool closeBufferAll();
|
|
||||||
/// closes all workareas
|
/// closes all workareas
|
||||||
bool closeWorkAreaAll();
|
bool closeWorkAreaAll();
|
||||||
/// write all open workareas into the session file
|
/// write all open workareas into the session file
|
||||||
|
@ -630,9 +630,9 @@ void LayoutBox::updateContents(bool reset)
|
|||||||
// or we've moved from one inset to another
|
// or we've moved from one inset to another
|
||||||
DocumentClass const * text_class = &buffer->params().documentClass();
|
DocumentClass const * text_class = &buffer->params().documentClass();
|
||||||
Inset const * inset =
|
Inset const * inset =
|
||||||
&(d->owner_.view()->cursor().innerText()->inset());
|
&(d->owner_.currentBufferView()->cursor().innerText()->inset());
|
||||||
if (!reset && d->text_class_ == text_class && d->inset_ == inset) {
|
if (!reset && d->text_class_ == text_class && d->inset_ == inset) {
|
||||||
set(d->owner_.view()->cursor().innerParagraph().layout().name());
|
set(d->owner_.currentBufferView()->cursor().innerParagraph().layout().name());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -660,7 +660,7 @@ void LayoutBox::updateContents(bool reset)
|
|||||||
lyxrc.group_layouts, lit->isUnknown());
|
lyxrc.group_layouts, lit->isUnknown());
|
||||||
}
|
}
|
||||||
|
|
||||||
set(d->owner_.view()->cursor().innerParagraph().layout().name());
|
set(d->owner_.currentBufferView()->cursor().innerParagraph().layout().name());
|
||||||
d->countCategories();
|
d->countCategories();
|
||||||
|
|
||||||
// needed to recalculate size hint
|
// needed to recalculate size hint
|
||||||
|
@ -1781,7 +1781,7 @@ void Menus::fillMenuBar(QMenuBar * qmb, GuiView * view, bool initial)
|
|||||||
MenuDefinition menu;
|
MenuDefinition menu;
|
||||||
BufferView * bv = 0;
|
BufferView * bv = 0;
|
||||||
if (view)
|
if (view)
|
||||||
bv = view->view();
|
bv = view->currentBufferView();
|
||||||
d->expand(d->menubar_, menu, bv);
|
d->expand(d->menubar_, menu, bv);
|
||||||
|
|
||||||
MenuDefinition::const_iterator m = menu.begin();
|
MenuDefinition::const_iterator m = menu.begin();
|
||||||
@ -1834,7 +1834,7 @@ void Menus::updateMenu(Menu * qmenu)
|
|||||||
MenuDefinition const & fromLyxMenu = d->getMenu(qmenu->d->name);
|
MenuDefinition const & fromLyxMenu = d->getMenu(qmenu->d->name);
|
||||||
BufferView * bv = 0;
|
BufferView * bv = 0;
|
||||||
if (qmenu->d->view)
|
if (qmenu->d->view)
|
||||||
bv = qmenu->d->view->view();
|
bv = qmenu->d->view->currentBufferView();
|
||||||
d->expand(fromLyxMenu, *qmenu->d->top_level_menu, bv);
|
d->expand(fromLyxMenu, *qmenu->d->top_level_menu, bv);
|
||||||
qmenu->d->populate(*qmenu, *qmenu->d->top_level_menu);
|
qmenu->d->populate(*qmenu, *qmenu->d->top_level_menu);
|
||||||
}
|
}
|
||||||
|
@ -404,7 +404,7 @@ static bool isSortable(QString const & type)
|
|||||||
|
|
||||||
void TocWidget::updateView()
|
void TocWidget::updateView()
|
||||||
{
|
{
|
||||||
if (!gui_view_.view()) {
|
if (!gui_view_.currentBufferView()) {
|
||||||
enableControls(false);
|
enableControls(false);
|
||||||
typeCO->setEnabled(false);
|
typeCO->setEnabled(false);
|
||||||
tocTV->setModel(0);
|
tocTV->setModel(0);
|
||||||
|
Loading…
Reference in New Issue
Block a user