]> git.lyx.org Git - lyx.git/blobdiff - src/LyXAction.cpp
This doesn't return a reference any more.
[lyx.git] / src / LyXAction.cpp
index efcf3b41d82b5f44e9c71dc5744bbe04ec5bf9e8..92f8173113d12721bc64a17975a4a727f1d44a4b 100644 (file)
@@ -20,7 +20,7 @@
 #include "support/debug.h"
 #include "support/lstrings.h"
 
-#include <boost/assert.hpp>
+#include "support/assert.h"
 
 using namespace std;
 using namespace lyx::support;
@@ -325,7 +325,29 @@ void LyXAction::init()
  */
                { LFUN_LISTING_INSERT, "listing-insert", Noop, Edit },
                { LFUN_QUOTE_INSERT, "quote-insert", Noop, Edit },
+/*!
+ * \var lyx::FuncCode lyx::LFUN_INFO_INSERT
+ * \li Action: Displays shortcuts, lyxrc, package and textclass availability and menu
+               information in a non-editable boxed InsetText.
+ * \li Notion: Apart from lfun arguments you can use the following method: \n
+               1. input the type and argument of this inset, e.g. "menu paste", in
+               the work area.\n
+              2. select the text and run info-insert lfun.\n
+ * \li Syntax: info-insert <TYPE> <ARG>
+ * \li Params: <TYPE>: shortcut|lyxrc|package|textclass|menu|buffer \n
+               <ARG>: argument for a given type. Look into InsetInfo.h for detailed
+                     description.
+ * \li Origin: bpeng, 7 Oct 2007
+ * \endvar
+ */
                { LFUN_INFO_INSERT, "info-insert", Noop, Edit },
+/*!
+ * \var lyx::FuncCode lyx::LFUN_BRANCH_INSERT
+ * \li Action: Inserts branch inset.
+ * \li Syntax: branch-insert <BRANCH-NAME>
+ * \li Origin: vermeer, Aug 17 Aug 2003
+ * \endvar
+ */
                { LFUN_BRANCH_INSERT, "branch-insert", Noop, Edit },
                { LFUN_BOX_INSERT, "box-insert", Noop, Edit },
 /*!
@@ -374,6 +396,25 @@ void LyXAction::init()
                { LFUN_TOC_INSERT, "toc-insert", Noop, Edit },
                { LFUN_APPENDIX, "appendix", Noop, Edit },
 
+               { LFUN_INDEX_INSERT, "index-insert", Noop, Edit },
+               { LFUN_INDEX_PRINT, "index-print", Noop, Edit },
+
+               { LFUN_NOMENCL_INSERT, "nomencl-insert", Noop, Edit },
+               { LFUN_NOMENCL_PRINT, "nomencl-print", Noop, Edit },
+
+               { LFUN_NOTE_INSERT, "note-insert", Noop, Edit },
+               { LFUN_NOTE_NEXT, "note-next", ReadOnly, Edit },
+/*!
+ * \var lyx::FuncCode lyx::LFUN_NEWLINE_INSERT
+ * \li Action: Inserts a line break or new line.
+ * \li Syntax: newline-insert <ARG>
+ * \li Params: <ARG>: <newline|linebreak> default: newline
+ * \li Origin: JSpitzm, 25 Mar 2008
+ * \endvar
+ */
+               { LFUN_NEWLINE_INSERT, "newline-insert", Noop, Edit },
+
+
 #if 0
                { LFUN_LIST_INSERT, "list-insert", Noop, Edit },
 #endif
@@ -559,16 +600,6 @@ void LyXAction::init()
                { LFUN_LINE_DELETE, "line-delete-forward", Noop, Edit }, // there is no line-delete-backward
                { LFUN_LINE_END, "line-end", ReadOnly | NoUpdate, Edit },
                { LFUN_LINE_END_SELECT, "line-end-select", ReadOnly | SingleParUpdate, Edit },
-/*!
- * \var lyx::FuncCode lyx::LFUN_NEWLINE_INSERT
- * \li Action: Inserts a line break or new line.
- * \li Syntax: newline-insert <ARG>
- * \li Params: <ARG>: <newline|linebreak> default: newline
- * \li Origin: JSpitzm, 25 Mar 2008
- * \endvar
- */
-               { LFUN_NEWLINE_INSERT, "newline-insert", Noop, Edit },
-
 /*!
  * \var lyx::FuncCode lyx::LFUN_COPY
  * \li Action: Copies to the clipboard the last edit.
@@ -612,6 +643,13 @@ void LyXAction::init()
  * \endvar
  */
                { LFUN_REDO, "redo", Noop, Edit },
