3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Lars Gullik Bjønnes
7 * \author Jean-Marc Lasgouttes
11 * Full author contact details are available in file CREDITS.
16 #include "LyXAction.h"
19 #include "funcrequest.h"
21 #include "support/lstrings.h"
23 #include <boost/assert.hpp>
37 NAMING RULES FOR USER-COMMANDS
38 Here's the set of rules to apply when a new command name is introduced:
40 1) Use the object.event order. That is, use `word-forward'
41 instead of `forward-word'.
42 2) Don't introduce an alias for an already named object. Same for events.
43 3) Forward movement or focus is called `forward' (not `right').
44 4) Backward movement or focus is called `backward' (not `left').
45 5) Upward movement of focus is called `up'.
46 6) Downward movement is called `down'.
47 7) The begin of an object is called `begin' (not `start').
48 8) The end of an object is called `end'.
50 (May 19 1996, 12:04, RvdK)
56 void LyXAction::newFunc(kb_action action, string const & name,
59 lyx_func_map[name] = action;
62 tmpinfo.attrib = attrib;
63 lyx_info_map[action] = tmpinfo;
67 void LyXAction::init()
69 // This function was changed to use the array below in initalization
70 // instead of calling newFunc numerous times because of compilation
71 // times. Since the array is not static we get back the memory it
72 // occupies after the init is completed. It compiles several
84 ev_item const items[] = {
85 { LFUN_ACCENT_ACUTE, "accent-acute", Noop },
86 { LFUN_ACCENT_BREVE, "accent-breve", Noop },
87 { LFUN_ACCENT_CARON, "accent-caron", Noop },
88 { LFUN_ACCENT_CEDILLA, "accent-cedilla", Noop },
89 { LFUN_ACCENT_CIRCLE, "accent-circle", Noop },
90 { LFUN_ACCENT_CIRCUMFLEX, "accent-circumflex", Noop },
91 { LFUN_ACCENT_DOT, "accent-dot", Noop },
92 { LFUN_ACCENT_GRAVE, "accent-grave", Noop },
93 { LFUN_ACCENT_HUNGARIAN_UMLAUT, "accent-hungarian-umlaut", Noop },
94 { LFUN_ACCENT_MACRON, "accent-macron", Noop },
95 { LFUN_ACCENT_OGONEK, "accent-ogonek", Noop },
96 { LFUN_ACCENT_SPECIAL_CARON, "accent-special-caron", Noop },
97 { LFUN_ACCENT_TIE, "accent-tie", Noop },
98 { LFUN_ACCENT_TILDE, "accent-tilde", Noop },
99 { LFUN_ACCENT_UMLAUT, "accent-umlaut", Noop },
100 { LFUN_ACCENT_UNDERBAR, "accent-underbar", Noop },
101 { LFUN_ACCENT_UNDERDOT, "accent-underdot", Noop },
102 { LFUN_APPENDIX, "appendix", Noop },
103 { LFUN_BOOKMARK_GOTO, "bookmark-goto", ReadOnly },
104 { LFUN_BOOKMARK_SAVE, "bookmark-save", ReadOnly },
105 { LFUN_BREAK_LINE, "break-line", Noop },
106 { LFUN_BREAK_PARAGRAPH, "break-paragraph", Noop },
107 { LFUN_BREAK_PARAGRAPH_KEEP_LAYOUT, "break-paragraph-keep-layout", Noop },
108 { LFUN_BREAK_PARAGRAPH_SKIP, "break-paragraph-skip", Noop },
109 { LFUN_BUILD_PROGRAM, "build-program", ReadOnly },
110 { LFUN_BUFFER_AUTO_SAVE, "buffer-auto-save", Noop },
111 { LFUN_BUFFER_BEGIN, "buffer-begin", ReadOnly },
112 { LFUN_BUFFER_BEGIN_SELECT, "buffer-begin-select", ReadOnly },
113 { LFUN_BUFFER_CHILD_OPEN, "buffer-child-open", ReadOnly },
114 { LFUN_BUFFER_CHKTEX, "buffer-chktex", ReadOnly },
115 { LFUN_BUFFER_TOGGLE_COMPRESSION, "buffer-toggle-compression", Noop},
116 { LFUN_BUFFER_CLOSE, "buffer-close", ReadOnly },
117 { LFUN_BUFFER_END, "buffer-end", ReadOnly },
118 { LFUN_BUFFER_END_SELECT, "buffer-end-select", ReadOnly },
119 { LFUN_BUFFER_EXPORT, "buffer-export", ReadOnly },
120 { LFUN_BUFFER_EXPORT_CUSTOM, "buffer-export-custom", ReadOnly },
121 { LFUN_BUFFER_PRINT, "buffer-print", ReadOnly },
122 { LFUN_BUFFER_IMPORT, "buffer-import", NoBuffer },
123 { LFUN_BUFFER_NEW, "buffer-new", NoBuffer },
124 { LFUN_BUFFER_NEW_TEMPLATE,"buffer-new-template", NoBuffer },
125 { LFUN_BUFFER_RELOAD, "buffer-reload", ReadOnly },
126 { LFUN_BUFFER_SWITCH, "buffer-switch", ReadOnly },
127 { LFUN_BUFFER_TOGGLE_READ_ONLY, "buffer-toggle-read-only", ReadOnly },
128 { LFUN_BUFFER_UPDATE, "buffer-update", ReadOnly },
129 { LFUN_BUFFER_VIEW, "buffer-view", ReadOnly },
130 { LFUN_BUFFER_WRITE, "buffer-write", ReadOnly },
131 { LFUN_BUFFER_WRITE_AS, "buffer-write-as", ReadOnly },
132 { LFUN_CANCEL, "cancel", NoBuffer },
133 { LFUN_CAPTION_INSERT, "caption-insert", Noop },
134 { LFUN_CHAR_BACKWARD, "char-backward", ReadOnly | NoUpdate},
135 { LFUN_CHAR_BACKWARD_SELECT, "backward-select", ReadOnly | SingleParUpdate },
136 { LFUN_CHAR_DELETE_BACKWARD, "delete-backward", SingleParUpdate },
137 { LFUN_CHAR_DELETE_FORWARD, "delete-forward", SingleParUpdate },
138 { LFUN_CHAR_FORWARD, "char-forward", ReadOnly | NoUpdate},
139 { LFUN_CHAR_FORWARD_SELECT, "forward-select", ReadOnly | SingleParUpdate },
140 { LFUN_CLIPBOARD_PASTE, "clipboard-paste", Noop },
141 { LFUN_COMMAND_EXECUTE, "command-execute", NoBuffer },
142 { LFUN_COMMAND_PREFIX, "command-prefix", NoBuffer },
143 { LFUN_COMMAND_SEQUENCE, "command-sequence", NoBuffer },
144 { LFUN_COPY, "copy", ReadOnly },
145 { LFUN_CUT, "cut", Noop },
146 { LFUN_DATE_INSERT, "date-insert", Noop },
147 { LFUN_DELETE_BACKWARD_SKIP, "delete-backward-skip", Noop },
148 { LFUN_DELETE_FORWARD_SKIP, "delete-forward-skip", Noop },
149 { LFUN_DEPTH_DECREMENT, "depth-decrement", Noop },
150 { LFUN_DEPTH_INCREMENT, "depth-increment", Noop },
151 { LFUN_DOTS_INSERT, "dots-insert", Noop },
152 { LFUN_DOWN, "down", ReadOnly | NoUpdate },
153 { LFUN_DOWN_SELECT, "down-select", ReadOnly | SingleParUpdate },
154 { LFUN_DROP_LAYOUTS_CHOICE, "drop-layouts-choice", ReadOnly },
155 { LFUN_END_OF_SENTENCE_PERIOD_INSERT, "end-of-sentence-period-insert", Noop },
156 { LFUN_ENVIRONMENT_INSERT, "environment-insert", Noop },
157 { LFUN_ERROR_NEXT, "error-next", ReadOnly },
158 { LFUN_ERT_INSERT, "ert-insert", Noop },
159 { LFUN_FILE_INSERT, "file-insert", Noop },
160 { LFUN_FILE_INSERT_ASCII, "file-insert-ascii", Noop },
161 { LFUN_FILE_INSERT_ASCII_PARA, "file-insert-ascii-para", Noop },
162 { LFUN_FILE_NEW, "file-new", NoBuffer },
163 { LFUN_FILE_OPEN, "file-open", NoBuffer },
164 { LFUN_FLOAT_INSERT, "float-insert", Noop },
165 { LFUN_FLOAT_WIDE_INSERT, "float-wide-insert", Noop },
166 { LFUN_WRAP_INSERT, "wrap-insert", Noop },
167 { LFUN_FONT_BOLD, "font-bold", Noop },
168 { LFUN_FONT_CODE, "font-code", Noop },
169 { LFUN_FONT_DEFAULT, "font-default", Noop },
170 { LFUN_FONT_EMPH, "font-emph", Noop },
171 { LFUN_FONT_FREE_APPLY, "font-free-apply", Noop },
172 { LFUN_FONT_FREE_UPDATE, "font-free-update", Noop },
173 { LFUN_FONT_NOUN, "font-noun", Noop },
174 { LFUN_FONT_ROMAN, "font-roman", Noop },
175 { LFUN_FONT_SANS, "font-sans", Noop },
176 { LFUN_FONT_FRAK, "font-frak", Noop },
177 { LFUN_FONT_ITAL, "font-ital", Noop },
178 { LFUN_FONT_SIZE, "font-size", Noop },
179 { LFUN_FONT_STATE, "font-state", ReadOnly },
180 { LFUN_FONT_UNDERLINE, "font-underline", Noop },
181 { LFUN_FOOTNOTE_INSERT, "footnote-insert", Noop },
182 { LFUN_HFILL_INSERT, "hfill-insert", Noop },
183 { LFUN_HELP_OPEN, "help-open", NoBuffer | Argument},
184 { LFUN_HTML_INSERT, "html-insert", Noop },
185 { LFUN_HYPHENATION_POINT_INSERT, "hyphenation-point-insert", Noop },
186 { LFUN_LIGATURE_BREAK_INSERT, "ligature-break-insert", Noop },
187 { LFUN_INDEX_INSERT, "index-insert", Noop },
188 { LFUN_INDEX_PRINT, "index-print", Noop },
189 { LFUN_KEYMAP_OFF, "keymap-off", ReadOnly },
190 { LFUN_KEYMAP_PRIMARY, "keymap-primary", ReadOnly },
191 { LFUN_KEYMAP_SECONDARY, "keymap-secondary", ReadOnly },
192 { LFUN_KEYMAP_TOGGLE, "keymap-toggle", ReadOnly },
193 { LFUN_LABEL_INSERT, "label-insert", Noop },
194 { LFUN_OPTIONAL_INSERT, "optional-insert", Noop },
195 { LFUN_BIBITEM_INSERT, "bibitem-insert", Noop },
196 { LFUN_CITATION_INSERT, "citation-insert", Noop },
197 { LFUN_BIBTEX_DATABASE_ADD, "bibtex-database-add", Noop },
198 { LFUN_BIBTEX_DATABASE_DEL, "bibtex-database-del", Noop },
199 { LFUN_LINE_INSERT, "line-insert", Noop },
200 { LFUN_PAGEBREAK_INSERT, "pagebreak-insert", Noop },
201 { LFUN_LANGUAGE, "language", Noop },
202 { LFUN_LAYOUT, "layout", Noop },
203 { LFUN_LAYOUT_PARAGRAPH, "layout-paragraph", ReadOnly },
204 { LFUN_LAYOUT_TABULAR, "layout-tabular", Noop },
205 { LFUN_LINE_BEGIN, "line-begin", ReadOnly | NoUpdate},
206 { LFUN_LINE_BEGIN_SELECT, "line-begin-select", ReadOnly | SingleParUpdate },
207 { LFUN_LINE_DELETE, "line-delete-forward", Noop }, // there is no line-delete-backward
208 { LFUN_LINE_END, "line-end", ReadOnly | NoUpdate},
209 { LFUN_LINE_END_SELECT, "line-end-select", ReadOnly | SingleParUpdate },
211 { LFUN_LIST_INSERT, "list-insert", Noop },
213 { LFUN_LYX_QUIT, "lyx-quit", NoBuffer },
214 { LFUN_MARGINALNOTE_INSERT, "marginalnote-insert", Noop },
215 { LFUN_MARK_OFF, "mark-off", ReadOnly },
216 { LFUN_MARK_ON, "mark-on", ReadOnly },
217 { LFUN_MARK_TOGGLE, "mark-toggle", ReadOnly },
218 { LFUN_MATH_DELIM, "math-delim", Noop },
219 { LFUN_MATH_BIGDELIM, "math-bigdelim", Noop },
220 { LFUN_MATH_DISPLAY, "math-display", Noop },
221 { LFUN_MATH_INSERT, "math-insert", Noop },
222 { LFUN_MATH_SUBSCRIPT, "math-subscript", Noop },
223 { LFUN_MATH_SUPERSCRIPT, "math-superscript", Noop },
224 { LFUN_MATH_LIMITS, "math-limits", Noop },
225 { LFUN_MATH_MACRO, "math-macro", Noop },
226 { LFUN_MATH_MUTATE, "math-mutate", Noop },
227 { LFUN_MATH_SPACE, "math-space", Noop },
228 { LFUN_MATH_IMPORT_SELECTION, "math-import-selection", Noop },
229 { LFUN_MATH_MATRIX, "math-matrix", Noop },
230 { LFUN_MATH_MODE, "math-mode", Noop },
231 { LFUN_MATH_NONUMBER, "math-nonumber", Noop },
232 { LFUN_MATH_NUMBER, "math-number", Noop },
233 { LFUN_MATH_EXTERN, "math-extern", Noop },
234 { LFUN_MATH_SIZE, "math-size", Noop },
235 { LFUN_MENU_OPEN, "menu-open", NoBuffer },
236 { LFUN_MENU_SEPARATOR_INSERT, "menu-separator-insert", Noop },
237 { LFUN_META_PREFIX, "meta-prefix", NoBuffer },
238 { LFUN_BRANCH_INSERT, "branch-insert", Noop },
239 { LFUN_CHARSTYLE_INSERT, "charstyle-insert", Noop },
240 { LFUN_NOTE_INSERT, "note-insert", Noop },
241 { LFUN_BOX_INSERT, "box-insert", Noop },
242 { LFUN_NOTE_NEXT, "note-next", ReadOnly },
243 { LFUN_INSET_TOGGLE, "", ReadOnly },
244 { LFUN_NEXT_INSET_TOGGLE, "next-inset-toggle", ReadOnly },
245 { LFUN_ALL_INSETS_TOGGLE, "all-insets-toggle", ReadOnly },
246 { LFUN_PARAGRAPH_DOWN, "paragraph-down", ReadOnly | NoUpdate},
247 { LFUN_PARAGRAPH_DOWN_SELECT, "paragraph-down-select", ReadOnly },
248 { LFUN_PARAGRAPH_GOTO, "paragraph-goto", ReadOnly },
249 { LFUN_OUTLINE_UP, "outline-up", Noop },
250 { LFUN_OUTLINE_DOWN, "outline-down", Noop },
251 { LFUN_OUTLINE_IN, "outline-in", Noop },
252 { LFUN_OUTLINE_OUT, "outline-out", Noop },
253 { LFUN_PARAGRAPH_SPACING, "paragraph-spacing", Noop },
254 { LFUN_PARAGRAPH_UP, "paragraph-up", ReadOnly | NoUpdate},
255 { LFUN_PARAGRAPH_UP_SELECT, "paragraph-up-select", ReadOnly },
256 { LFUN_PASTE, "paste", Noop },
257 { LFUN_PREFERENCES_SAVE, "preferences-save", NoBuffer },
258 { LFUN_PRIMARY_SELECTION_PASTE, "primary-selection-paste", Noop },
259 { LFUN_QUOTE_INSERT, "quote-insert", Noop },
260 { LFUN_RECONFIGURE, "reconfigure", NoBuffer },
261 { LFUN_REDO, "redo", Noop },
262 { LFUN_LABEL_GOTO, "label-goto", ReadOnly },
263 { LFUN_REFERENCE_NEXT, "reference-next", ReadOnly },
264 { LFUN_SCREEN_DOWN, "screen-down", ReadOnly | NoUpdate},
265 { LFUN_SCREEN_DOWN_SELECT, "screen-down-select", ReadOnly },
266 { LFUN_SCREEN_FONT_UPDATE, "screen-font-update", NoBuffer },
267 { LFUN_SCREEN_RECENTER, "screen-recenter", ReadOnly },
268 { LFUN_SCREEN_UP, "screen-up", ReadOnly | NoUpdate},
269 { LFUN_SCREEN_UP_SELECT, "screen-up-select", ReadOnly },
270 { LFUN_SELF_INSERT, "self-insert", SingleParUpdate },
271 { LFUN_SPACE_INSERT, "space-insert", Noop },
272 { LFUN_SERVER_CHAR_AFTER, "server-char-after", ReadOnly },
273 { LFUN_SERVER_GET_FONT, "server-get-font", ReadOnly },
274 { LFUN_SERVER_GET_LAYOUT, "server-get-layout", ReadOnly },
275 { LFUN_SERVER_GET_NAME, "server-get-name", ReadOnly },
276 { LFUN_SERVER_GET_XY, "server-get-xy", ReadOnly },
277 { LFUN_SERVER_GOTO_FILE_ROW, "server-goto-file-row", Noop },
278 { LFUN_SERVER_NOTIFY, "server-notify", ReadOnly },
279 { LFUN_SERVER_SET_XY, "server-set-xy", ReadOnly },
280 { LFUN_SET_COLOR, "set-color", ReadOnly | NoBuffer },
281 { LFUN_CELL_BACKWARD, "cell-backward", Noop },
282 { LFUN_CELL_FORWARD, "cell-forward", Noop },
283 { LFUN_CELL_SPLIT, "cell-split", Noop },
284 { LFUN_TABULAR_INSERT, "tabular-insert", Noop },
285 { LFUN_TABULAR_FEATURE, "tabular-feature", Noop },
287 { LFUN_THEOREM_INSERT, "theorem-insert", Noop },
289 { LFUN_THESAURUS_ENTRY, "thesaurus-entry", ReadOnly },
290 { LFUN_TOC_INSERT, "toc-insert", Noop },
291 { LFUN_TOC_VIEW, "toc-view", ReadOnly },
292 { LFUN_TOGGLE_CURSOR_FOLLOWS_SCROLLBAR, "toggle-cursor-follows-scrollbar", ReadOnly },
293 { LFUN_UNDO, "undo", Noop },
294 { LFUN_UP, "up", ReadOnly | NoUpdate},
295 { LFUN_UP_SELECT, "up-select", ReadOnly | SingleParUpdate },
296 { LFUN_URL_INSERT, "url-insert", Noop },
297 { LFUN_VC_CHECK_IN, "vc-check-in", ReadOnly },
298 { LFUN_VC_CHECK_OUT, "vc-check-out", ReadOnly },
299 { LFUN_VC_REGISTER, "vc-register", ReadOnly },
300 { LFUN_VC_REVERT, "vc-revert", ReadOnly },
301 { LFUN_VC_UNDO_LAST, "vc-undo-last", ReadOnly },
302 { LFUN_WORD_BACKWARD, "word-backward", ReadOnly | NoUpdate},
303 { LFUN_WORD_BACKWARD_SELECT, "word-backward-select", ReadOnly | SingleParUpdate },
304 { LFUN_WORD_CAPITALIZE, "word-capitalize", Noop },
305 { LFUN_WORD_DELETE_BACKWARD, "word-delete-backward", Noop },
306 { LFUN_WORD_DELETE_FORWARD, "word-delete-forward", Noop },
307 { LFUN_WORD_FIND_BACKWARD, "word-find-backward", ReadOnly },
308 { LFUN_WORD_FIND_FORWARD, "word-find-forward", ReadOnly },
309 { LFUN_WORD_FORWARD, "word-forward", ReadOnly | NoUpdate},
310 { LFUN_WORD_FORWARD_SELECT, "word-forward-select", ReadOnly | SingleParUpdate },
311 { LFUN_WORD_LOWCASE, "word-lowcase", Noop },
312 { LFUN_WORD_SELECT, "word-select", ReadOnly },
313 { LFUN_WORD_UPCASE, "word-upcase", Noop },
314 { LFUN_MESSAGE, "message", NoBuffer },
315 { LFUN_CHARS_TRANSPOSE, "chars-transpose", Noop },
316 { LFUN_FLOAT_LIST, "float-list", Noop },
317 { LFUN_ESCAPE, "escape", ReadOnly },
318 { LFUN_CHANGES_TRACK, "changes-track", Noop },
319 { LFUN_CHANGES_OUTPUT, "changes-output", Noop },
320 { LFUN_CHANGE_NEXT, "change-next", ReadOnly },
321 { LFUN_CHANGES_MERGE, "changes-merge", Noop },
322 { LFUN_CHANGE_ACCEPT, "change-accept", Noop },
323 { LFUN_CHANGE_REJECT, "change-reject", Noop },
324 { LFUN_ALL_CHANGES_ACCEPT, "all-changes-accept", Noop },
325 { LFUN_ALL_CHANGES_REJECT, "all-changes-reject", Noop },
326 { LFUN_DIALOG_SHOW, "dialog-show", NoBuffer },
327 { LFUN_DIALOG_SHOW_NEW_INSET, "dialog-show-new-inset", Noop },
328 { LFUN_DIALOG_UPDATE, "dialog-update", NoBuffer },
329 { LFUN_DIALOG_HIDE, "dialog-hide", Noop },
330 { LFUN_DIALOG_DISCONNECT_INSET, "dialog-disconnect-inset", Noop },
331 { LFUN_INSET_APPLY, "inset-apply", Noop },
332 { LFUN_INSET_DISSOLVE, "inset-dissolve", Noop },
333 { LFUN_INSET_INSERT, "inset-insert", Noop },
334 { LFUN_INSET_MODIFY, "", Noop },
335 { LFUN_INSET_DIALOG_UPDATE, "", Noop },
336 { LFUN_INSET_SETTINGS, "inset-settings", ReadOnly },
337 { LFUN_PARAGRAPH_PARAMS_APPLY, "paragraph-params-apply", Noop },
338 { LFUN_PARAGRAPH_UPDATE, "", Noop },
339 { LFUN_EXTERNAL_EDIT, "external-edit", Noop },
340 { LFUN_GRAPHICS_EDIT, "graphics-edit", Noop },
341 { LFUN_REPEAT, "repeat", NoBuffer },
342 { LFUN_WORD_FIND, "word-find", ReadOnly },
343 { LFUN_WORD_REPLACE, "word-replace", Noop },
344 { LFUN_BUFFER_LANGUAGE, "buffer-language", Noop },
345 { LFUN_TEXTCLASS_APPLY, "textclass-apply", Noop },
346 { LFUN_TEXTCLASS_LOAD, "textclass-load", Noop },
347 { LFUN_BUFFER_SAVE_AS_DEFAULT, "buffer-save-as-default", Noop },
348 { LFUN_BUFFER_PARAMS_APPLY, "buffer-params-apply", Noop },
349 { LFUN_LYXRC_APPLY, "lyxrc-apply", NoBuffer },
350 { LFUN_INSET_REFRESH, "", Noop },
351 { LFUN_BUFFER_NEXT, "buffer-next", ReadOnly },
352 { LFUN_BUFFER_PREVIOUS, "buffer-previous", ReadOnly },
353 { LFUN_WORDS_COUNT, "words-count", ReadOnly },
354 { LFUN_FINISHED_RIGHT, "", ReadOnly },
355 { LFUN_FINISHED_LEFT, "", ReadOnly },
356 { LFUN_FINISHED_UP, "", ReadOnly },
357 { LFUN_FINISHED_DOWN, "", ReadOnly },
358 { LFUN_MOUSE_PRESS, "", ReadOnly },
359 { LFUN_MOUSE_MOTION, "", ReadOnly | SingleParUpdate },
360 { LFUN_MOUSE_RELEASE, "", ReadOnly },
361 { LFUN_MOUSE_DOUBLE, "", ReadOnly },
362 { LFUN_MOUSE_TRIPLE, "", ReadOnly },
363 { LFUN_PARAGRAPH_MOVE_DOWN, "paragraph-move-down", Noop },
364 { LFUN_PARAGRAPH_MOVE_UP, "paragraph-move-up", Noop },
365 { LFUN_WINDOW_NEW, "window-new", NoBuffer },
366 { LFUN_NOACTION, "", Noop }
369 for (int i = 0; items[i].action != LFUN_NOACTION; ++i) {
370 newFunc(items[i].action, items[i].name, items[i].attrib);
377 LyXAction::LyXAction()
383 // Returns an action tag from a string.
384 FuncRequest LyXAction::lookupFunc(string const & func) const
386 string const func2 = trim(func);
389 return FuncRequest(LFUN_NOACTION);
393 string const arg = split(func2, cmd, ' ');
395 func_map::const_iterator fit = lyx_func_map.find(cmd);
397 return fit != lyx_func_map.end() ? FuncRequest(fit->second, arg) : FuncRequest(LFUN_UNKNOWN_ACTION);
401 string const LyXAction::getActionName(kb_action action) const
403 info_map::const_iterator const it = lyx_info_map.find(action);
404 return it != lyx_info_map.end() ? it->second.name : string();
408 bool LyXAction::funcHasFlag(kb_action action,
409 LyXAction::func_attrib flag) const
411 info_map::const_iterator ici = lyx_info_map.find(action);
413 if (ici == lyx_info_map.end()) {
414 lyxerr << "action: " << action << " is not known." << endl;
418 return ici->second.attrib & flag;
422 LyXAction::const_func_iterator LyXAction::func_begin() const
424 return lyx_func_map.begin();
428 LyXAction::const_func_iterator LyXAction::func_end() const
430 return lyx_func_map.end();
434 ostream & operator<<(ostream & o, kb_action action)
436 return o << int(action);