X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FLyXAction.cpp;h=af1f6041dea1bc9b0afe5c9c7dd491faca11c8bf;hb=b8550d11e836e857967a31250e6ca248b2d43f82;hp=5d6514f7fdcaf3b95eb75e9a10b67129c3fd60d9;hpb=a8682e3f5f31eb30f5c87cdebfb8ad0e92818626;p=lyx.git diff --git a/src/LyXAction.cpp b/src/LyXAction.cpp index 5d6514f7fd..af1f6041de 100644 --- a/src/LyXAction.cpp +++ b/src/LyXAction.cpp @@ -57,6 +57,8 @@ namespace lyx { * * Doxygen template below. Some notes: Parameters should be set in uppercase * and put in , [] means optional one. + * + * Use spaces for indentation (doxy -> .lyx generator is tab-sensitive). */ /*! @@ -74,7 +76,7 @@ LyXAction lyxaction; void LyXAction::newFunc(FuncCode action, string const & name, - unsigned int attrib, LyXAction::func_type type) + unsigned int attrib, LyXAction::FuncType type) { lyx_func_map[name] = action; FuncInfo tmpinfo; @@ -97,13 +99,14 @@ void LyXAction::init() // magnitudes faster. static bool init; - if (init) return; + if (init) + return; struct ev_item { FuncCode action; char const * name; unsigned int attrib; - func_type type; + FuncType type; }; ev_item const items[] = { @@ -365,12 +368,20 @@ void LyXAction::init() * \endvar */ { LFUN_LISTING_INSERT, "listing-insert", Noop, Edit }, +/*! + * \var lyx::FuncCode lyx::LFUN_PREVIEW_INSERT + * \li Action: Inserts a new preview inset. + * \li Syntax: preview-insert + * \li Origin: vfr, 28 Mar 2010 + * \endvar + */ + { LFUN_PREVIEW_INSERT, "preview-insert", Noop, Edit }, /*! * \var lyx::FuncCode lyx::LFUN_TAB_INSERT * \li Action: Insert a tab into a listings inset. * \li Notion: It also works on a selection. * \li Syntax: tab-insert - * \li Origin: vfvanravesteijn, Sep 30 2008 + * \li Origin: vfr, Sep 30 2008 * \endvar */ { LFUN_TAB_INSERT, "tab-insert", SingleParUpdate, Edit }, @@ -382,14 +393,14 @@ void LyXAction::init() beginning of each line spanned by the selection. This is useful if you want to indent/unindent multiple lines in one action. * \li Syntax: tab-delete - * \li Origin: vfvanravesteijn, Sep 30 2008 + * \li Origin: vfr, Sep 30 2008 * \endvar */ { LFUN_TAB_DELETE, "tab-delete", SingleParUpdate, Edit }, /*! * \var lyx::FuncCode lyx::LFUN_QUOTE_INSERT * \li Action: Inserts quotes according to the type and quote-language preference. - * \li Action: Currently English, Swedish, German, Polish, French, Danish quotes + * \li Notion: Currently English, Swedish, German, Polish, French, Danish quotes are distinguished. * \li Syntax: quote-insert [] * \li Params: : 'single' for single quotes, otherwise double quotes will be used. @@ -405,9 +416,17 @@ void LyXAction::init() the work area.\n 2. select the text and run info-insert lfun. * \li Syntax: info-insert - * \li Params: : shortcut|lyxrc|package|textclass|menu|buffer \n + * \li Params: : shortcut[s]|lyxrc|package|textclass|menu|buffer \n : argument for a given type. Look into InsetInfo.h for detailed - description. + description. \n + shortcut[s]: name of lfun (e.g math-insert \alpha) \n + lyxrc: name of rc_entry (e.g. bind_file) \n + package: name of latex package (e.g. listings) \n + textclass: name of textclass (e.g. article) \n + menu: name of lfun used in menu \n + icon: name of lfun used in toolbar \n + buffer: "name"|"path"|"class"|"vcs-tree-revision"| + "vcs-revision"|"vcs-author"|"vcs-date"|"vcs-time" * \li Sample: command-sequence info-insert buffer path; info-insert buffer name * \li Origin: bpeng, 7 Oct 2007 * \endvar @@ -567,16 +586,6 @@ void LyXAction::init() * \endvar */ { LFUN_NOTE_NEXT, "note-next", ReadOnly, Edit }, -/*! - * \var lyx::FuncCode lyx::LFUN_NOTES_MUTATE - * \li Action: Changes all Note insets of a particular type (source) - to a different type (target) fot the current document. - * \li Syntax: notes-mutate - * \li Params: : Note|Comment|Greyedout - * \li Origin: sanda, 18 Jun 2008 - * \endvar - */ - { LFUN_NOTES_MUTATE, "notes-mutate", Argument, Edit }, /*! * \var lyx::FuncCode lyx::LFUN_PHANTOM_INSERT * \li Action: Inserts phantom on the current cursor postion, @@ -599,6 +608,7 @@ void LyXAction::init() /*! * \var lyx::FuncCode lyx::LFUN_ESCAPE * \li Action: Clears the selection. If no text is selected call #LFUN_FINISHED_FORWARD. + Inside math mode jumps out of the math inset. * \li Syntax: escape * \li Origin: Lgb, 17 May 2001 * \endvar @@ -861,8 +871,8 @@ void LyXAction::init() * \li Action: Replace a string in the document. * \li Syntax: word-replace [] * \li Params: : data is of the form - " \n - \n + " \n + \n " * \li Origin: Andre, Jan 7 2004 * \endvar @@ -878,8 +888,9 @@ void LyXAction::init() * \li Origin: Tommaso, Nov 15 2007 * \endvar */ - { LFUN_WORD_FINDADV, "word-findadv", ReadOnly, Edit }, -/*! \var lyx::FuncCode lyx::LFUN_WORD_FORWARD + { LFUN_WORD_FINDADV, "word-findadv", ReadOnly | NoBuffer, Edit }, +/*! + * \var lyx::FuncCode lyx::LFUN_WORD_FORWARD * \li Action: Moves the cursor to the logically next beginning of a word. * \li Notion: This is not the action which should be bound to the arrow keys, because forward may be left or right, depending on the language. @@ -981,6 +992,28 @@ void LyXAction::init() * \endvar */ { LFUN_WORD_LOWCASE, "word-lowcase", Noop, Edit }, +/*! + * \var lyx::FuncCode lyx::LFUN_SPELLING_ADD + * \li Action: Add the word under the cursor to the respective + * spell checker dictionary. + * \li Syntax: spelling-add [] [] + * \li Params: : word to add + : language name (see file languages) + * \li Origin: JSpitzm, 18 Jan 2010 + * \endvar + */ + { LFUN_SPELLING_ADD, "spelling-add", ReadOnly, Edit }, +/*! + * \var lyx::FuncCode lyx::LFUN_SPELLING_IGNORE + * \li Action: Let the spell checker ignore the word under the cursor + * in the current session for the given language. + * \li Syntax: spelling-ignore [] [] + * \li Params: : word to ignore + : language name (see file languages) + * \li Origin: JSpitzm, 18 Jan 2010 + * \endvar + */ + { LFUN_SPELLING_IGNORE, "spelling-ignore", ReadOnly, Edit }, /*! * \var lyx::FuncCode lyx::LFUN_THESAURUS_ENTRY * \li Action: Look up thesaurus entries with respect to the word under the cursor. @@ -1028,7 +1061,7 @@ void LyXAction::init() if it is not already there, or at the beginning of the enclosing inset otherwise * \li Syntax: inset-begin - * \li Origin: JMarc, 2009/03/16 + * \li Origin: lasgouttes, 16 Mar 2009 * \endvar */ { LFUN_INSET_BEGIN, "inset-begin", ReadOnly, Edit }, @@ -1039,7 +1072,7 @@ void LyXAction::init() enclosing inset otherwise (adding the traversed text to the selection). * \li Syntax: inset-begin-select - * \li Origin: JMarc, 2009/03/16 + * \li Origin: lasgouttes, 16 Mar 2009 * \endvar */ { LFUN_INSET_BEGIN_SELECT, "inset-begin-select", ReadOnly, Edit }, @@ -1049,7 +1082,7 @@ void LyXAction::init() if it is not already there, or at the end of the enclosing inset otherwise * \li Syntax: inset-end - * \li Origin: JMarc, 2009/03/16 + * \li Origin: lasgouttes, 16 Mar 2009 * \endvar */ { LFUN_INSET_END, "inset-end", ReadOnly, Edit }, @@ -1060,11 +1093,31 @@ void LyXAction::init() enclosing inset otherwise (adding the traversed text to the selection). * \li Syntax: inset-end-select - * \li Origin: JMarc, 2009/03/16 + * \li Origin: lasgouttes, 16 Mar 2009 * \endvar */ { LFUN_INSET_END_SELECT, "inset-end-select", ReadOnly, Edit }, +/*! + * \var lyx::FuncCode lyx::LFUN_INSET_SELECT_ALL + * \li Action: Selects all contents of an inset. + * \li Syntax: inset-select-all + * \li Origin: vfr, 22 Aug 2009 + * \endvar + */ + { LFUN_INSET_SELECT_ALL, "inset-select-all", ReadOnly, Edit }, + +/*! + * \var lyx::FuncCode lyx::LFUN_SECTION_SELECT + * \li Action: Selects the whole section. + * \li Notion: The cursor should be in a section heading + before calling this lfun. + * \li Syntax: section-select + * \li Origin: vfr, 05 May 2009 + * \endvar + */ + { LFUN_SECTION_SELECT, "section-select", ReadOnly, Edit }, + /*! * \var lyx::FuncCode lyx::LFUN_LINE_BEGIN * \li Action: Move the cursor to the begining of the (screen) line. @@ -1119,9 +1172,10 @@ void LyXAction::init() { LFUN_CUT, "cut", Noop, Edit }, /*! * \var lyx::FuncCode lyx::LFUN_PASTE - * \li Action: Pastes material from the active clipboard. - * \li Syntax: paste [] - * \li Params: : emf|pdf|png|jpeg|linkback|wmf + * \li Action: Pastes material (text or picture) from the active clipboard. + * \li Syntax: paste [|] + * \li Params: : emf|pdf|png|jpeg|linkback|wmf \n + : number of the selection in the internal clipboard stack to be pasted. * \endvar */ { LFUN_PASTE, "paste", Noop, Edit }, @@ -1422,7 +1476,7 @@ void LyXAction::init() * \li Origin: rgh, 25 August 2007 * \endvar */ - { LFUN_LAYOUT_MODULES_CLEAR, "layout-modules-clear", Noop, Layout }, + { LFUN_LAYOUT_MODULES_CLEAR, "layout-modules-clear", NoInternal, Layout }, /*! * \var lyx::FuncCode lyx::LFUN_LAYOUT_MODULE_ADD * \li Action: Adds a module. @@ -1432,7 +1486,7 @@ void LyXAction::init() * \li Origin: rgh, 25 August 2007 * \endvar */ - { LFUN_LAYOUT_MODULE_ADD, "layout-module-add", Noop, Layout }, + { LFUN_LAYOUT_MODULE_ADD, "layout-module-add", NoInternal, Layout }, /*! * \var lyx::FuncCode lyx::LFUN_LAYOUT_RELOAD * \li Action: Reloads layout information. @@ -1444,7 +1498,7 @@ void LyXAction::init() * \li Origin: rgh, 3 September 2007 * \endvar */ - { LFUN_LAYOUT_RELOAD, "layout-reload", Noop, Layout }, + { LFUN_LAYOUT_RELOAD, "layout-reload", NoInternal, Layout }, /*! * \var lyx::FuncCode lyx::LFUN_TEXTCLASS_APPLY * \li Action: Sets the text class for the current buffer. @@ -1453,7 +1507,7 @@ void LyXAction::init() the filename, minus the ".layout" extension. * \endvar */ - { LFUN_TEXTCLASS_APPLY, "textclass-apply", Noop, Layout }, + { LFUN_TEXTCLASS_APPLY, "textclass-apply", NoInternal, Layout }, /*! * \var lyx::FuncCode lyx::LFUN_TEXTCLASS_LOAD * \li Action: Loads information for a textclass from disk. @@ -1462,7 +1516,7 @@ void LyXAction::init() the filename, minus the ".layout" extension. * \endvar */ - { LFUN_TEXTCLASS_LOAD, "textclass-load", Noop, Layout }, + { LFUN_TEXTCLASS_LOAD, "textclass-load", NoInternal, Layout }, /*! * \var lyx::FuncCode lyx::LFUN_MARK_OFF @@ -1527,6 +1581,14 @@ void LyXAction::init() * \li Action: Inserts math objects and symbols. * \li Syntax: math-insert * \li Params: : Symbol or LaTeX code to be inserted. + * \li Notion: When is a _single_ math inset with more than one cell + (such as "x_y^z" or "\frac{x}{y}"), the content of cell(0) is + replaced by the current selection (only works if the selection + is in mathed). As an example, if "abc" is selected in mathed, + "math-insert \frac{x}{y}" replaces "abc" with "\frac{abc}{y}", + and "math-insert x_y^z" replaces "abc" with "abc_y^z". + If nothing is selected (or the selection is not in mathed), + math-insert works as expected. * \endvar */ { LFUN_MATH_INSERT, "math-insert", Noop, Math }, @@ -1561,7 +1623,7 @@ void LyXAction::init() * \var lyx::FuncCode lyx::LFUN_MATH_MACRO * \li Action: Inserts a math macro definition at the cursor position in the text. * \li Syntax: math-macro [] [def] - * \li Params: : The name of the macro, e.g. "mymacro". + * \li Params: : The name of the macro, e.g. "mymacro".\n : The number of parameters of the macro. Default is 0. "def": Has no effect anymore, just for compatibility with former LyX versions. * \li Origin: ale, 10 May 1997; sts, 21 Dec 2007 @@ -1586,9 +1648,9 @@ void LyXAction::init() * \li Params: : negative spaces: !|negthinspace|negmedspace|negthickspace \n positive spaces: ,|thinspace|:|medspace|;|thickspace|enskip|quad|qquad \n custom space: hspace \n - "," used by default. + "," used by default.\n Note that ! is equivalent to negthinspace, , = thinspace, - : = medspace, and ; = thickspace. + : = medspace, and ; = thickspace.\n : length for custom spaces (hspace) * \li Origin: Andre, 25 Jul 2001; sanda, 16 Jun 2008 * \endvar @@ -1605,13 +1667,24 @@ void LyXAction::init() * \endvar */ { LFUN_MATH_MATRIX, "math-matrix", Noop, Math }, +/*! + * \var lyx::FuncCode lyx::LFUN_MATH_AMS_MATRIX + * \li Action: Inserts a matrix. + * \li Syntax: math-matrix [] + * \li Params: : Decoration determines the LaTeX name of the matrix + that should be created. + * \li Sample: math-ams-matrix 3 3 bmatrix + * \endvar + */ + { LFUN_MATH_AMS_MATRIX, "math-ams-matrix", Noop, Math }, /*! * \var lyx::FuncCode lyx::LFUN_MATH_MODE * \li Action: In text mode enters math mode (i.e. puts math insets on the current cursor position), in math mode enters text mode inside math expression. * \li Notion: If there is some selected text, it puts the text inside created math box. - * \li Syntax: math-mode [] - * \li Params: : eventual argument (LaTeX code) is passed to #LFUN_MATH_INSERT . + * \li Syntax: math-mode [on|] + * \li Params: : eventual argument (LaTeX code) is passed to #LFUN_MATH_INSERT .\n + "on": allow only entering of math mode from text mode. * \li Origin: Alejandro, 4 Jun 1996 * \endvar */ @@ -1667,7 +1740,7 @@ void LyXAction::init() * \li Notion: Provides an interface to the LaTeX math mode font size commands. * \li Syntax: math-size