+/*!
+ * \var lyx::FuncCode lyx::LFUN_REPEAT
+ * \li Action: Repeat the given command.
+ * \li Syntax: repeat <COUNT> <LFUN-COMMAND>
+ * \li Author: poenitz, 27 Oct 2003
+ * \endvar
+ */
                { LFUN_REPEAT, "repeat", NoBuffer, Edit },
                { LFUN_CHARS_TRANSPOSE, "chars-transpose", Noop, Edit },
 
@@ -635,15 +673,6 @@ void LyXAction::init()
                { LFUN_FONT_UNDERLINE, "font-underline", Noop, Layout },
                { LFUN_SCREEN_FONT_UPDATE, "screen-font-update", NoBuffer, Layout },
 
-               { LFUN_INDEX_INSERT, "index-insert", Noop, Edit },
-               { LFUN_INDEX_PRINT, "index-print", Noop, Edit },
-
-               { LFUN_NOMENCL_INSERT, "nomencl-insert", Noop, Edit },
-               { LFUN_NOMENCL_PRINT, "nomencl-print", Noop, Edit },
-
-               { LFUN_NOTE_INSERT, "note-insert", Noop, Edit },
-               { LFUN_NOTE_NEXT, "note-next", ReadOnly, Edit },
-
                { LFUN_BIBITEM_INSERT, "bibitem-insert", Noop, Edit },
                { LFUN_CITATION_INSERT, "citation-insert", Noop, Edit },
                { LFUN_BIBTEX_DATABASE_ADD, "bibtex-database-add", Noop, Edit },
@@ -930,10 +959,41 @@ void LyXAction::init()
  */
                { LFUN_PARAGRAPH_MOVE_UP, "paragraph-move-up", Noop, Edit },
 
-               { LFUN_PARAGRAPH_SPACING, "paragraph-spacing", Noop, Edit },
+/*!
+ * \var lyx::FuncCode lyx::LFUN_PARAGRAPH_UP
+ * \li Action: Move the cursor to the next paragraph (or begining of the current one)
+               in upward direction.
+ * \li Syntax: paragraph-up
+ * \li Origin: Asger, 1 Oct 1996
+ * \endvar
+ */
                { LFUN_PARAGRAPH_UP, "paragraph-up", ReadOnly | NoUpdate, Edit },
+/*!
+ * \var lyx::FuncCode lyx::LFUN_PARAGRAPH_UP_SELECT
+ * \li Action: Move the cursor and select the text to the next paragraph (or
+               begining of the current one) in upward direction.
+ * \li Syntax: paragraph-up-select
+ * \li Origin: Asger, 1 Oct 1996
+ * \endvar
+ */
                { LFUN_PARAGRAPH_UP_SELECT, "paragraph-up-select", ReadOnly, Edit },
+/*!
+ * \var lyx::FuncCode lyx::LFUN_PARAGRAPH_DOWN
+ * \li Action: Move the cursor to the next paragraph (or begining of the current one)
+               in downward direction.
+ * \li Syntax: paragraph-down
+ * \li Origin: Asger, 1 Oct 1996
+ * \endvar
+ */
                { LFUN_PARAGRAPH_DOWN, "paragraph-down", ReadOnly | NoUpdate, Edit },
+/*!
+ * \var lyx::FuncCode lyx::LFUN_PARAGRAPH_DOWN_SELECT
+ * \li Action: Move the cursor and select the text to the next paragraph (or
+               begining of the current one) in downward direction.
+ * \li Syntax: paragraph-down-select
+ * \li Origin: Asger, 1 Oct 1996
+ * \endvar
+ */
                { LFUN_PARAGRAPH_DOWN_SELECT, "paragraph-down-select", ReadOnly, Edit },
 /*!
  * \var lyx::FuncCode lyx::LFUN_PARAGRAPH_GOTO
@@ -951,6 +1011,7 @@ void LyXAction::init()
  * \li Syntax: break-paragraph
  * \endvar
  */
+               { LFUN_PARAGRAPH_SPACING, "paragraph-spacing", Noop, Edit },
                { LFUN_BREAK_PARAGRAPH, "break-paragraph", Noop, Edit },
 /*!
  * \var lyx::FuncCode lyx::LFUN_BREAK_PARAGRAPH_SKIP
@@ -1071,6 +1132,11 @@ void LyXAction::init()
  * \var lyx::FuncCode lyx::LFUN_INSET_DISSOLVE
  * \li Action: Dissolve the current inset into text.
  * \li Syntax: inset-dissolve [<INSET>]
+ * \li Params: <INSET>: this can be used to make sure the right kind of inset
+                        is dissolved. For example "dissolve" entry in the charstyles
+                        sub-menu should only dissolve the charstyle inset, even if the
+                        cursor is inside several nested insets of different type.\n
+                       For values see #lyx::InsetLayout::lyxtype_ .
  * \li Author: JSpitz, 7 Aug 2006
  * \endvar
  */
