+2004-10-19 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
+
+ * bind/xemacs.bind:
+ * bind/emacs.bind:
+ * bind/mac.bind:
+ * bind/cua.bind: add bindings for buffer-previous/next
+
2004-10-18 Andreas Vox <vox@isp.uni-luebeck.de>
* layouts/db_stdstarsections.inc: fix definition, no title.
\bind "C-S-D" "buffer-update dvi" # 'd' for dvi
\bind "C-S-T" "buffer-update ps"
\bind "C-q" "lyx-quit"
+\bind "C-Next" "buffer-next"
+\bind "C-Prior" "buffer-previous"
\bind "C-b" "font-bold"
\bind "C-e" "font-emph"
\bind "F2" "buffer-write"
\bind "F3" "file-open"
\bind "C-F4" "buffer-close"
-\bind "F5" "screen-recenter"
\bind "M-F4" "lyx-quit"
+\bind "F5" "screen-recenter"
+\bind "C-F6" "buffer-next"
+\bind "C-S-F6" "buffer-previous"
\bind "F7" "dialog-show spellchecker"
\bind "S-F7" "thesaurus-entry"
#\bind "C-x C-r" "buffer-update dvi"
\bind "C-x C-s" "buffer-write"
\bind "C-x C-t" "buffer-update dvi"
+\bind "C-Next" "buffer-next"
+\bind "C-Prior" "buffer-previous"
# this is "upcase-region" in emacs
\bind "C-S-D" "buffer-update dvi" # 'd' for dvi
\bind "C-S-T" "buffer-update pdf" # (pdflatex; was "ps")
\bind "C-q" "lyx-quit"
+\bind "C-grave" "buffer-next"
+\bind "C-asciitilde" "buffer-previous"
\bind "C-b" "font-bold"
\bind "C-e" "font-emph"
\bind "C-x C-t" "buffer-update dvi"
\bind "C-x C-u" "word-upcase" # upcase-region!
\bind "C-x C-w" "buffer-write-as"
+\bind "C-Next" "buffer-next"
+\bind "C-Prior" "buffer-previous"
#bind "C-1" "------"
#bind "C-2" "------"
+2004-10-18 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
+
+ * lyxfunc.C (getStatus,dispatch): handle LFUN_(PREVIOUS|NEXT)BUFFER
+
+ * bufferlist.C (previous, next): new methods
+
+ * lfuns.h:
+ * LyXAction.C (init): add LFUN_NEXTBUFFER and LFUN_PREVIOUSBUFFER
+
2004-10-18 Andreas Vox <vox@isp.uni-luebeck.de>
* buffer.C (makeDocBookFile): add dsssl stylesheet control
{ LFUN_BUFFERPARAMS_APPLY, "buffer-params-apply", Noop },
{ LFUN_LYXRC_APPLY, "lyxrc-apply", NoBuffer },
{ LFUN_INSET_REFRESH, "", Noop },
+ { LFUN_NEXTBUFFER, "buffer-next", ReadOnly },
+ { LFUN_PREVIOUSBUFFER, "buffer-previous", ReadOnly },
{ LFUN_NOACTION, "", Noop }
};
}
+Buffer * BufferList::next(Buffer const * buf) const
+{
+ if (bstore.empty())
+ return 0;
+ BufferStorage::const_iterator it = find(bstore.begin(),
+ bstore.end(), buf);
+ BOOST_ASSERT(it != bstore.end());
+ ++it;
+ if (it == bstore.end())
+ return bstore.front();
+ else
+ return *it;
+}
+
+
+Buffer * BufferList::previous(Buffer const * buf) const
+{
+ if (bstore.empty())
+ return 0;
+ BufferStorage::const_iterator it = find(bstore.begin(),
+ bstore.end(), buf);
+ BOOST_ASSERT(it != bstore.end());
+ if (it == bstore.begin())
+ return bstore.back();
+ else
+ return *(it - 1);
+}
+
+
void BufferList::updateIncludedTeXfiles(string const & mastertmpdir,
OutputParams const & runparams)
{
/// returns a pointer to the buffer whose temppath matches the string
Buffer * BufferList::getBufferFromTmp(std::string const &);
+ /** returns a pointer to the buffer that follows argument in
+ * buffer list. The buffer following the last in list is the
+ * first one.
+ */
+ Buffer * next(Buffer const *) const;
+
+ /** returns a pointer to the buffer that precedes argument in
+ * buffer list. The buffer preceding the first in list is the
+ * last one.
+ */
+ Buffer * previous(Buffer const *) const;
+
/// reset current author for all buffers
void setCurrentAuthor(std::string const & name, std::string const & email);
LFUN_LYXRC_APPLY,
LFUN_GRAPHICS_EDIT,
LFUN_INSET_REFRESH,
+ LFUN_NEXTBUFFER,
+ LFUN_PREVIOUSBUFFER,
LFUN_LASTACTION // end of the table
};
case LFUN_SAVE_AS_DEFAULT:
case LFUN_BUFFERPARAMS_APPLY:
case LFUN_LYXRC_APPLY:
+ case LFUN_NEXTBUFFER:
+ case LFUN_PREVIOUSBUFFER:
// these are handled in our dispatch()
break;
view()->setBuffer(bufferlist.getBuffer(argument));
break;
+ case LFUN_NEXTBUFFER:
+ view()->setBuffer(bufferlist.next(view()->buffer()));
+ break;
+
+ case LFUN_PREVIOUSBUFFER:
+ view()->setBuffer(bufferlist.previous(view()->buffer()));
+ break;
+
case LFUN_FILE_NEW:
NewFile(view(), argument);
break;