X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FLyXAction.cpp;h=a171cd1a1e74e4963dd4d59ee833e32a06a7c242;hb=55a3dd7b346d29a52ba305a4558e9e380ef50f47;hp=c183d74c119ee63d05bf86d75e8ce0956c6835c8;hpb=0aa20c9ace1fd9cd0793c96b08b42ccef4844b0f;p=lyx.git diff --git a/src/LyXAction.cpp b/src/LyXAction.cpp index c183d74c11..a171cd1a1e 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[] = { @@ -314,21 +317,13 @@ void LyXAction::init() */ { LFUN_WRAP_INSERT, "wrap-insert", Noop, Edit }, /*! - * \var lyx::FuncCode lyx::LFUN_OPTIONAL_INSERT - * \li Action: Inserts an optional-argument (short title) inset. - * \li Syntax: optional-insert + * \var lyx::FuncCode lyx::LFUN_ARGUMENT_INSERT + * \li Action: Inserts an argument (short title) inset. + * \li Syntax: argument-insert * \li Origin: vermeer, 12 Aug 2002 * \endvar */ - { LFUN_OPTIONAL_INSERT, "optional-insert", Noop, Edit }, -/*! - * \var lyx::FuncCode lyx::LFUN_LINE_INSERT - * \li Action: Inserts a horizontal line. - * \li Syntax: line-insert - * \li Origin: Andre, Oct 27 2003 - * \endvar - */ - { LFUN_LINE_INSERT, "line-insert", Noop, Edit }, + { LFUN_ARGUMENT_INSERT, "argument-insert", Noop, Edit }, /*! * \var lyx::FuncCode lyx::LFUN_NEWPAGE_INSERT * \li Action: Inserts a new page. @@ -365,6 +360,14 @@ 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. @@ -405,16 +408,18 @@ void LyXAction::init() the work area.\n 2. select the text and run info-insert lfun. * \li Syntax: info-insert - * \li Params: : shortcut[s]|lyxrc|package|textclass|menu|buffer \n + * \li Params: : shortcut[s]|lyxrc|lyxinfo|package|textclass|menu|buffer \n : argument for a given type. Look into InsetInfo.h for detailed description. \n shortcut[s]: name of lfun (e.g math-insert \alpha) \n lyxrc: name of rc_entry (e.g. bind_file) \n + lyxinfo: "version" - used version of LyX \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" + icon: icon 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 @@ -448,16 +453,12 @@ void LyXAction::init() a few contained in the Logical Markup module. You can also of course create some yourself. \n For dissolving the element see #LFUN_INSET_DISSOLVE. - * \li Syntax: flex-insert - * \li Params: TYPE: CharStyle|Custom|Element|Standard \n - Identifies whether this is a Character Style, a - Custom Inset or an XML Element, and which dynamical - sub-menu this flex inset is in on the LyX menu tree. - If Standard (currently unused): none of these.\n - Name: This name must be defined either in your layout file + * \li Syntax: flex-insert Name + * \li Params: Name: This name must be defined either in your layout file or imported by some module. The definition is - InsetLayout - * \li Sample: flex-insert CharStyle:Code + InsetLayout Name or InsetLayout . The Flex: + prefix is optional. + * \li Sample: flex-insert Code * \endvar */ { LFUN_FLEX_INSERT, "flex-insert", Noop, Edit }, @@ -474,9 +475,10 @@ void LyXAction::init() * \var lyx::FuncCode lyx::LFUN_SPACE_INSERT * \li Action: Inserts one of horizontal space insets. * \li Syntax: space-insert [] - * \li Params: : normal, protected, thin, quad, qquad, enspace, enskip, - negthinspace, hfill, hfill*, dotfill, hrulefill, hspace, - hspace* \n + * \li Params: : normal, protected, visible, thin, quad, qquad, enspace, + enskip, negthinspace, negmedspace, negthickspace, hfill, + hfill*, dotfill, hrulefill, hspace, hspace* \n + Only in math mode: med and thick.\n : length for custom spaces (hspace, hspace* for protected) * \li Origin: JSpitzm, 20 May 2003, Mar 17 2008 * \endvar @@ -502,13 +504,14 @@ void LyXAction::init() */ { LFUN_SPECIALCHAR_INSERT, "specialchar-insert", Noop, Edit }, /*! - * \var lyx::FuncCode lyx::LFUN_TOC_INSERT - * \li Action: Inserts table of contents. - * \li Syntax: toc-insert - * \li Origin: Lgb, 27 May 97 + * \var lyx::FuncCode lyx::LFUN_SCRIPT_INSERT + * \li Action: Inserts a subscript or superscript inset. + * \li Syntax: script-insert + * \li Params: : subscript|superscript + * \li Origin: Georg, 23 Nov 2010 * \endvar */ - { LFUN_TOC_INSERT, "toc-insert", Noop, Edit }, + { LFUN_SCRIPT_INSERT, "script-insert", Noop, Edit }, /*! * \var lyx::FuncCode lyx::LFUN_APPENDIX * \li Action: Start (or remove) Appendix on the given cursor position. @@ -574,16 +577,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, @@ -606,6 +599,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 @@ -870,7 +864,7 @@ void LyXAction::init() * \li Params: : data is of the form " \n \n - " + " * \li Origin: Andre, Jan 7 2004 * \endvar */ @@ -989,6 +983,39 @@ 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_SPELLING_REMOVE + * \li Action: Remove the word under the cursor from the respective + * spell checker dictionary. + * \li Syntax: spelling-remove [] [] + * \li Params: : word to remove + : language name (see file languages) + * \li Origin: SWitt, 28 July 2010 + * \endvar + */ + { LFUN_SPELLING_REMOVE, "spelling-remove", ReadOnly, Edit }, /*! * \var lyx::FuncCode lyx::LFUN_THESAURUS_ENTRY * \li Action: Look up thesaurus entries with respect to the word under the cursor. @@ -1082,6 +1109,17 @@ void LyXAction::init() */ { 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. @@ -1148,13 +1186,13 @@ void LyXAction::init() * \li Action: Pastes text from the active clipboard. * \li Syntax: clipboard-paste [] * \li Params: : "paragraph" will cause pasting as one paragraph, i.e. "Join lines". - * \li Origin: baum, 10 Jul 2006 + * \li Origin: Georg, 10 Jul 2006 * \endvar */ { LFUN_CLIPBOARD_PASTE, "clipboard-paste", Noop, Edit }, /*! * \var lyx::FuncCode lyx::LFUN_PRIMARY_SELECTION_PASTE - * \li Action: Pastes the currently text selected text. + * \li Action: Pastes the currently selected text. * \li Notion: Primary selection mechanism is linux-only thing. * \li Syntax: primary-selection-paste [] * \li Params: : "paragraph" will cause pasting as one paragraph, i.e. "Join lines". @@ -1163,25 +1201,36 @@ void LyXAction::init() { LFUN_PRIMARY_SELECTION_PASTE, "primary-selection-paste", Noop, Edit }, /*! * \var lyx::FuncCode lyx::LFUN_SELECTION_PASTE - * \li Action: Pastes the text in permanent selection. + * \li Action: Pastes the internal selection text in permanent selection. + * \li Notion: Created in order to have middle mouse button pasting correct (bound to + command-alternatives selection-paste ; primary-selection-paste paragraph). * \li Syntax: selection-paste + * \li Origin: lasgouttes, 14 Jan 2009 * \endvar */ { LFUN_SELECTION_PASTE, "selection-paste", Noop, Edit }, +/*! + * \var lyx::FuncCode lyx::LFUN_CLIPBOARD_PASTE_SIMPLE + * \li Action: Pastes simple unformatted text from the active clipboard. + * \li Syntax: clipboard-paste-simple [] + * \li Params: : "paragraph" will cause pasting as one paragraph, i.e. "Join lines". + * \endvar + */ + { LFUN_CLIPBOARD_PASTE_SIMPLE, "clipboard-paste-simple", Noop, Edit }, /*! * \var lyx::FuncCode lyx::LFUN_UNDO * \li Action: Undoes the last edit. * \li Syntax: undo * \endvar */ - { LFUN_UNDO, "undo", Noop, Edit }, + { LFUN_UNDO, "undo", ReadOnly, Edit }, /*! * \var lyx::FuncCode lyx::LFUN_REDO * \li Action: Redoes the last thing undone. * \li Syntax: redo * \endvar */ - { LFUN_REDO, "redo", Noop, Edit }, + { LFUN_REDO, "redo", ReadOnly, Edit }, /*! * \var lyx::FuncCode lyx::LFUN_REPEAT * \li Action: Repeat the given command. @@ -1566,7 +1615,7 @@ void LyXAction::init() { LFUN_MATH_SUBSCRIPT, "math-subscript", Noop, Math }, /*! * \var lyx::FuncCode lyx::LFUN_MATH_SUPERSCRIPT - * \li Action: Enters subscript expression in math expression. + * \li Action: Enters superscript expression in math expression. * \li Syntax: math-superscript * \li Origin: vermeer, 12 Dec 2001 * \endvar @@ -1712,9 +1761,8 @@ void LyXAction::init() * \var lyx::FuncCode lyx::LFUN_MATH_FONT_STYLE * \li Action: Changes the text style used in math. * \li Syntax: math-font-style