@@ -1136,10 +1202,23 @@ void LyXAction::init()
  * \li Notion: Used for label, floats, listings, box, branch, external, wrap
                bibtex, ert, command, graphics, note, space, vspace, tabular,
                bibitem, inlude, ref insets.
- * \li Syntax: next-inset-toggle
+ * \li Syntax: next-inset-toggle <ARG>
+ * \li Params: <ARG>: these are passed as arguments to #LFUN_INSET_TOGGLE .
+ * \li Origin: leeming, 30 Mar 2004
  * \endvar
  */
                { LFUN_NEXT_INSET_TOGGLE, "next-inset-toggle", ReadOnly, Edit },
+/*!
+ * \var lyx::FuncCode lyx::LFUN_INSET_TOGGLE
+ * \li Action: Toggles the collapsable inset we are currently in.
+ * \li Syntax: inset-toggle [<ARG>]
+ * \li Params: <ARG>: <open|close|toggle|assign>. \n
+               open/close/toggle are for collapsable insets. close can be currently used
+               by #LFUN_NEXT_INSET_TOGGLE. toggle is used when no argument is given.\n
+               assign is for branch inset.
+ * \li Origin: lasgouttes, 19 Jul 2001
+ * \endvar
+ */
                { LFUN_INSET_TOGGLE, "inset-toggle", ReadOnly, Hidden },
 /*!
  * \var lyx::FuncCode lyx::LFUN_ALL_INSETS_TOGGLE
@@ -1147,7 +1226,8 @@ void LyXAction::init()
  * \li Notion: Used for box, branch, ert, float, listings, note, tabular, wrap insets.
  * \li Syntax: all-insets-toggle <STATE> <INSET>
  * \li Params: <STATE>: <toggle|open|close> default: toggle \n
- *             <INSET>: <box|branch|ert|float|listings|note|tabular|wrap> default: all insets \n
+               <INSET>: <box|branch|ert|float|listings|note|tabular|wrap> default: all insets \n
+ * \li Origin: leeming, 30 Mar 2004
  * \endvar
  */
                { LFUN_ALL_INSETS_TOGGLE, "all-insets-toggle", ReadOnly, Edit },
@@ -1271,6 +1351,13 @@ void LyXAction::init()
  * \endvar
  */
                { LFUN_TOOLBAR_TOGGLE, "toolbar-toggle", NoBuffer, Buffer },
+/*!
+ * \var lyx::FuncCode lyx::LFUN_MENU_OPEN
+ * \li Action: Opens the menu given by its name.
+ * \li Syntax: menu-open <NAME>
+ * \li Params: <NAME>: menu name. See various .inc files in lib/ui for candidates.
+ * \endvar
+ */
                { LFUN_MENU_OPEN, "menu-open", NoBuffer, Buffer },
 /*!
  * \var lyx::FuncCode lyx::LFUN_UI_TOGGLE
@@ -1288,7 +1375,24 @@ void LyXAction::init()
  */
                { LFUN_UI_TOGGLE, "ui-toggle", NoBuffer, Buffer },
 
+/*!
+ * \var lyx::FuncCode lyx::WINDOW_NEW
+ * \li Action: Creates new empty LyX window.
+ * \li Notion: Already opened documents from the previous window can be found under View menu.
+ * \li Syntax: window-new [<GEOMETRY>]
+ * \li Params: <GEOMETRY>: pass the geometry of the window. This parameter is currently 
+                           accepted only on Windows platform.
+ * \li Origin: Abdel, 21 Oct 2006
+ * \endvar
+ */
                { LFUN_WINDOW_NEW, "window-new", NoBuffer, Buffer },
+/*!
+ * \var lyx::FuncCode lyx::LFUN_WINDOW_CLOSE
+ * \li Action: Closes the current LyX window.
+ * \li Syntax: window-close
+ * \li Origin: Abdel, 23 Oct 2006
+ * \endvar
+ */
                { LFUN_WINDOW_CLOSE, "window-close", NoBuffer, Buffer },
 
 /*!
@@ -1336,10 +1440,8 @@ void LyXAction::init()
                { LFUN_ESCAPE, "escape", ReadOnly, Edit },
 
                { LFUN_SERVER_CHAR_AFTER, "server-char-after", ReadOnly, System },
-               { LFUN_SERVER_GET_FONT, "server-get-font", ReadOnly, System },
                { LFUN_SERVER_GET_LAYOUT, "server-get-layout", ReadOnly, System },
                { LFUN_SERVER_GET_NAME, "server-get-name", ReadOnly, System },
-               { LFUN_SERVER_GET_XY, "server-get-xy", ReadOnly, System },
 /*!
  * \var lyx::FuncCode lyx::LFUN_SERVER_GOTO_FILE_ROW
  * \li Action: Sets the cursor position based on the row number of generated TeX file.
@@ -1349,8 +1451,36 @@ void LyXAction::init()
  */
                { LFUN_SERVER_GOTO_FILE_ROW, "server-goto-file-row", ReadOnly, System },
                { LFUN_SERVER_NOTIFY, "server-notify", ReadOnly, System },
+/*!
+ * \var lyx::FuncCode lyx::LFUN_SERVER_SET_XY
+ * \li Action: Sets the cursor position based on the editing area coordinates
+               (similar as clicking on that point with left mouse button).
+ * \li Syntax: server-set-xy <X> <Y>
+ * \endvar
+ */
                { LFUN_SERVER_SET_XY, "server-set-xy", ReadOnly, System },
+/*!
+ * \var lyx::FuncCode lyx::LFUN_SERVER_GET_XY
+ * \li Action: Returns the coordinates of cursor position in the editing area.
+ * \li Syntax: server-get-xy
+ * \endvar
+ */
+               { LFUN_SERVER_GET_XY, "server-get-xy", ReadOnly, System },
 
+/*!
+ * \var lyx::FuncCode lyx::LFUN_BUILD_PROGRAM
+ * \li Action: Generates the code (literate programming).
+ * \li Notion: Latex file with extension \literate_extension is generated.
+               Then LyX invokes \build_command (with a default of``make'') to generate the code and
+              \build_error_filter to process the compilation error messages. \n
+              In case you want to process your literate file with a script, or some other program,
+              just insert in your lyxrc file an entry with:\n
+              \build_command "my_script my_arguments" \n
+              The \build_error_filter differs from the \literate_error_filter only in that the
+              former will identify error messages from your compiler.
+ * \li Syntax: build-program
+ * \endvar
+ */
                { LFUN_BUILD_PROGRAM, "build-program", ReadOnly, Buffer },
 
 /*!
@@ -1362,7 +1492,23 @@ void LyXAction::init()
  * \endvar
  */
                { LFUN_BUFFER_AUTO_SAVE, "buffer-auto-save", Noop, Buffer },
+/*!
+ * \var lyx::FuncCode lyx::LFUN_BUFFER_CHILD_OPEN
+ * \li Action: Loads the given child document.
+ * \li Notion: The current document is treated as a parent.
+ * \li Syntax: buffer-child-open <FILE>
+ * \li Params: <FILE>: Filename of the child. The directory of the parent is assumed by default.
+ * \li Origin: Ale, 28 May 1997
+ * \endvar
+ */
                { LFUN_BUFFER_CHILD_OPEN, "buffer-child-open", ReadOnly, Buffer },
+/*!
+ * \var lyx::FuncCode lyx::LFUN_BUFFER_CHKTEX
+ * \li Action: Runs chktex for the current document.
+ * \li Syntax: buffer-chktex
+ * \li Origin: Asger, 30 Oct 1997
+ * \endvar
+ */
                { LFUN_BUFFER_CHKTEX, "buffer-chktex", ReadOnly, Buffer },
 /*!
  * \var lyx::FuncCode lyx::LFUN_BUFFER_TOGGLE_COMPRESSION
@@ -1372,14 +1518,6 @@ void LyXAction::init()
  * \endvar
  */
                { LFUN_BUFFER_TOGGLE_COMPRESSION, "buffer-toggle-compression", Noop, Buffer },
-/*!
- * \var lyx::FuncCode lyx::LFUN_BUFFER_TOGGLE_EMBEDDING
- * \li Action: Toggles the embeddding feature on/off.
- * \li Syntax: buffer-toggle-embedding
- * \li Origin: bpeng, 21 Oct 2007
- * \endvar
- */
-               { LFUN_BUFFER_TOGGLE_EMBEDDING, "buffer-toggle-embedding", Noop, Buffer },
 /*!
  * \var lyx::FuncCode lyx::LFUN_BUFFER_CLOSE
  * \li Action: Closes the current buffer.
@@ -1838,7 +1976,7 @@ bool LyXAction::funcHasFlag(FuncCode action,
 
        if (ici == lyx_info_map.end()) {
                LYXERR0("action: " << action << " is not known.");
-               BOOST_ASSERT(false);
+               LASSERT(false, /**/);
        }
 
        return ici->second.attrib & flag;